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: 

Change idoc status to 64

Former Member
0 Kudos

Hi everybody.

I have scheduled the report RBDAPP01 to process an inbound idocs. In some cases Id like that the idoc was reprocessed in the next execution of the job and d

Id like to know if it´s enough to change the idoc status to 64.

Thanks a lot

1 ACCEPTED SOLUTION

brad_bohn
Active Contributor
0 Kudos

It's not necessarily a 'strange requirement'. I can think of several scenarios where this might make sense. You don't need to set the status to '51' and you certainly don't need to use that function given. You can 'defer' processing and basically do nothing in the IDOC process code. Your IDOC should already be in a '64' status (unless it's '66' and you should not change that) so you can keep the status as-is. You can choose to add a message or not - personally, I would add a message to indicate that the IDOC was 'processed but deferred'. Now, if you're doing this as some sort of serialization technique, you may want to look into using that process instead if it makes sense for you.

6 REPLIES 6

0 Kudos

You can use this sample.


 DATA       L_IDOC_STATUS_TAB LIKE BDIDOCSTAT OCCURS 1 WITH HEADER LINE.
    L_IDOC_STATUS_TAB-DOCNUM = IDOCCONTROL-DOCNUM.
    L_IDOC_STATUS_TAB-STATUS = '64'.
    APPEND L_IDOC_STATUS_TAB.


    CALL FUNCTION 'IDOC_STATUS_WRITE_TO_DATABASE'
         EXPORTING
              IDOC_NUMBER               = IDOCCONTROL-DOCNUM
         IMPORTING
              IDOC_CONTROL              = IDOCCONTROL
         TABLES
              IDOC_STATUS               = L_IDOC_STATUS_TAB
         EXCEPTIONS
              IDOC_FOREIGN_LOCK         = 1
              IDOC_NOT_FOUND            = 2
              IDOC_STATUS_RECORDS_EMPTY = 3
              IDOC_STATUS_INVALID       = 4
              DB_ERROR                  = 5
              OTHERS                    = 6.

you can set

L_IDOC_STATUS_TAB-STATUS = '64'.

to your final status

Former Member
0 Kudos

Thats a strange requirement. The only reason i could think off where we would need to reprocess the idoc is if there was some failure. If that is the case i think it makes more sense to let the idoc go to 51 status and then schedule a sweep job with program RBDMANI2 to reprocess all the failed idocs.

0 Kudos

Hello,

Indeed a strange way of working.

Previous post makes a lot of sense, it is better to put the status in 51(error) and reprocess the IDOC via the specified report.

In case you want correctly posted IDOCs in status 53 be processed again, you can use following report to change the IDOC status back to 64.

RC1_IDOC_SET_STATUS

Wim

brad_bohn
Active Contributor
0 Kudos

It's not necessarily a 'strange requirement'. I can think of several scenarios where this might make sense. You don't need to set the status to '51' and you certainly don't need to use that function given. You can 'defer' processing and basically do nothing in the IDOC process code. Your IDOC should already be in a '64' status (unless it's '66' and you should not change that) so you can keep the status as-is. You can choose to add a message or not - personally, I would add a message to indicate that the IDOC was 'processed but deferred'. Now, if you're doing this as some sort of serialization technique, you may want to look into using that process instead if it makes sense for you.

Former Member
0 Kudos

Thanks Brad Bohn . I totally agree with you.

Do u think is better to set the idoc status with msgty = 'E' or 'W' or 'I' ?

Thank a lot.

You have 10 points!!!!

brad_bohn
Active Contributor
0 Kudos

'I' or 'S' should do the trick...