on 2017 Jun 23 8:56 AM
Hi gurus,
I have created an custom inbound FM for PO processing, copied from IDOC_INPUT_ORDERS for saving the IDoc details into custom table instead of processing it using any VA transaction, example:
The IDoc is process successfully, however, it stucked at status 64, I had checked we20 'Trigger Immediately', I have tried all notes mentioned in https://wiki.scn.sap.com/wiki/pages/viewpage.action?pageId=356423019, this is the current we42 configuration, I also tried putting 'INPUTFINISHED' at end event,
Could any master please enlighten me on whats the mistakes I have made? Thank you very much
I found the solution, I debug the program using RBDAPP01, since the program was copied form IDOC_INPUT_ORDERS, most of the code was left unmodified except main processing logic, I found that the CALL_TRANSACTION_DONE prevent the status from being updated, my suspect is that when the original main processing block (ex: create sales order) executed, the status is updated elsewhere.
Just clear the CALL_TRANSACTION_DONE and my custom status is updated to 53.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
If you perform BD20 (RBDAPP01), what is the status of your idocs?
If there is no change, you probably miss this kind of code in you FM :
loop at idoc_contrl.
[...]
if flag_error = 'X'.
rollback work.
clear flag_error.
else.
commit work.
idoc_status-docnum = idoc_contrl-docnum.
idoc_status-status = c_idoc_status_ok.
idoc_status-uname = sy-uname.
idoc_status-repid = sy-datum.
append idoc_status.
endif.
endloop.
With constants coming from include MBDCONWF
Best regards
Bertrand
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bertrand,
This is the result from BD20:
The code I added is as follow:
workflow_result = '0'.
idoc_status-docnum = idoc_contrl-docnum.
idoc_status-status = '53'.
idoc_status-uname = sy-uname.
idoc_status-msgty = 'I'.
idoc_status-msgid = 'V1'.
idoc_status-msgno = '311'.
idoc_status-msgv1 = 'Purchase order'.
idoc_status-msgv2 = xvbak-bstkd.
idoc_status-msgv3 = `from ` && xvbak-kunnr.
idoc_status-msgv4 = 'has been saved'.
CONCATENATE idoc_status-msgv1 idoc_status-msgv2
idoc_status-msgv3 idoc_status-msgv4 INTO
return_variables-wf_param.
return_variables-doc_number = idoc_contrl-docnum.
APPEND return_variables.
APPEND idoc_status.
Thank you.
Hello,
So, this code seems to not be executed when idocs are processed automatically. You should add LOG-POINT or ASSERT into your code to trace your parameters and which instruction is failing.
If you don't know how to, here is a link : https://blogs.sap.com/2014/08/28/break-point-id-assert-id-and-log-point-id-easy-to-use-and-very-hand...
Best regards,
Bertrand
Hello,
You mean that :
- you put a log-point at the very end of Z_IDOC_INPUT_ORDER to trace "idoc_status" table,
- run process,
- read trace
- trace show that this table contains an entry 53
- this entry disapeared from your idoc so its last status is still 64
If so, the problem is not in Z_IDOC_INPUT_ORDER but in a code after. may be a exit or an enhancement. You should have a look on SE84 for extension and enhancement implentations (names in Z* and Y*).
Hi Yang,
what has been copied from the standard function module exactly? In the ABAP code there are some statements in the bottom that are setting the IDOC status explicitly. If those are not performed, the status remains unchanged. If you don't find it - I can copy the relevant sections to you when I am at an SAP system again.
Regards Helmut
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Helmut,
The whole fm is copied with some modifications, after successful processing, I added the following code at bottom to set the status. If the IDoc is process by WE19, the status is successfully updated to 53 with custom status message. However, when it is process automatically coming from PI, the status is stuck at 64.
workflow_result = '0'.
idoc_status-docnum = idoc_contrl-docnum.
idoc_status-status = '53'.
idoc_status-uname = sy-uname.
idoc_status-msgty = 'I'.
idoc_status-msgid = 'V1'.
idoc_status-msgno = '311'.
idoc_status-msgv1 = 'Purchase order'.
idoc_status-msgv2 = xvbak-bstkd.
idoc_status-msgv3 = `from ` && xvbak-kunnr.
idoc_status-msgv4 = 'has been saved'.
CONCATENATE idoc_status-msgv1 idoc_status-msgv2
idoc_status-msgv3 idoc_status-msgv4 INTO
return_variables-wf_param.
return_variables-doc_number = idoc_contrl-docnum.
APPEND return_variables.
APPEND idoc_status.
Can you check BD51 if you have switched on "2":
I am assuming you are passing through the IDOC# in your function module to the batch input data to VA01 - and VA01 is trying to lock the IDOC - so the IDOC layer is not allowed to lock the IDOC again.
Also possible - what are the settings in WE20? Have you switched on "process immediately" ? In WE19 you can by-pass it by choosing "use function module".
I guess those are the two most-likely reasons why it have failed.
Helmut
User | Count |
---|---|
68 | |
8 | |
8 | |
6 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.