Application Development 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: 

BAPI_GOODSMVT_CREATE (Transfer from one storage loc to other storage loc)

former_member297642
Participant
0 Kudos
3,414

Hi,

My requirement is to transfer Material,qty,user name, date,time,etc from one storage location to other storage location.

I am doing this by using BAPI_GOODSMVT_CREATE.

But I am getting the following error in BAPI Return table: "Qty and / or "delivery completed" ind. or final issue ind. are missing".

Please correct me, if I am doing anything wrong in the following code.

  • Fill Bapi header

ls_bapi_hdr-doc_date = sy-datum.

ls_mvt_code-gm_code = '04'.

ls_bapi_hdr-header_txt = pt_header-trail.

ls_bapi_hdr-pr_uname = pt_header-uname.

  • Fill Bapi items.

LOOP AT pt_details.

READ TABLE lt_mard WITH KEY matnr = pt_details-matnr

werks = c_werks

lgort = c_lgort.

IF sy-subrc = 0.

lt_items-material = pt_details-matnr.

lt_items-plant = lt_mard-werks.

lt_items-stge_loc = lt_mard-lgort.

lt_items-entry_qnt = lt_mard-labst.

lt_items-move_type = c_mvt_311.

lt_items-move_mat = lt_mard-matnr.

lt_items-move_plant = lt_mard-werks.

lt_items-nb_slips = 0. "no GR slips

lt_items-move_stloc = c_stgloc.

APPEND lt_items.

ENDIF.

CALL FUNCTION 'BAPI_GOODSMVT_CREATE'

EXPORTING

goodsmvt_header = ls_bapi_hdr

goodsmvt_code = ls_mvt_code

testrun = lw_test

IMPORTING

goodsmvt_headret = ls_hdr_ret

TABLES

goodsmvt_item = lt_items

return = lt_return.

LOOP AT lt_return WHERE type = 'E'.

EXIT.

ENDLOOP.

IF sy-subrc NE 0.

COMMIT WORK AND WAIT.

ENDIF.

REFRESH: lt_mard,lt_items, lt_return.

ENDLOOP.

Appreciated for your valuable input.

Thanks,

Ranjith.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
345

Pass 'X' to structure field GOODSMVT_ITEM-NO_MORE_GR.

Regards

Vinod

3 REPLIES 3

mvoros
Active Contributor
0 Kudos
345

Hi,

you can try to figure out by yourself. The input value checks should be performed in FM MB_CHECK_INPUT. So you can put a breakpoin there and see why you get that message and then try to figure out what is missing in your input.

Cheers

Former Member
0 Kudos
346

Pass 'X' to structure field GOODSMVT_ITEM-NO_MORE_GR.

Regards

Vinod

former_member297642
Participant
0 Kudos
345

Solved.