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: 

Add ean11 using BAPI_MATERIAL_SAVEDATA in version 6

0 Kudos

Hi

Im doing upgrade from version 5 to version 6 and i have a problem with BAPI_MATERIAL_SAVEDATA

im using this bapi to add ean11 to a material.

in vertion 5 it worked and in vertion 6 it doesnt work

the kod is like that:

headdata-material = itab-matnr.

unitsofmeasure-ean_upc = itab-bcode.

unitsofmeasure-alt_unit = itab-meinh.

APPEND unitsofmeasure.

CLEAR: unitsofmeasurex.

unitsofmeasurex-alt_unit = itab-meinh.

unitsofmeasurex-ean_upc = 'X'.

unitsofmeasurex-ean_cat = 'X'.

APPEND unitsofmeasurex.

CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'

EXPORTING

headdata = headdata

flag_online = ' '

flag_cad_call = ' '

no_dequeue = ' '

IMPORTING

return = bapiret2

TABLES

unitsofmeasure = unitsofmeasure

unitsofmeasurex = unitsofmeasurex

returnmessages = returnmessages.

Tthe function itself does not work in vertion 6 and it did work with the same parameters in version 5.

how can i use it in version 6.

Regards

Shlomit

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

you can use BAPI_MATERIAL_MAINTAINDATA_RT.

I used this code in my program to add multiple EAN for a material.

*~ Filling BAPI Structures

ls_ean-material = w_varview-varnr.

ls_ean-unit = 'EA'.

ls_ean-ean_upc = w_varview-ean11.

IF w_varview-ean11 GE '1' AND w_varview-ean11 LE '9999999998'.

ls_ean-ean_cat = 'ZE'.

ENDIF.

IF w_varview-ean11 GE '9999999999' AND w_varview-ean11 LE '9999999999999'.

ls_ean-ean_cat = 'ZM'.

ENDIF.

APPEND ls_ean TO lit_ean.

ls_head-material = w_varview-matnr.

*~ BAPI to add EAN\UPC to variant or single article

CALL FUNCTION 'BAPI_MATERIAL_MAINTAINDATA_RT'

EXPORTING

headdata = ls_head

IMPORTING

return = ls_ret

TABLES

internationalartnos = lit_ean.

I hope this will help you.

Regards,

Narendra

3 REPLIES 3

Former Member
0 Kudos

Hi,

you can use BAPI_MATERIAL_MAINTAINDATA_RT.

I used this code in my program to add multiple EAN for a material.

*~ Filling BAPI Structures

ls_ean-material = w_varview-varnr.

ls_ean-unit = 'EA'.

ls_ean-ean_upc = w_varview-ean11.

IF w_varview-ean11 GE '1' AND w_varview-ean11 LE '9999999998'.

ls_ean-ean_cat = 'ZE'.

ENDIF.

IF w_varview-ean11 GE '9999999999' AND w_varview-ean11 LE '9999999999999'.

ls_ean-ean_cat = 'ZM'.

ENDIF.

APPEND ls_ean TO lit_ean.

ls_head-material = w_varview-matnr.

*~ BAPI to add EAN\UPC to variant or single article

CALL FUNCTION 'BAPI_MATERIAL_MAINTAINDATA_RT'

EXPORTING

headdata = ls_head

IMPORTING

return = ls_ret

TABLES

internationalartnos = lit_ean.

I hope this will help you.

Regards,

Narendra

0 Kudos

Thanks but i must use

BAPI_MATERIAL_SAVEDATA

0 Kudos

try in this table INTERNATIONALARTNOS.

or send ur complete code.