‎2009 Apr 20 1:09 PM
Hi all,
I m facing the following situation
The inbound Idoc has just 1 segment and the segment has just two fields - Old material number and wholesale price( this field will be captured through Z-STRUCTURE in MARA table). My inbound IDoc will have multiple records( say 100 materails) . If the old material number in found in MARA table then update the wholesale price (say 90 records processed in first go). If not found then mark the segment as error segment ( The remaining 10 segments). Next time when the idoc will be reprocessed then then only those segment should be processed which were marked as error segment ( The 10 segments). If found this time then update ( say 2 out of 10) and update the idoc status so that now 8 IDoc segments will be marked as error segment). An the process continues till all the records are process.
Infact this interface will be scheduled to run weekly. But if the any error segment is there, It needs to be reprocessed daily until all material are posted successfully.
Please help me at the following points
1. How to Reprocess the error segments only , if the IDoc is being reprocessed, otherwise process the whole IDoc( The first time)
2. How do I programatically schedule the error idoc to be reprocessed daily until successful
Thanks in Advance.
‎2009 Apr 20 1:15 PM
Hi Gaurav,
I think it is not possible to partially process an IDOC(Like processing only particular segments).
Instead, you should think of changing your design to create as many IDOCs as the number of records.
Then each of this idoc can be a sucess or a failure. YOu can reprocess only the failed IDOCs using the status field of the IDOCS using standard IDOC reprocessing programs .
Regards,
Ravi
‎2009 Apr 20 1:32 PM
Hi Ravi,
I also suggested the same approach. But I have been asked to follow the approach i mentioned in the first post. I was asked to follow it in the following way
1. Sort all IDOC by ascending order
2. Loop EDIDC then Loop EDIDD data
If error in data or BAPI returns error -> populate error messages with segment number :
IDOC_STATUS-segnum = IDOC_DATA-segnum.( This is useful to identify which segment having error and also mark the segment with red color)
IDOC_STATUS-segfld = IDOC_DATA-field.
3.Reprocessing methods .
check IDOC is reprocessing or not -> if reprocessing check Segments status from table EDIDS based on IDOC Number, Segment Name and segment number.
I am not sure how to check in a program whether the IDoc is reprocessing. ( See step 3)
Also , Kindly let me know how do schedulling programatically?
Thanks,
KG
‎2009 Apr 20 6:43 PM
I agree with Ravi, from the design point of view it is the neat and clean approach.
The thing if the moment an error message is raised in the code, the processing will stop and the IDoc will fail in status 51 and the reamaining segments, the ones after the failed segment, will not be processed at all.
So I'm not sure if your approach will work as expected. Unless you are collecting all the error messages ane updating the status at once.
But to answer your question, "How to check if the IDoc is re-processing or not"
The answer is to check in table EDIDS for the idoc number and see if there is a status 51 for it, if found, the IDoc is definitely being re-processed else it is a new IDoc.
Hope this helps.
regards,
Advait
‎2009 Apr 20 5:14 PM
Hi Gaurav,
By looking your Question..
write the report with following steps..
select DOCNUM* from EDIDC where DIRECT = 1 "Inbound direction
and STATUS Ne 53 "not sucess
and IDOCTP = " Basic idoc type
and UPDDAT >= "From last one week to todays date..
from above read all the indounb idocs and reprocess the idocs using program
by checking the idoc status code process the below program...
Program RBDAPP01 for status 64
Program RBDAGAIE for status 32 and 69 (Edited IDocs)
regards,
Prabhudas