how to Split Single Idoc into 2 files and put some delay
I have a IDoc to file Scenario. Invoice Idoc to Flat file scenario
this is a reuse Interface
Current Scenario we have graphical mapping(used for lookup and dynamic filename, mostly all the field mappings are 1-1) and ABAP Mapping to convert Idoc to flat file, 1 Idoc will generate 1 file.
In addition to the above case, there is 1 more requirement
Correction Invoice case. where in I get single Idoc with Multiple Item categories (Original data and Correction data)
In this case always I need to send two files(2 Idoc data), first Idoc is for Original Idoc and 2nd is Corrected Invoice, these 2 idocs should be sent with some delay.
In Correction Invoice case, I should generate 2 idocs based on Item category (PSTVY) value.
Suppose I have 4 E1EDP01 segments out of which PSTVY has value "AA" and "BB" repeated twice as shown below
So I need to generate 2 Idoc 1 for AA and other for BB.
If there is no correction Invoice, 1 idoc for 1 file will be generated.
Am planning to use BPM to delay the idocs and identigy bpm based on Document type else no bpm...
How do I split the mapping of single Idoc to 2 files based on Item category.