05-06-2009 9:38 AM
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.
05-06-2009 9:45 AM
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.
05-06-2009 9:51 AM
05-06-2009 9:53 AM
05-06-2009 10:04 AM
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
05-06-2009 10:13 AM
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.
05-06-2009 10:32 AM
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.