‎2007 Sep 05 2:36 PM
hi i'm unable to get the materialdocuemnt no from my code: can you any one help
MOVE '04' TO GOODSMVT_CODE.
MOVE SY-DATUM TO GOODSMVT_HEADER-PSTNG_DATE.
MOVE SY-DATUM TO GOODSMVT_HEADER-DOC_DATE.
item-MATERIAL = ITAB-MATNR.
item-PLANT = PLANT.
item-STGE_LOC = ITAB-LGORT.
item-ENTRY_UOM = ITAB-MEINS.
item-ENTRY_QNT = ITAB-VERME.
item-MOVE_TYPE = '919'.
READ TABLE T_ADUMMY INDEX 1.
item-MOVE_MAT = T_ADUMMY-ADUMMY.
item-MOVE_PLANT = PLANT.
item-MOVE_STLOC = ITAB-LGORT.
item-MOVE_REAS = ' '.
item-MVT_IND = ' '.
APPEND item.
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
GOODSMVT_HEADER = GOODSMVT_HEADER
GOODSMVT_CODE = GOODSMVT_CODE
TESTRUN = ' '
IMPORTING
GOODSMVT_HEADRET = GOODSMVT_HEADRET
MATERIALDOCUMENT = MATERIALDOCUMENT
MATDOCUMENTYEAR = MATDOCUMENTYEAR
TABLES
GOODSMVT_ITEM = item
GOODSMVT_SERIALNUMBER = GOODSMVT_SERIALNUMBER
RETURN = RETURN
.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'
IMPORTING
RETURN = RETURN.
‎2007 Sep 05 2:39 PM
It will be in the field MATERIALDOCUMENT. If not then check the entries in the table RETURN.
‎2007 Sep 05 2:39 PM
It will be in the field MATERIALDOCUMENT. If not then check the entries in the table RETURN.
‎2007 Sep 05 2:43 PM
hi,
check this code
call function 'ZMM_BAPI_GOODSMVT_CREATE'
exporting
goodsmvt_header = ih
goodsmvt_code = ic
importing
goodsmvt_headret = egh
materialdocument = emd
matdocumentyear = emy
tables
goodsmvt_item = tgi
return = tret.
if not egh is initial.
wai_tab3-mat_doc = egh-mat_doc.
wai_tab3-doc_year = egh-doc_year.
append wai_tab3 to i_tab3 .
clear wai_tab3.
else.
loop at tret.
read table tret with key type = 'E'
message_v1 = tret-message_v1
row = flag.
if sy-subrc = 0.
MOVE-CORRESPONDING tret TO return.
move tret-type to it_display-type.
move tret-number to it_display-number.
move tret-message to it_display-message.
endif.
endif.
have a warpper bapi with commit work.
It works fine for me
Hope this helps
Cheers
Alfred
‎2007 Sep 05 2:42 PM
Hi,
Check the RETURN table .
You may have got some error or warning messages.
There you can find wxact reason for the problem.
Regards,
Viswanath Babu.P.D