cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with JAVA Map to split flat file

Former Member
0 Kudos

Dear experts,

I am facing an issue while implementing java mapping to split flat file.

scenario:

3rd party is sending IDoc flat file(may containing multiple IDocs) to PI and PI is implementing IDocFlatToXML module to convert it to XML for further processing, since the module can only convert flat file containing only one IDoc. so we have to split the flat file as per the number of IDocs contained.

I am implementing Java mapping for split function, and the java mapping has been tested locally successfully(IDE:eclipse), the split function is working fine and multiple flat IDoc files generated as expected.

However, when I imported the java map in PI, I can only see one(the last IDoc in the original flat file) file generated, the first IDocs files are generated as well but they are empty files... if anyone has any suggestion thanks a lot..

Accepted Solutions (1)

Accepted Solutions (1)

former_member181985
Active Contributor
0 Kudos

Hi Hailong,

I hope you have used multi-mapping concept in your java mapping code. Better share your java code with a sample input flat file.

Regards,

Praveen Gujjeti

Former Member
0 Kudos

Thanks Praveen,

I have coded the wring steps in java mapping - some specific condition is met then the previous read lines would be written to a new file..

I tested the java map again today, and found it was working fine now...

But there seems to be a small issue still, when I was refreshing the folder(al11) where the splited file would be written, the first 2 files were empty(with 0 bytes as length), and after 1 second refreshing again, they became filled... so I set "Msecs to Wait before modificationc check" to 6s with the sender channel which will pick these files, it is working properly as far as now.

former_member240483
Contributor
0 Kudos

Hi Hailong,

we are having same requirement and i would like to know how you did split using Java map .

Thanks,

PT

Former Member
0 Kudos

Hi PT,

Each flat IDoc should be started with control record like "EDI_DC40", which can be used as indicator of a new IDoc.

In our case, 2 rounds processing is implemented:

     round 1: pick original file and split into single flat IDocs and write them to the same folder with different suffix.

     round 2: pick single flat IDoc for conversion and further processing.

One more thing you need to check before pushing flat IDoc to IDocFlatToXML module is whether the line number and hierarchical information of each segment is provided in the flat IDoc (approximately stored in character 50-65 each line of flat IDoc).


Regards,

Hailong

former_member240483
Contributor
0 Kudos

Hi Hailong,

Thanks for your reply, i will do the same stuff, if possible can you pass me how you did this with Java map.

Thanks,

PT

Answers (0)