Functionality This function module converts the internationally normed ISO code formeasurement units into the SAP-internal measurement unit code. The flag UNIQUE is set ('X') if the conversion is unique; i.e. only oneentry flagged as "Primary" was found with the specified ISO code. Otherwise UNIQUE is empty (' '), which means that the ISO code was notmaintained correctly because there is no unique assignment of ISO codeto SAP code. In this case, the SAP code of the last enntry in theconversion table is returned as SAP_CODE. If no primary entry with the specified ISO code is found, the exceptionNOT_FOUND is triggered. This exception is also triggered if an emptyparameter ISO_CODE is transferred. Example DATA: ISO_MEASURE_UNIT LIKE T006-ISOCODE, SAP_MEASURE_UNIT LIKE T006-MSEHI, UNIQUE_FLAG(1) TYPE C. ISO_MEASURE_UNIT = 'PCE'. CALL FUNCTION 'UNIT_OF_MEASURE_ISO_TO_SAP' EXPORTING ISO_CODE = ISO_MEASURE_UNIT IMPORTING SAP_CODE = SAP_MEASURE_UNIT UNIQUE = UNIQUE_FLAG EXCEPTIONS NOT_FOUND = 1. After this call, SAP_MEASURE_UNIT has the value 'PC' (for piece). If only one entry in the table T006 satisfies the condition that theISO code is 'PCE' and the field PRIMARY is 'X', UNIQUE_FLAG = 'X';otherwise ' '. The SAP code for a measurement unit is the internally usedcode>. UNIQUE is a flag which states whether only one entry or several entrieswere found: 'X':,,exactly one entry was found. ' ':,,more than one entry was found. If the ISO codes are correctly maintained, only one entry should befound; only then is the Assignment of ISO code to SAPcode> unique. The ISO code for the measurement unit is ameasurement unit code> which has been normed by theInternational Standards Organisation (ISO). |