Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Issue while updating EAN in Material Master

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

nirajgadre
Active Contributor
0 Kudos

Hi,

Try to transfer the parameter FUNCTION in the structured bapie1marmrt.

or try to pass the EAN number to structure INTERNATIONALARTNOS with parameter FUNCTION.

3 REPLIES 3

nirajgadre
Active Contributor
0 Kudos

Hi,

Try to transfer the parameter FUNCTION in the structured bapie1marmrt.

or try to pass the EAN number to structure INTERNATIONALARTNOS with parameter FUNCTION.

Former Member
0 Kudos

Hi,

The indicator in field MAIN_EAN must be set.

u have to set 'X' for VENDOR_NO in structure BAPIE1MLEART.

Revert back if u have any issues..

Regards,

DSK

Former Member
0 Kudos

Issue is i didn't pass the Unit of Measure in UomX table.