BAPI_GOODSMVT_CREATE not updating document flow
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.
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.
Similar Messages
-
Dear Experts,
I have completed sales cycle, after completeing the cycle in document flow delivery document is not yet processed, and i have created invoice also i.e why it is showing not yet processed in the document flow. is it copy control problem? pls let me know experts
Thanks
BasavarajHi,
Please below steps:
1. Check Copy controls from Sales order to Delivery and Delivery to Billing document ( VTLA & VTFL)
2. Check Incompletion Procedure
3. Check Incompletion Rule
4. Check Customer Master in customer master Goto Sales Area Data - Shipping Tab - Partial Delivery check which option is there
Regards,
MH -
Goods Reciept BAPI that updates Document Flow
Hello,
We are looking for a BAPI or FM that posts a goods reciept against a PO and updates document flow. Does anyone know if this exists?
We have been using BAPI_GOODSMVT_CREATE, which will post the GR against the PO but it does not update the Doc Flow. It is essential for Doc Flow to be updated because it posts the event in our SAP SCM EM instance.
Any help would be much appreciated... will award as many points possible.Hi,
Check the below code:
*********Work areas***********
DATA : wa_mseg type ty_mseg,
wa_mseg1 TYPE ty_gds,
wa_mkpf LIKE mkpf,
wa_lgort_sum TYPE ty_lgort_sum,
wa_loss_data LIKE zpesloss,
wa_zpesloss LIKE zpesloss.
DATA : v_header LIKE bapi2017_gm_head_01,
v_gm_code LIKE bapi2017_gm_code.
DATA: wa_headret LIKE bapi2017_gm_head_ret,
wa_matdoc TYPE bapi2017_gm_head_ret-mat_doc,
wa_matdocyr TYPE bapi2017_gm_head_ret-doc_year.
DATA: i_items TYPE STANDARD TABLE OF t_items,
i_return_goods TYPE STANDARD TABLE OF t_return with header line,
i_message TYPE TABLE OF bapiret2 WITH HEADER LINE.
wa_mseg1-bwart = '551'.
wa_mseg1-matnr = ws_matnr.
wa_mseg1-umlgo = i_mseg1-umlgo.
wa_mseg1-lgort = i_mseg1-lgort.
wa_mseg1-werks = 'SP01'.
Header Data
v_header-pstng_date = sy-datum.
v_header-doc_date = sy-datum.
Code Group
v_gm_code-gm_code = '03'.
******Mandatory fields passed into BAPI***
CLEAR i_items[].
wa_items-material = wa_mseg1-matnr.
wa_items-plant = wa_mseg1-werks.
wa_items-stge_loc = wa_mseg1-lgort.
wa_items-move_type = wa_mseg1-bwart.
wa_items-entry_qnt = wa_mseg1-lossquantity.
wa_items-costcenter = '0000012000'.
APPEND wa_items TO i_items.
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
goodsmvt_header = v_header
goodsmvt_code = v_gm_code
TESTRUN = ' '
IMPORTING
goodsmvt_headret = wa_headret
materialdocument = wa_matdoc
matdocumentyear = wa_matdocyr
TABLES
goodsmvt_item = i_items
GOODSMVT_SERIALNUMBER =
return = i_return_goods .
if i_return_goods[] is not initial.
message i001(zespur) with i_return_goods-message.
stop.
endif.
IF i_return_goods[] IS INITIAL .
lws_wait = 3.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = lws_wait.
WAIT UP TO 1 SECONDS.
endif.
Regards,
Prakash. -
Update Document Flow - delivery -- bill
Hi Experts,
I want to "deactivate" update document flow between delivery and bill for an item category (say e.g. ZTAN). Where can I do that?
In other words in table VBFA when I put "Follow on" document as my invoice #, I do not want to see my delivery # as preceeding document.
I have checked VTFL, at item category level, there is NO field as "Update document flow"
also I have checked VTFA, at item category level, there is NO field as "Update document flow"
(in VTAA and VTLA, at item category level, there is field as "Update document flow" - but this is not my query)
Please help
TypewriterHi,
I donot understand your post. What shall I accomplish with your suggestion? For my better understanding, please elaborate.
In VTFL, at item category level, Copy requirement is to check if all the criteria are met, if yes, then copying information is done from Delivery to Invoice. I think, this has nothing to do with populating information in document flow.
Could you please advice, where exactly is the configuration for "Update doc flow" in VTFL and VTFA? -
Hi,
I've created an inbound delivery from an outbound delivery. Now I need to update the document flow, and I've used the code below to do so. My problem is when viewing the document flow for the inbound delivery via VL33N - no document flow is shown. When I view the doc flow for the outbound delivery(VL03N), the inbound delivery shows up there.
Why doesn't doc flow show when viewing the inbound delivery?
Do I need to update document flow another way?
LOOP AT t_ib_lips INTO s_ib_lips.
CLEAR s_ob_lips.
READ TABLE t_ob_lips INTO s_ob_lips WITH KEY
vgbel = s_ib_lips-vgbel
vgpos = s_ib_lips-vgpos.
* test area for document flow
CLEAR: s_vbfa.
s_vbfa-mandt = s_ib_lips-mandt.
s_vbfa-vbelv = s_ob_lips-vbeln. "OB delivery number
s_vbfa-posnv = s_ob_lips-posnr. "OB delivery item
s_vbfa-vbtyp_v = is_ob_likp-vbtyp. "OB delivery type
s_vbfa-vbeln = s_ib_lips-vbeln. "IB delivery number
s_vbfa-posnn = s_ib_lips-posnr. "IB delivery item
s_vbfa-vbtyp_n = s_ib_likp-vbtyp. "IB delivery type
s_vbfa-rfmng = s_ob_lips-lgmng. "Referenced quantity
s_vbfa-meins = s_ob_lips-meins. "uom
s_vbfa-VRKME = s_ob_lips-vrkme.
s_vbfa-matnr = ' X'.
* s_vbfa-stufe = '00'.
CALL FUNCTION 'RV_XVBFA_MAINTAIN'
EXPORTING
f_vorgang = 'H'
fvbfa = s_vbfa
fvbfad = s_vbfad
TABLES
fxvbfa = t_xvbfa
fyvbfa = t_yvbfa
fxvbapf = t_xvbapf.
ENDLOOP.
CALL FUNCTION 'RV_DOCUMENT_FLOW_UPDATE_U'
EXPORTING
f_vbeln = is_ob_likp-vbeln
i_status = 'H'
TABLES
fxvbfa = t_xvbfa
fyvbfa = t_yvbfa.
Below is some of the data from the entry of VBFA that is created
VBELV POSNV VBELN POSNN VBTYP_N VBTYP_V STUFE
100005128 1 180006319 1 7 J 00Is there a BAPI you can use instead? Neither of these FMs are released or documented. It's quite a task trying to figure out how SAP uses these FMs to update.
Rob -
QM02 - notifications - update document flow for new action box item
I have added a new action box item on qm02 (notifications). I am created a PO and a delivery. I wish to update the document flow to include these new records.
I am trying to work with function qmlr_create_document_flow without success.
Does anyone know how to do this?
Thanks,
rvHi Rags,
Thanks for your reply.
About your reply:
1) Yes, I was also thinking that 2 preceding docs may not be possible in a doc flow, and had also indicated the same to my customer. However, wanted to be 100% sure that it cannot be done.
2) I cannot go ahead with a Service/Release Order. The requirement is to create a Return Order or a Credit Memo Request (CR) directly from the Service Notification and any other order is not in scope.
I was thinking of something as below:
The Service Notification header is linked to Return Order header only, there are no links at the item level. Is it a feasible solution to have a doc flow between invoice items & return order items, since return order items are not yet linked?....I am just thinking of different things to find a solution!
Thanks again.
Cheers
Vicky -
Service ordernumber not in document flow
Hi all,
Can someone tell me how I can find the link between my invoice and the service order. When I look in the document flow I do not find the service order number. When I look in the details from invoice items I can find the service order number. which tables or FM do I need to get the service order?
Richardsolved!
Items are stored in table vbrk. Relation between invoice and service order is fields vbeln and aufnr
Richard -
Archived Deliver not showing Document FLow _RV_LIKP
Folks
I have started archiving for delivery object. I am able to successfully archive one document and can view the document in SARI and the only issue i am having is the when i open the archive document the ICON which shows "DOCUMENT FLOW" is not click able so user is not able to see the document flow to find the Sales Order/STO# it was created from.
In my customization for RV_LIKP under the setting " Archiving Control for Delivery" i have put residence time as "5" and RNO "0"
Also what is the RNO field stands for .
ThanksHi Andy,
Go through the link given below.
http://help.sap.com/saphelp_40b/helpdata/pt/b7/19752690e211d1a5510000e82deaaa/content.htm
The last line looks important.
Deliveries should be archived before sales documents and billing documents. This sequence is a result of the way the documents are linked via document flow.
Hope it helps,
Regards,
MT -
Pages is not updating documents in the cloud when edited on Mac
I edited a pages document – which was created on my iPhone – on my Mac, but it did not update. It seemed to be stuck on 6.8MB out of 12.6MB. So I deleted it, and reloaded it from my desktop, and now it is stuck on "Waiting" with a little cloud symbol beside it.
The document has appeared on my iPhone again, but it won't download (because it hasn't been uploaded), and it can't be viewed.
Does anybody know how to fix this problem?Never mind. Although it too well over an hour, it did eventually upload.
Sorry for any inconvenience. -
BAPI_GOODSMVT_CREATE not updating VBUK table and field WBSTA
Hi all,
We post good receipt for the inbound delivery using BAPI_GOODSMVT_CREATE. Upon the successful completion of GR, however, field WBSTK & GBSTK in VBUK table and field WBSTA & GBSTA in VBUP table are not getting updated from A to C for the inbound delivery.
Wondering anybody here has experienced the similar issue before? And so, how to get it fixed without having to switch to a BDC program?
Thanks,
FrancIt seems this BAPI dose not update the VBUK fields.
Edited by: Franc on Aug 11, 2008 3:12 PM -
Hi All,
We have found a discrepancy in the goods receipt process . When i do a manual process using MIGO i see the following in the doc flow.
Doc. Date Overall ProcessingStat.
. Purchase order 56005883 08/30/06
STO Delivery 87068558 08/30/06 Completed
. WMS transfer order 6002450608 08/31/06 Completed
. TF to stck in trans. 49806781 09/03/06 complete
. Service Confirmation 09/03/06 Completed
. Goods receipt 5000074657 09/12/06 Completed
But when i do the goods receipt using the BAPI 'BAPI_GOODSMVT_CREATE'the doc flow does not get updated.
. Purchase order 56007669
STO Delivery 87115631 09/26/06 Completed
. WMS transfer order 6002478832 09/26/06 Completed
. TF to stck in trans. 49853247 09/26/06 complete
But still i can see that the delivery has benn goods recieved. Has anyone come across a simiar isssue before? Please help.
Regards,
Hari.
For a standard STO that has been received with MIGO this is the doc flow -- notice the goods receipt at the end.Here is a sample code where it works:
***********HEADER
w_goodsmvt_header-pstng_date = sy-datum.
w_goodsmvt_header-ref_doc_no = i_likp-vbeln.
***********Goods Movement Code
w_goodsmvt_code-gm_code = '01'.
***********Goods Movement Item
loop at i_lips.
i_goodsmvt_item-material = i_lips-matnr.
i_goodsmvt_item-move_type = '101'.
i_goodsmvt_item-deliv_numb = i_lips-vbeln.
i_goodsmvt_item-deliv_item = i_lips-posnr.
i_goodsmvt_item-plant = w_destplant.
i_goodsmvt_item-stge_loc = i_lips-lgort.
i_goodsmvt_item-entry_qnt = i_lips-lfimg.
i_goodsmvt_item-entry_uom = i_lips-meins.
i_goodsmvt_item-po_number = i_lips-vgbel.
i_goodsmvt_item-po_item = i_lips-vgpos.
i_goodsmvt_item-mvt_ind = 'B'.
append i_goodsmvt_item. clear i_goodsmvt_item.
endloop.
***********Test run
clear w_testrun.
*BAPI call
call function 'BAPI_GOODSMVT_CREATE'
exporting
goodsmvt_header = w_goodsmvt_header
goodsmvt_code = w_goodsmvt_code
testrun = w_testrun
importing
goodsmvt_headret = w_goodsmvt_headret
materialdocument = w_materialdocument
matdocumentyear = w_matdocumentyear
tables
goodsmvt_item = i_goodsmvt_item
goodsmvt_serialnumber = i_goodsmvt_serialnumber
return = i_return.
loop at i_return where type = 'A'
or type = 'E'.
move: i_return-id to mess_tab-msgid,
i_return-number to mess_tab-msgnr,
i_return-message_v1 to mess_tab-msgv1,
i_return-message_v2 to mess_tab-msgv2,
i_return-message_v3 to mess_tab-msgv3,
i_return-message_v4 to mess_tab-msgv4.
append mess_tab. clear mess_tab.
endloop.
if sy-subrc eq 0.
i_trans-status = 'E'.
call function 'BAPI_TRANSACTION_ROLLBACK'.
else.
call function 'BAPI_TRANSACTION_COMMIT'
exporting
wait = 'X'
importing
return = w_return.
endif. -
Problem with BAPI_GOODSMVT_CREATE not updating Reservation
Hi,
When i do a manual MB1A 'Goods issue' with reference to Work Order it is posting the goods issue and updating the RESB ,but when i do the same through the bapi code 03 Table i was not able to post the goods issue at all. am i missing a input field in the bapi .Plz help me out.
My code.
gf_goodsmvt_code-gm_code = '03'. "GI
gf_goodsmvt_header-pstng_date = sy-datum.
gf_goodsmvt_header-doc_date = sy-datum.
LOOP AT it_details INTO gf_details .
MOVE :gf_details-matnr TO gf_goods-material,
gf_details-werks TO gf_goods-plant,
rm07m-lgort TO gf_goods-stge_loc,
gf_details-charg TO gf_goods-batch,
rm07m-bwart TO gf_goods-move_type.
MOVE gf_details-issue_qty TO gf_goods-entry_qnt .
MOVE gf_details-meins TO gf_goods-entry_uom.
gf_goods-mvt_ind = 'F'.
gf_goods-reserv_no = gf_details-rsnum.
gf_goods-res_item = gf_details-posnr.
gf_goods-res_type = gf_details-rsart.
gf_goods-withdrawn = 'X'.
gf_goods-orderid = rm07m-aufnr.
gf_goods-order_itno = 1.
APPEND gf_goods TO it_goodsmvt_item.
CLEAR gf_goods.
ENDLOOP.
IF NOT it_goodsmvt_item[] IS INITIAL.
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
goodsmvt_header = gf_goodsmvt_header
goodsmvt_code = gf_goodsmvt_code
TESTRUN = ' '
IMPORTING
GOODSMVT_HEADRET =
materialdocument = g_mat_doc
MATDOCUMENTYEAR =
TABLES
goodsmvt_item = it_goodsmvt_item
GOODSMVT_SERIALNUMBER = 'X'
return = it_return.check below Threads :
Issue related to EXIT statement
and see the sample program :
Structures for BAPI
data: gdsmt_header like bapi2017_gm_head_01.
data: gdsmt_code like bapi2017_gm_code.
data: gdsmt_headret like bapi2017_gm_head_ret.
data: gdsmt_item like bapi2017_gm_item_create occurs 1 with header line.
data: return like bapiret2 occurs 0.
data: retmatdoc like bapi2017_gm_head_ret-mat_doc.
Setup BAPI header data.
gdsmt_header-pstng_date = sy-datum.
gdsmt_header-doc_date = sy-datum.
gdsmt_code-gm_code = '06'. " MB11
Write 262 movement to table.
clear gdsmt_item.
move '262' to gdsmt_item-move_type.
move i_resb-matnr to gdsmt_item-material.
move p_bdmng to gdsmt_item-entry_qnt.
move i_resb-meins to gdsmt_item-entry_uom.
move i_resb-werks to gdsmt_item-plant.
move i_resb-lgort to gdsmt_item-stge_loc.
move i_afko-aufnr to gdsmt_item-orderid.
append gdsmt_item.
Determine cost center
move '0000041430' to gdsmt_item-costcenter.
append gdsmt_item.
Call goods movement BAPI
call function 'BAPI_GOODSMVT_CREATE'
exporting
goodsmvt_header = gdsmt_header
goodsmvt_code = gdsmt_code
importing
goodsmvt_headret = gdsmt_headret
materialdocument = retmatdoc
tables
goodsmvt_item = gdsmt_item
return = return.
Reward Points if it is helpful
Thanks
Seshu -
Document flow not getting updated
Dear Experts,
I am facing a problem in document flow.
I create order (for free goods order type ZFRE), do delivery and finally billing.Outbound delivery is showing as "Being Processed".While I have maintained "Update document flow" in item level in copy control.
For your information, this is free goods order type and the system has been configured in such a way that accounting docs are not generated after billing. (As it is for free goods.).Could this be because accounting docs are not being generated?
Kindly advise.
Regards,
RandhirHi
Pls see the copy control sales document to sales document T.Code VTAA
Go to the item category and see the document flow field is activated or not if is not activated pls activate and re run the scenario
pls check your correct defined Z item category the document flow is activated or not.
Thanks.
Vasu
Edited by: Vasu Enaguthi on Apr 8, 2010 12:09 PM -
SO document flow not updated with PR no created
Hi All,
A Purchase Requisitions is created from SO for a line item, i can see the PR generated in report ME5A but not in document flow. Is it a standard behavior or i'm missing something ??
Regards
AbhilashPurchase requisitions are not updated in the document flow, just use SE16 and look at document flow table VBFA. it has 2 fields for document category VBTYP_V and VBTYP_N . If you use F4 on this field then you can see that the PR is not among the possible documents.
Use the status overview button instead and you can see the PR -
Contract not visible in sales order document flow
Hi
I am supposed to create sales order from Contract.The requirement is that only header data should be copied.Thus In Copy Control configuration I did not maintain item level and schedule line level settings for these document types. The issue is that after running the whole cycle from Contract -->SO --> Delivery --> Invoice when I see the Sales Order document flow I can see all other documents but not the contract.Also In Contract document flow I can see only sales order but not delivery and invoice.Please guide.Hello,
Update Document Flow option is available only at Item Level in copy control setting from Contract to Sales Order.
Check out your Copy Control Records at Item Level. There would be "2" mentioned in "pdate document flow" box.
2 means Create doc. flow records except for dely/goods issue/billdoc. Here you to maintain "X" for Complete Document flow.
Hope this helps,
Thanks,
Jignesh Mehta
Maybe you are looking for
-
Jittery motion when editing to tape via Blackmagic SD
I have a situation that has me a bit perplexed, and I'm hoping one of you gurus can help. We will shoot DVCAM footage, capture into FCP (now at v5.03, but this occurred with earlier versions as well), and then export a quicktime movie (not using Quic
-
Reading in a space filled file
I am reading in a file which is in byte format and each record is 50 chars wide and space-filled. If an element is not present in the file, then it is just space filled. Example input.prn file: Bob ����� Smith�����12 North Rd�����Denver�����CO�����US
-
"current user is not an administrator." This is incorrect. How do I make the change?
-
WRT300N - Default Gateway issue
I'm using a wireless internet connection for my laptop and when I tried to connect to the internet earlier I got an error telling me that my default gateway was offline. I unplugged everything for 5 minutes and it still didn't work so I typed the def
-
Hi peoples.. I am working in VC with a HTML view. I need to resize the HTML view, but there are no way to do this. I try to put it im a View Switch or panel, and resize them. The view switch and panel are resize, but the iframe that HTML view is, con