cancel
Showing results for 
Search instead for 
Did you mean: 

Determine the Dynamic Source and Target Directories through an FTP

Former Member
0 Kudos

Hi Experts,

I have a requirement where SAP PI is being used as a integration layer to pick and drop files from Server A to Server B.

Overview of the Requirement:

A packet file (CSV) would be placed in a standard folder (say /file/sourcefolder/) of Server A, wherein the file contains the details like Source server, Source Directory, Source Filename, Target server, Target Directory, Target Filename. All these details are dynamic.

A sample record below explains an example on how a record in a CSV file would be:

SourceServer, /file/sourcefolder/interfaceA/ , TEST.ABC, TargetServer, /file/targetfolder/interfaceA, RESULT.ABC

As a result, SAP PI needs to perform the following steps to achieve this requirement:

Step 1: SAP PI needs to connect to the source server and read the content of the file

Step 2: On a content conversion, SAP PI needs to connect to the source server specified in the packet file(FTP details were provided)

Step 3: Upon a successful FTP, SAP PI should navigate to the specified source directory

Step 4: Pick the specified file from the specified directory

Step 5: Now, SAP PI needs to connect to the specified target server (FTP details were provided)

Step 6: Should navigate to the specified target directory

Step 7: Rename the target filename as specified in the packet file and place it in the target server.

Request you to please suggest a solution with the best practices to achieve the above requirement.

P.S: Scripting is strictly not allowed in this solution.

Thanks in Advance.

Best Regards,

Vijay Devulapalli

Accepted Solutions (1)

Accepted Solutions (1)

anupam_ghosh2
Active Contributor
0 Kudos

Hi Vijay,

                You can easily achieve the same using java mapping or adapter module.

The code reads contents of the file and follows all 7 steps you mentioned.

Regards

Anupam

Former Member
0 Kudos

Thanks Anupam for the quick response.

I would definitely try the suggested options and keep you posted.

Alternately, pls suggest on how to pass the values dynamically to the sender channel???

Best Regards,

Vijay

former_member186851
Active Contributor
0 Kudos

vijay,

Refer the below link

Dynamic file name and directory in Receiver File Adapter - summary of possibilities - Process Integr...

Enable file directory in the ASMA to make the directory dyanmic.

anupam_ghosh2
Active Contributor
0 Kudos

Hi Vijay,

               No need to put anything any dynamic attribute in any channel. In fact this will be a single ICO which will pick up only the source  file containing dynamic parameters as mentioned in your post.

The the java code will read and write the files, no need of separate communication channel any where.

The receiver channel will simply archive the  packet file (source file) in some target directory.

Regards

Anupam

Former Member
0 Kudos

Thanks Anupam.

As suggested, we have achieved this requirement through JAVA Mapping with a single ICO.

Regards,

Vijay

anupam_ghosh2
Active Contributor
0 Kudos

Thank you Vijay for closing the thread and marking my response as correct answer.

Congrats for implementing the solution as the code is a complex one.

Regards

Anupam

Answers (0)