02-25-2011 10:17 PM
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
02-25-2011 10:36 PM
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
02-26-2011 11:42 PM
It is not failing any authorization. I checked sm58..If it was failing, it would not go to 03 when I run RSEOUT00.
02-28-2011 5:43 AM
Use following statements after calling FM- MASTER_IDOC_DISTRIBUTE.
commit work.
call function 'DEQUEUE_ALL'.
02-28-2011 3:15 PM
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.
02-28-2011 3:25 PM
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.
02-28-2011 3:58 PM
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
02-28-2011 4:38 PM
@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
02-28-2011 5:06 PM
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 ?
03-01-2011 4:26 AM
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.
03-01-2011 4:46 AM
HI,
It seems to be commit work problem so use "Wait upto 1 second" it might work..
Thanks and regards,
Sree.