05-26-2010 6:26 AM
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
05-26-2010 7:40 AM
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
05-26-2010 7:40 AM
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
05-26-2010 9:26 AM
05-26-2010 10:30 AM