cancel
Showing results for 
Search instead for 
Did you mean: 

Merging two files to one file without BPM

former_member192181
Participant
0 Kudos

Hi EveryBody,

I have a requirement as below.

I will receive two files one is header and detail. I need to merge the two files into one file.

Please help me out in designing the scenario.

Thanks,

Lalitha

Accepted Solutions (1)

Accepted Solutions (1)

former_member192181
Participant
0 Kudos

Thnak you All for the responses.

We have solved it by running the .bat file at Customer end.

The Customer who will be sending Two files will get merged at his end and come to the target location now..

So the problem is solved.

anupam_ghosh2
Active Contributor
0 Kudos

Hi Lalitha,

               Thank you for posting the solution to the problem.

Regards

Anupam

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi Lalitha,

Check Michael reply from the below blog, this should solve your merging issue.

http://scn.sap.com/thread/1634635

Regards,

Pranav

Harish
Active Contributor
0 Kudos

Hi Lalitha,

It can be possible by script (perl etc) at FTP level.

Regards,

Harish

Former Member
0 Kudos

Hi Lalitha,

1. Files can be merged by running an OS command from file sender channel but disadvantage is both the files should be available at the time of execution of command.

2. Using an adapter module

Using BPM we have better file handling, alerting in case errors.

Regards,

Pranav

sahana_ps
Participant
0 Kudos

Hi Lalitha,

Have a look at

http://scn.sap.com/thread/3420861

Thanks,

sahana

gagandeep_batra
Active Contributor
0 Kudos

Hi lalitha,

I have another approch

if you can schedule your header file  scenario before item file scenario means & and your header file name & item file name have some uniqueness

You can to create to two scenario

first :

which pick all header files:

for ex.

header111.csv

header222.csv

header333.csv

and place the file in receiver folder

with dynamic configuration you can name the file like below"

order111.csv

order222.csv

order333.csv

Now in the second scenario

which pick the items files like:

item111.csv

item222.csv

item333.csv

you can use append mode to write below the same file

for name of the file again you can go for dynamic config and set the file name as below again:

order111.csv

order222.csv

order333.csv

& change the file construction mode to append so it will append below the header file

for schedule the CC you can use ATP.

hope this help:

Regards

gAgan

anupam_ghosh2
Active Contributor
0 Kudos

Hi Lalitha,

                     This is not possible without BPM.

The reasons are

1. How will you control which file will be read first, in case files are put into source directory at different times?

2. How will you make the scenario wait while second file is being read by the sender comm channel?

   

Regards

Anupam

former_member192181
Participant
0 Kudos

thanks for the response.Will it is possible by running a .bat file with merging logic in File Adapter.

Thanks,

Lalitha

anupam_ghosh2
Active Contributor
0 Kudos

Hi Laitha,

                   You can run a .bat file which will do the following things

1. wait until there are two files in the directory

2. merge them

3. put them in a directory from where PI picks it up.

This bat file must be scheduled as os level by the admin/basis team to run at specific interval.

You cannot try this in file adapter level . Suppose you execute a BAT file in run OS command before message processing. The batch gets executed when the file adapter has found a file for processing , after batch file executes then again the channel continues to process the file it picked up for processing initially.

According to your requirement you need to merge files before picking up which is not happening in this case.

Regards

Anupam