Skip to Content
0

IDoc status stucked at status 64

Jun 23, 2017 at 07:56 AM

142

avatar image
Former Member

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

capture.png (20.7 kB)
capture.png (5.2 kB)
abap | idoc | sd | edi | ale | trfc
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
avatar image
Former Member Aug 18, 2017 at 08:52 AM
0

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.

Share
10 |10000 characters needed characters left characters exceeded
Helmut Skolaut Jun 27, 2017 at 03:21 PM
0

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

Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

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.
0

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

untitled.png (7.5 kB)
0
Bertrand DELVALLEE Jun 27, 2017 at 03:40 PM
0

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

Show 6 Share
10 |10000 characters needed characters left characters exceeded
Former Member

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.

capture.png (7.8 kB)
0

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-handy/

Best regards,

Bertrand

0
Former Member

Yes, I will try your suggestion, thank you, I have search for this for some time also.

0
Former Member

Hi Bertrand,

I had use LOG-POINT and verified that the code is successfully executed. However, the status remained stuck at 64. Thank you.

0

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*).

0
Former Member

Hi Bertrand,

Yes, trace show entry 53. I also checked there are no enhancement or exit being implemented. If I use WE19, the status is updated to 53. Does this problem related Workflow?

0