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: 

Idoc stuck in status '30' with MASTER_IDOC_DISTRIBUTE

former_member125661
Contributor
0 Kudos

I used FM MASTER_IDOC_DISTRIBUTE to create outbound idocs to a partner (whose partner profile is defined to 'Transfer idoc Immediately' ). But the the idoc is stuck at status 30. I had to manually run RSEOUT00 or BD87 to push it to Status 03.

I don't want to use these external programs as getting to status 03 within my program is important for me.

Somebody suggested to use COMMIT WORK and FM - 'EDI_DOCUMENT_DEQUEUE_LATER'

But even then it is still creating idocs in status 03.

CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'
    EXPORTING
      MASTER_IDOC_CONTROL            = T_EDIDC
    TABLES
      COMMUNICATION_IDOC_CONTROL     = T_RETURN_IDOC
      MASTER_IDOC_DATA               = T_EDIDD
    EXCEPTIONS
      ERROR_IN_IDOC_CONTROL          = 01
      ERROR_WRITING_IDOC_STATUS      = 02
      ERROR_IN_IDOC_DATA             = 03
      SENDING_LOGICAL_SYSTEM_UNKNOWN = 04.

COMMIT WORK.

CALL FUNCTION 'EDI_DOCUMENT_DEQUEUE_LATER'
  EXPORTING
    DOCNUM                       = T_RETURN_IDOC-DOCNUM
*   SYNCHRON                     = ' '
 EXCEPTIONS
   IDOC_IS_NOT_TO_DEQUEUE       = 1
   OTHERS                       = 2 .

Edited by: Shareen Hegde on Feb 25, 2011 11:19 PM

10 REPLIES 10

Former Member
0 Kudos

Hi,

I think the idocs were stuck in tRFC .. Please check in SM58 transaction and see whether its failing for authorization and it took your id by detault.

Regards

Syed

0 Kudos

It is not failing any authorization. I checked sm58..If it was failing, it would not go to 03 when I run RSEOUT00.

Use following statements after calling FM- MASTER_IDOC_DISTRIBUTE.

commit work.
call function 'DEQUEUE_ALL'.

0 Kudos

There is not authorization issue..I checked Sm58.. I am able to push it to 03 when I run RSEOUT00.

I used

CALL FUNCTION 'DEQUEUE_ALL'.

COMMIT WORK and

CALL FUNCTION 'EDI_DOCUMENT_DEQUEUE_LATER' ..None of them would create idocs in 03.

0 Kudos

According to OSS, you need 3 calls - explicit commit work, the plain DEQUEUE_ALL call, then a call to DB_COMMIT. I've always used that sequence and never had an issue. I don't know why you'd use the DEQUEUE_LATER... function.

0 Kudos

Hi Shareen,

You can directly call RSEOUT00 program in background mode after MASTER_IDOC_DISTRIBUTE FM. I remember I did the same thing in one of my program but that program was a background job and so it did not create much performance issue.

I did the following:

1) Generated IDocs using program RSNASTED - subroutine EDI_PROCESSING. (In your case FM MASTER_IDOC_DISTRIBUTE)

2) Check the return value. If IDoc generated successfully then call RSEOUT00 in background mode as below:

Call FM 'JOB_OPEN' to open a job

Submit program RSEOUT00 with proper parameters.

Close the job by calling FM 'JOB_CLOSE.

This way it will change the status from 30 to 03 and post the IDocs. This is a bit too long but still you can give it a try.

You can also check the following link. In this thread (second last reply) I have shown how to call the report in background job (job open and close):

Regards,

Saba

Edited by: Saba Sayed on Feb 28, 2011 5:02 PM

0 Kudos

@Brad.. i tried those 3 combinations..At the end of the 3rd call, I check EDIDC table and status field, it is still 30.

But I notice an interesting thing now..

When I use commit work after I call FUNCTION 'EDI_DOCUMENT_DEQUEUE_LATER' in debug mode and then when I check EDIDC-STATUS, I see status 03..But when I run the program without going to debug mode, it still picks 30 from EDIDC-STATUS.

Edited by: Shareen Hegde on Feb 28, 2011 5:52 PM

0 Kudos

Now this sequence works for me.

Call master_idoc_distribute

call EDI_DOCUMENT_DEQUEUE_LATER'.

commit work.

wait up to 1 seconds.

Now when I query edidc table, i see status 03. Now, can I not avoid waiting for 1 second ?

0 Kudos

you can try this sequence. itworks for me.

Call master_idoc_distribute

COMMIT WORK .

CALL FUNCTION 'DEQUEUE_ALL'.

SUBMIT rseout00 with document num and return.

former_member125931
Active Participant
0 Kudos

HI,

It seems to be commit work problem so use "Wait upto 1 second" it might work..

Thanks and regards,

Sree.