Hi Experts,
I am using BAPI_MATERIAL_SAVEDATA to create material master.But the Order unit is not save.
I have written this peace of code for order unit,
****************UNIT OF MEASURE***************
LOOP AT IT_ITEM INTO WA_ITEM WHERE INT_NUM EQ WA_MARA-INT_NUM.
IF WA_ITEM-MEINH IS NOT INITIAL.
TRANSLATE WA_ITEM-MEINH TO UPPER CASE.
CALL FUNCTION 'CONVERSION_EXIT_CUNIT_INPUT'
EXPORTING
INPUT = WA_ITEM-MEINH
LANGUAGE = SY-LANGU
IMPORTING
OUTPUT = LWA_UNITSOFMEASURE-ALT_UNIT
EXCEPTIONS
UNIT_NOT_FOUND = 1
OTHERS = 2.
LWA_UNITSOFMEASURE-DENOMINATR = WA_ITEM-UMREN.
LWA_UNITSOFMEASURE-NUMERATOR = WA_ITEM-UMREZ.
*Add by Palash
* LWA_UNITSOFMEASURE-ALT_UNIT = 'NOS'.
* IF LWA_UNITSOFMEASURE-ALT_UNIT = 'ST'.
* LWA_UNITSOFMEASURE-ALT_UNIT = 'PC'.
* ENDIF.
* LWA_UNITSOFMEASURE-DEL_FLAG = 'X'.
LWA_UNITSOFMEASURE-ALT_UNIT_ISO = LWA_UNITSOFMEASURE-ALT_UNIT.
*Add by palash
APPEND LWA_UNITSOFMEASURE TO LI_UNITSOFMEASURE.
TRANSLATE WA_ITEM-MEINH TO UPPER CASE.
CALL FUNCTION 'CONVERSION_EXIT_CUNIT_INPUT'
EXPORTING
INPUT = WA_ITEM-MEINH
LANGUAGE = SY-LANGU
IMPORTING
OUTPUT = LWA_UNITSOFMEASUREX-ALT_UNIT
EXCEPTIONS
UNIT_NOT_FOUND = 1
OTHERS = 2.
IF SY-SUBRC EQ 1.
MESSAGE 'UNIT NOT FOUND' TYPE 'E'.
ENDIF.
LWA_UNITSOFMEASUREX-DENOMINATR = LC_X.
LWA_UNITSOFMEASUREX-NUMERATOR = LC_X.
*Add by Palash
* LWA_UNITSOFMEASUREX-ALT_UNIT = 'NOS'.
* IF LWA_UNITSOFMEASUREX-ALT_UNIT = 'ST'.
* LWA_UNITSOFMEASUREX-ALT_UNIT = 'PC'.
* ENDIF.
LWA_UNITSOFMEASUREX-ALT_UNIT_ISO = LWA_UNITSOFMEASUREX-ALT_UNIT.
*Add by palash
APPEND LWA_UNITSOFMEASUREX TO LI_UNITSOFMEASUREX.
ENDIF.
CLEAR WA_ITEM.
ENDLOOP.
****************UNIT OF MEASURE***************
Please help.