cancel
Showing results for 
Search instead for 
Did you mean: 

sender File adapter - Message per recordset

Former Member
0 Kudos

Hi All,

I have a scenario in where I have to split a large file (txt) into smaller files and then process them in PI.

Normally I use FCC and message per recordset... It splits all messages and everything is ok.

BUT, now I have to split the messages at specific key points. I cannot split it by a static number. It may vary. It is totally dynamic.

So I want to use the adapter module to write my own code to split the message when I need to. but how?

When using the FCC the messages get split before they even arrive at my adapter module. So is it possible to split them manually using adapter module???

Thanks.

Accepted Solutions (0)

Answers (2)

Answers (2)

RaghuVamseedhar
Active Contributor
0 Kudos

Hi Chris,

These are my thoughts on this issue. 40 MB (larger file) need to be split into small files (according to your requirement, at dynamic key points).

You can split large file using OS script, but it cannot be monitored using SAP PI infrastructure. I think you are considering writing an adapter module. So, I assume your PI system can handle that large file (40 MB) in memory. My opinion is, do not go with adapter module, as it is difficult to code, maintain and memory intensive. Try to create another new scenario, which picks up this large file, splits it into small pieces and place these small files in folder, from where current scenario picks up files. In new scenario, use Java Mapping (as input in not XML, we cannot use Graphical, XSLT) to split the payload at dynamic key points using OutputAttachments http://help.sap.com/javadocs/pi/SP3/xpi/com/sap/aii/mapping/api/OutputAttachments.html .

Hi All,

I have seen messages with multiple attachments which were processed in SAP PI (I have seen multiple attachments in SXI_MONITOR). I have not tried using OutputAttachments http://help.sap.com/javadocs/pi/SP3/xpi/index.html . Please let me know, whether we can generate multiple files from multiple attachments and place them in target directory using receiver file channel?

Regards,

Raghu_Vamsee

stefan_grube
Active Contributor
0 Kudos

> When using the FCC the messages get split before they even arrive at my adapter module. So is it possible to split them manually using adapter module???

No, it is not possible to split the message in an adapter module.

Inside the adapter module you will have the whole file in memory, so if your file is too big, it might crash.

Former Member
0 Kudos

So, the only solution is to write our own adapter?

stefan_grube
Active Contributor
0 Kudos

I would rather discuss the interface.

Maybe the sender can split the files?

Former Member
0 Kudos

Hi Stefan,

Actually or file is not very big. It is max 40 MB. But when we try to process it as one file then after mapping when it starts to create IDocs it stops (the WP just disappears). It must create around 1 million IDocs.

So, is there any other way?

stefan_grube
Active Contributor
0 Kudos

It must create around 1 million IDocs.

With 40 bytes of data each? OMG!

try to find a way to create packages. Which IDoc is it? Maybe there is a BAPI also, then you can create an ABAP proxy which handles 1000 records and calls the BAPI inside.

40 MB pliain text will increase up to 6 times XML message size, you can reduce message size on creating short tag names.

Maybe the file can be processed anyway.

If you share more information about your scenario, we could discuss several possible solutions.