Skip to Content
0
Former Member
Nov 25, 2009 at 06:15 AM

Issue while updating EAN in Material Master

302 Views

Hi Friends,

We are using the following code to update the EAN of an existing material, but no changes are being done in the article.

I am getting a message "Messages for article 100002268: log number 0000000000012552" from the BAPI. When I checked the log its says that "No Changes made". Please let us know what we are missing.

PARAMETERS p_matnr TYPE mara-matnr.
DATA : lt_headdata TYPE bapie1mathead,
        ls_return TYPE bapireturn1,
        lt_clientdata TYPE STANDARD TABLE OF bapie1marart,
        lt_clientdatax TYPE STANDARD TABLE OF bapie1marartx,
        ls_clientdata TYPE bapie1marart,
        ls_clientdatax TYPE bapie1marartx,
        lt_addclientdata TYPE STANDARD TABLE OF bapie1maw1rt,
        lt_addclientdatax TYPE STANDARD TABLE OF bapie1maw1rtx,
        lt_uom TYPE STANDARD TABLE OF bapie1marmrt,
        ls_uom TYPE bapie1marmrt,
        lt_uomx TYPE STANDARD TABLE OF bapie1marmrtx,
        ls_uomx TYPE bapie1marmrtx,
        ls_art_ean TYPE zmm_art_ean,
        lt_art_ean TYPE STANDARD TABLE OF zmm_art_ean.

lt_headdata-material = p_matnr.
lt_headdata-basic_view = 'X'.

ls_clientdata-material = p_matnr.
ls_clientdata-base_uom = 'EA'.
APPEND ls_clientdata TO lt_clientdata.
CLEAR ls_clientdata.

ls_clientdatax-material = p_matnr
ls_clientdatax-base_uom = 'X'.
APPEND ls_clientdatax TO lt_clientdatax.
CLEAR ls_clientdatax.

ls_uom-material = p_matnr.
ls_uom-alt_unit = 'EA'.
ls_uom-ean_upc = '82901237792'.
ls_uom-denominatr = 1.
ls_uom-numerator  = 1.
APPEND ls_uom TO lt_uom.
CLEAR ls_uom.

ls_uomx-material = p_matnr
ls_uomx-alt_unit = 'X'.
ls_uomx-ean_upc =  'X'.
ls_uomx-denominatr = 'X'.
ls_uomx-numerator  = 'X'.
APPEND ls_uomx TO lt_uomx.
CLEAR ls_uomx.

CALL FUNCTION 'BAPI_MATERIAL_MAINTAINDATA_RT'
  EXPORTING
    headdata        = lt_headdata
  IMPORTING
    return          = ls_return
  TABLES
    clientdata      = lt_clientdata
    clientdatax     = lt_clientdatax
    unitsofmeasure  = lt_uom
    unitsofmeasurex = lt_uomx
  EXCEPTIONS
    OTHERS          = 1.

IF sy-subrc = 0.
  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
ENDIF.