Ansicht
Dokumentation

UNIT_OF_MEASURE_ISO_TO_SAP - Convert an ISO measurement unit code into the SAP code

UNIT_OF_MEASURE_ISO_TO_SAP - Convert an ISO measurement unit code into the SAP code

TXBHW - Original Tax Base Amount in Local Currency   PERFORM Short Reference  
This documentation is copyright by SAP AG.
SAP E-Book

Functionality

This function module converts the internationally normed ISO code for measurement units into the SAP-internal measurement unit code.

The flag UNIQUE is set ('X') if the conversion is unique; i.e. only one entry flagged as "Primary" was found with the specified ISO code.

Otherwise UNIQUE is empty (' '), which means that the ISO code was not maintained correctly because there is no unique assignment of ISO code to SAP code. In this case, the SAP code of the last enntry in the conversion table is returned as SAP_CODE.

If no primary entry with the specified ISO code is found, the exception NOT_FOUND is triggered. This exception is also triggered if an empty parameter 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 the ISO code is 'PCE' and the field PRIMARY is 'X', UNIQUE_FLAG = 'X'; otherwise ' '.





Parameters

ISO_CODE
SAP_CODE
UNIQUE

Exceptions

NOT_FOUND

Function Group

SCV0

Addresses (Business Address Services)   BAL_S_LOG - Application Log: Log header data  
This documentation is copyright by SAP AG.

Length: 2249 Date: 20240523 Time: 125535     sap01-206 ( 33 ms )