‎2007 Jun 13 5:19 PM
Hi,
I have problem with function BAPI_MATERIAL_MAINTAINDATA_RT. I use it for mass changing on material.
All modifications work fine, but I cannot make work tbl_LAYOUTMODULEASSGMT (add or modifiy lines in MALG). No error messages in return table. I don't understand.
The code is like :
MOVE : '004' to tbl_layoutmoduleassgmt-function,
tbl_articles-matnr TO tbl_layoutmoduleassgmt-material,
'PCE' TO tbl_layoutmoduleassgmt-unit,
'PCE' to tbl_layoutmoduleassgmt-unit_iso,
p_laygr TO tbl_layoutmoduleassgmt-layout_mod,
'1' to tbl_layoutmoduleassgmt-SHELF_QUANTITY_MAX,
'004' to tbl_layoutmoduleassgmtx-function,
tbl_articles-matnr TO tbl_layoutmoduleassgmtx-material,
p_meinh TO tbl_layoutmoduleassgmtx-unit,
p_meinh to tbl_layoutmoduleassgmtx-unit_iso,
p_laygr TO tbl_layoutmoduleassgmtx-layout_mod,
'X' to tbl_layoutmoduleassgmtx-SHELF_QUANTITY_MAX.
APPEND : tbl_layoutmoduleassgmt,
tbl_layoutmoduleassgmtx.
Thanks for helping me
Marie
‎2007 Jun 15 10:12 AM
‎2007 Jun 15 10:41 AM
Hi,
insted of this BAPI_MATERIAL_MAINTAINDATA_RT
http://www.sap-img.com/abap/bapi-to-copy-materials-from-one-plant-to-another.htm
the bapi BAPI_MATERIAL_SAVEDATA does it for you.
why can't you use BAPI_MATERIAL_SAVEDATA.
please try this:
REPORT z_temp_13.
DATA: zheaddata TYPE bapie1mathead.
DATA: wa_mvkert TYPE bapie1mvkert.
DATA: it_mvkert TYPE TABLE OF bapie1mvkert.
DATA: wa_mvkertx TYPE bapie1mvkertx.
DATA: it_mvkertx TYPE TABLE OF bapie1mvkertx.
DATA: zbapiret1 LIKE bapiret1.
PARAMETERS:
p_matnr LIKE mara-matnr,
p_vkorg LIKE mvke-vkorg,
p_vtweg LIKE mvke-vtweg,
p_vmsta LIKE mvke-vmsta,
p_vmstd LIKE mvke-vmstd.
START-OF-SELECTION.
zheaddata-material = p_matnr.
zheaddata-sales_view = 'X'.
*
wa_mvkert-material = p_matnr.
wa_mvkert-sales_org = p_vkorg.
wa_mvkert-distr_chan = p_vtweg.
wa_mvkert-sal_status = p_vmsta.
wa_mvkert-valid_from = p_vmstd.
APPEND wa_mvkert TO it_mvkert.
*
wa_mvkertx-material = p_matnr.
wa_mvkertx-sales_org = p_vkorg.
wa_mvkertx-distr_chan = p_vtweg.
wa_mvkertx-sal_status = 'X'.
wa_mvkertx-valid_from = 'X'.
APPEND wa_mvkertx TO it_mvkertx.
*
CALL FUNCTION 'BAPI_MATERIAL_MAINTAINDATA_RT'
EXPORTING
headdata = zheaddata
IMPORTING
return = zbapiret1
TABLES
salesdata = it_mvkert
salesdatax = it_mvkertx.
*
WRITE : /
zbapiret1-type
, zbapiret1-id
, zbapiret1-number
, zbapiret1-message
Check the program<b> SAPRWMCA</b> to populate the internal tables for BAPI..
<b>Reward points</b>
Regards