cancel
Showing results for 
Search instead for 
Did you mean: 

Need Help: Have to route file from directory to directory in same system

arkesh_sharma
Active Participant
0 Kudos

Hi Experts,

I need to route xml file from one directory to another and then to another one in the local system. For example, i have the file in directory A, i need to delete that file from that location and place it in B and then from B i have to move it to A again and then move it to C.

The path will be: A-> B -> A -> C

where A, B, C are folder names

How can i do that in SAP-XI in ID? Do i need to create two communication channels? Please guide me and help me out of this.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

As far as I know a single file adapter can access only one location @ server and it can either pick a file(sender adapter) or drop a file(receiver adapter).

About deletion its possible by setting the processing mode to DELETE

You will need 3 scenarios = 6 file adapters

P.S : Why PI? I would suggest go for OS scripts. PI would uselessly make things bulky if not complex due to teh number of interfaces.

arkesh_sharma
Active Participant
0 Kudos

Hi Soumen,

What are OS scripts? How can i implement those ? I also understand things will get a bit complex when using PI for such a small thing but i didnt knew any other alternative.

Please give me more explanation on this so that i can implement what i am trying to do.

Thanks,

Arkesh

Former Member
0 Kudos

Hi Arkesh

Have a look at these blogs.

/people/santhosh.kumarv/blog/2008/07/27/glimpse-at-os-command-yet-another-scenario

/people/michal.krawczyk2/blog/2007/02/08/xipi-command-line-sample-functions

This will give you an idea of what we are trying to say. You create a batch file(*.bat) , include all the commands in it and call that batch file in file adapter. Thats it!!!

All you need to do is search a bit for the right commands depending on your requirement.

Regards

Soumen...

arkesh_sharma
Active Participant
0 Kudos

Hey Soumen !!!

Thanks a lot for your help.. The problem is resolved now and I got to learn the OS Command feature present in the Comm. Channel.

Thanks for sharing the Blogs with me.

Thanks,

Arkesh

Answers (1)

Answers (1)

former_member187339
Active Contributor
0 Kudos

Hi Arkesh,

>>For example, i have the file in directory A, i need to delete that file from that location and place it in B and then from B i have to move it to A again and then move it to C.

For doing this why you need SAP PI? you can better do this with a script or batch job.

>>A-> B -> A -> C

A to B will be one interface and B-->A will be another one. The file getting picked from A and getting dropped to A (in second scenrio) shoudl not have the same name else these two interfaces will go in a loop.

A to C will be the third scenario

each scenario will have a sender file adapter and a receiver file adapter.

But still I didn't get the business usage or usage of PI in this case

Regards

Suraj

arkesh_sharma
Active Participant
0 Kudos

My Primary Purpose is to move the file from A -> B,

Do some processing in it at B and then move it to A for normal processing from A -> C.

Initially it was a file to file scenario with file coming into A were picked and dropped in C.

Now i have to add extra functionality to which i need to move the file into another location and perform the check and then move it back to the same location so that the old process is followed.

How can i create a batch process/ script to run on windows to execute the above process?

former_member181962
Active Contributor
0 Kudos

Hi Arkesh,

What you can do is to use the feature Run OS Command before processing in the file adapter. Then do whatevr "processing" that you want to do and then the file adapter picks it .

Regards,

Ravi Kanth Talagana

former_member187339
Active Contributor
0 Kudos

Hi Arkesh,

Now it sounds good.

For moving from A to B and back to A use batch file commands (depending on whether the Operating System is Unix or windows the coding differs). There are lot of articles on file moving in internet. Just do a search and you can achieve this

for eg : http://www.chebucto.ns.ca/~ak621/DOS/BatExamp.html

And from A to C you can use PI, Be sure that the filename for PI to pick is different from the one which batch job picks.

Regards

Suraj