Application Development and Automation 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: 
Read only

bapi_goodsmvt_create

Former Member
0 Likes
523

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
481

It will be in the field MATERIALDOCUMENT. If not then check the entries in the table RETURN.

3 REPLIES 3
Read only

Former Member
0 Likes
482

It will be in the field MATERIALDOCUMENT. If not then check the entries in the table RETURN.

Read only

0 Likes
481

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

Read only

Former Member
0 Likes
481

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