cancel
Showing results for 
Search instead for 
Did you mean: 

File to File scenario with file name change

sherin_jose4
Participant
0 Kudos

Hi all,

Currently we are working on a File to File scenario using ICO and without mapping in 7.3.

The scenario works perfectly fine, but we have a specific requirement which needs to be incorporated in the interface.

Say, if the source file name is "TempDATmas.txt" this has to be changed as "TempLXWmas.txt". Ideally DAT has to be replaced with LXW.

We don't want to do with CommandLine feature and we also want to achieve this without any mapping.

Accepted Solutions (0)

Answers (7)

Answers (7)

former_member201264
Active Contributor
0 Kudos

Hi Jose,

You can achive this with AttribMapper Adapter Module.

But you should have installed Seeburger Workbench on your machine.

I think AttribMapper Adapter Module  comes along with seeburger.

Regards,

Sreeni.

former_member184789
Active Contributor
0 Kudos

Hi Sherin,

Could you please try the Java mapping for dynamic configuration, take help from the below links:

http://wiki.sdn.sap.com/wiki/display/XI/Sample+Code+-+Dynamic+Configuration+in+Java+and+ABAP+Mapping

http://help.sap.com/javadocs/pi/SP3/xpi/com/sap/aii/mapping/api/DynamicConfiguration.html

FOr changing file name, you have to give the logic as:

DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");

           oldFilename = conf.get(key);   

newFilename = oldFilename.replaceAll("DAT","LXW");

conf.put(key, newFilename);

Hope this helps.

anupam_ghosh2
Active Contributor
0 Kudos

Hi Sherin,

                   Using a small   java mapping  is perhaps the simplest solution  to the problem. You can use ASMA in mapping as shown here in the blog. The target filename is not a static one, but depends on the source filename. Thus you need to check what the source filename was and accordingly find out the target filename. This needs logic in PI which can be introduced using java mapping or adapter module.

Regards

Anupam

former_member191435
Contributor
0 Kudos

hi,

If your target file name always TempLXWmas.txt". then u can use filename as it is with timestamp

Cheers,

Cnu

Former Member
0 Kudos

Sherin,

It seems to be difficult without any mapping.

If you dont want to use message mapping you can achieve this java mapping.

Regards,

Ashish

Former Member
0 Kudos
sherin_jose4
Participant
0 Kudos

Thanks Amit.

Is there any other easier tweaks to achieve this requirement?

Just want to make sure that we don't land up on something that takes more time.

Former Member
0 Kudos

Hello,

You already ruled out command line feature so AFAIK these are the only two options.

Let me tell you my exp, i have implemented this kind of design in many file transfer interfaces and it works fine and easy to build also (u just need to change the logic part in the above code and rest all will remain the same so can reuse it)

Thanks

Amit Srivastava

Former Member
0 Kudos

Hi,

>>Currently we are working on a File to File scenario using ICO and without mapping in 7.3.

My personal suggestion is to go with below reusable module.

http://wiki.sdn.sap.com/wiki/display/Snippets/Dynamic+file+name+in+a+File+to+File+pass+through+scena...

Do small changes as below.

Read two input parameters(DAT,LXW) from config.

private String Input1;

private String Input2;

Input1 = (String) moduleContext.getContextData("Inputval1");

Input2 = (String) moduleContext.getContextData("Inputval2");

filename.replaceAll(Input1 ,Input2 );

..............

Regards

Venkat

Former Member
0 Kudos

you have to create one more receiver communication channel for rename the source file . in that adapter , u have to define Target file name as  "TempLXWmas.txt".  in FIle name  on Target Receiver File adapter and u have to give target adapter path(directory) as source path.

and one more thing is u should select Processing mode is "DELETE" in source adapter.