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 not updating document flow

Former Member
0 Kudos

I created a function to create an inbound delivery against a PUrchase Order and then Post the goods receipt against that inbound delivery. The inbound delivery and the material document are created correctly in the DEV environment.

The issue is that in our QA environment the document are created correctly but the document flow is not updated at all!! Any idea of where should I be looking at to see difference between these environments?

I'm using BAPI BAPI_GOODSMVT_CREATE to Post the Goods Receipt.

Thanks.

6 REPLIES 6

Former Member
0 Kudos

sort delivery by vbeln posnr.

loop at delivery.

  • Populate BAPI variables ready for call

goodsmvt_header-pstng_date = sy-datlo.

goodsmvt_header-doc_date = sy-datlo.

goodsmvt_header-bill_of_lading = delivery-lifex.

goodsmvt_header-ref_doc_no = delivery-lifex.

goodsmvt_header-pr_uname = sy-uname.

goodsmvt_header-header_txt = 'Auto GR of I/Bound Del'.

goodsmvt_code-gm_code = con_move_code.

goodsmvt_item-material = delivery-matnr.

goodsmvt_item-plant = delivery-werks.

goodsmvt_item-stge_loc = delivery-lgort.

goodsmvt_item-move_type = con_move_type.

goodsmvt_item-vendor = delivery-lifnr.

goodsmvt_item-entry_qnt = delivery-lfimg.

goodsmvt_item-entry_uom = delivery-meins.

goodsmvt_item-mvt_ind = con_move_item.

goodsmvt_item-deliv_numb_to_search = delivery-vbeln.

goodsmvt_item-deliv_item_to_search = delivery-posnr.

append goodsmvt_item.

clear goodsmvt_item.

endloop.

*Call BAPI

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 = goodsmvt_item

  • GOODSMVT_SERIALNUMBER =

return = return.

  • Check BAPI RETURN table to ensure call was successful

loop at return where type = 'E'.

exit.

endloop.

if sy-subrc eq 0.

rollback work.

message e999 with 'GR BAPI Failed, process delivery manually'.

endif.

Former Member
0 Kudos

Have you called BAPI_TRANSACTION_COMMIT after ur goods mvt BAPI.

agnihotro_sinha2
Active Contributor
0 Kudos

hi,

have u called BAPI_TRANSACTION_COMMIT after it????

ags.

0 Kudos

Hi, yes I did call the BAPI_TRANSACTION_COMMIT. I can see the two documents created, it just the document flow what is missing.

My program is working perfectly well in Development, is jut QA what is wrong.

Any ideas?

Thanks

0 Kudos

It might b some customization problem, if its wrkg fine in development then it shd wrk for quality as well.

U can check whether when u do goods mvmt through standard SAP tcode document flow is being created or not. If it is then do a little debugging and u will knw what parameter might b missing.

0 Kudos

hi,

Since its workin fine in DEV, so it must be some missing data prob.

Try creating a goods movement using standard code in QA.

ags.