cancel
Showing results for 
Search instead for 
Did you mean: 

File Adapter - Sort Input file

Former Member
0 Kudos

Hi There,

I am trying to process the file I receive in XI for an external system ( Flat File) .

I need to sort the file and then add de-limiters.

Do I do this in the adapter or in during mapping.

Any help is appreciated.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi XI gurus

Is there a place holder in file adapter to run OS command "sort -k.." before the message is processed by the adapter pipeline? If yes then this may be the option that Steve is looking for. In ETL tool there are options to pre-process the input file via OS commands or perl program or java program before applying mapping transformations to the input file.

Former Member
0 Kudos

Hi ,

I do not know if I have stated my problem correctly.

I have to sort the file then split it into several files based on a de-limiter.

Example

rec1

rec1

rec10

rec1

rec2

I have to create a file for rec1 and then for re2 and then rec3.

I will map rec1 as the source file in XI to the traget file which will be posted to R3 back end.

Same with rec2 and rec10

Any help is greatly appreciated.

Former Member
0 Kudos

Hi Steve,

I am encountering an almost identical scenario to the one you have described. Have you been able to come up with a solution? We are truly perplexed here!

any help you can provide would be great.

thanks

-Jeff

Former Member
0 Kudos

I am sorry I was not clear.

I am trying to process the file I receive in XI from an external system ( Flat File) .

This file has many records. Several accounting documents are embedded in it. This file is not sorted. I need to first sort the file and then use de-limiters to seperate it into several documents.

Can I sort the incoming file first and based on the delimter kick off several XI-XML files

Former Member
0 Kudos

Hi,

<i>>>Can I sort the incoming file first and based on the delimter kick off several XI-XML files</i>

For the kick-off, yes you can by using a Multi-Mapping (occurence 1->N) plus a BPM with a block "Multi to single".

But for the sort, I have some doubts... It's easy with an ABAP mapping, but with a Message Mapping... I don't know!

Regards.

Mickael

moorthy
Active Contributor
0 Kudos

Hi,

<i>This file has many records. Several accounting documents are embedded in it.</i>

>>>SO you need to sort these records right ?

So it is a flat file.

1) first of all you need to pick the file. So as you told file is a flat file right ? What is the delimter for the incoming file ? Based on this , you need to convert this flat file into field details with file content conversion option available in the Sender File Adapter configuration

2) Now you need to sort the records. This you can do in the Mapping.

3) If you want to send mulitple files into your Target system, you can do this in the XI with mapping and Receiver determination.

To feel about flat file scenario in XI-

/people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1

/people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2

Regards,

Moorthy

moorthy
Active Contributor
0 Kudos

Hi,

If you want to sort the data in the file, then this can be done in the Mapping.

If you want to process the file based on the file name, date stamp etc from XI, then you can set these options in the Sender File Adpater configuration.

http://help.sap.com/saphelp_nw2004s/helpdata/en/e3/94007075cae04f930cc4c034e411e1/content.htm

REgards,

Moorthy