05-22-2008 4:38 PM
Hi, i need to add record into mard table and this is my code :
DATA: zheaddata LIKE bapie1mathead,
zreturn LIKE bapireturn1 OCCURS 0 WITH HEADER LINE,
zstoragelocationdata LIKE bapie1mardrt OCCURS 0 WITH HEADER LINE,
zstoragelocationdatax LIKE bapie1mardrtx OCCURS 0 WITH HEADER LINE.
zheaddata-function = '004'.
zheaddata-material = t_mara-matnr.
zheaddata-matl_type = t_mara-mtart.
zheaddata-matl_group = t_mara-matkl.
zheaddata-matl_cat = t_mara-attyp.
zstoragelocationdata-function = '004'.
zstoragelocationdata-material = t_mara-matnr.
zstoragelocationdata-plant = so_werks-LOW.
zstoragelocationdata-stge_loc = so_lgort-LOW.
APPEND zstoragelocationdata.
CLEAR zstoragelocationdata.
zstoragelocationdatax-function = '004'.
zstoragelocationdatax-material = t_mara-matnr.
zstoragelocationdatax-plant = so_werks-LOW.
zstoragelocationdatax-stge_loc = so_lgort-LOW.
APPEND zstoragelocationdatax.
CLEAR zstoragelocationdatax.
zt_mara = t_mara.
CALL FUNCTION 'BAPI_MATERIAL_MAINTAINDATA_RT'
EXPORTING
headdata = zheaddata
IMPORTING
return = zreturn
TABLES
storagelocationdata = zstoragelocationdata
storagelocationdatax = zstoragelocationdatax.
IF sy-subrc <> 0.
ROLLBACK WORK.
CALL FUNCTION 'DEQUEUE_ALL'.
t_log-matnr = zt_mara-matnr.
t_log-werks = so_werks-LOW.
t_log-lgort = so_lgort-LOW.
t_log-esit = 'Errore!'.
APPEND t_log.
CLEAR t_log.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
COMMIT WORK AND WAIT.
CALL FUNCTION 'DEQUEUE_ALL'.
ENDIF.
Using bapie1mardrt for fill into mard is not correct?
Thanks in advance!
Stefano
Edited by: Björn Panter on May 28, 2008 5:05 PM
05-26-2008 3:25 PM
To cerate pure MARD data without content, use the
PLANTKEYS and STORAGELOCATIONKEYS
this will be faster !
In the header set a X in the LOGISTIC field
Edited by: Björn Panter on May 26, 2008 4:25 PM
05-26-2008 3:25 PM
To cerate pure MARD data without content, use the
PLANTKEYS and STORAGELOCATIONKEYS
this will be faster !
In the header set a X in the LOGISTIC field
Edited by: Björn Panter on May 26, 2008 4:25 PM
05-26-2008 3:48 PM
THANKS!!!!
THANKS!!!!
THANKS!!!!
It's work perfectly!
Edited by: Azzi Stefano on May 26, 2008 5:12 PM
05-26-2008 4:26 PM
Mhhh. if i change in the header the logistic flag "logst_view" with the "logdc_view" dont'work.....work only with LOGST_VIEW....can you help me?
Thanks
05-26-2008 9:50 PM
Hi Stefano,
this really depends on your system setting now.
In the header the flags represents the view, you can seelct in MM42.
If course the location entry WERKS must be a DC. In all other cases it must be a store.
Now it is too difficult to continue without system access.
To clarify the situation, please create the a kind of IDOC in transaction WE19 for ARTMAS. Thisis the same structure like the BAPI. You can try to inbound it and play a little bit with it.
Open an customer message, add user nad password and one of support colleagues (Axel or Barny) will pick up the message and will explain you the situation directly in your system.
Regards
Björn
05-29-2008 4:07 PM