If you wish to edit a Material, you can use the following BAPI.
BAPI_MATERIAL_EDIT
The above mentioned BAPI makes use of CALL TRANSACTION MM02 or MM42 to edit the MATERIAL. The selection of the appropriate transaction is made based on the entered material. The table MAW1 is checked for the existence of material, if the material exists in MAW1 then the transaction MM02 is called else transaction MM42 is called.
BAPI_MATERIAL_EXISTENCECHECK and
CONVERSION_EXIT_MATN1_OUTPUT
The user is then presented with the change material screen either for MM02 or MM42.CONVERSION_EXIT_MATN1_OUTPUT
The code below shows the values of the input parameters for the BAPI BAPI_MATERIAL_EDI
REPORT ZEX_CHANGEMAT .
Parameters: p_matnr like BAPIMATALL-MATERIAL,
p_fscrn like BAPIMATALL-SKIP_1ST_SCREEN.
Data: d_ret like BAPIRET1.
CALL FUNCTION 'BAPI_MATERIAL_EDIT'
EXPORTING
MATERIAL = p_matnr
SKIP_1ST_SCREEN = p_fscrn
IMPORTING
RETURN = d_ret
.
if sy-subrc = 0.
endif.
Parameters: p_matnr like BAPIMATALL-MATERIAL,
p_fscrn like BAPIMATALL-SKIP_1ST_SCREEN.
Data: d_ret like BAPIRET1.
CALL FUNCTION 'BAPI_MATERIAL_EDIT'
EXPORTING
MATERIAL = p_matnr
SKIP_1ST_SCREEN = p_fscrn
IMPORTING
RETURN = d_ret
.
if sy-subrc = 0.
endif.
No comments:
Post a Comment