cancel
Showing results for 
Search instead for 
Did you mean: 

Renaming File at Receiver Side

Former Member
0 Kudos

Hi Experts,

I have developed a Adapter Module for Renaming the flile at Receiver side.

Channel channel = new Channel(cid);

fileName = channel.getValueAsString("file.targetFileName");

dirName = channel.getValueAsString("file.targetDir");

After reading the file name .i had changed the name here

fileName = fileName + "GMT" + "." + Extension;

Finally writing the payload...

com.sap.aii.af.ra.ms.api.XMLPayload xmlPay = (com.sap.aii.af.ra.ms.api.XMLPayload) msg.getDocument();

xmlPay.setText(OutPayload);

msg.setMessageProperty("http://sap.com/xi/XI/System/File", "Directory", dirName);

msg.setMessageProperty("http://sap.com/xi/XI/System/File", "FileName",NFileName);

msg.setDocument(xmlPay);

but the file name is not changed... any change needed?

Regards,

Rajesh.D

Accepted Solutions (0)

Answers (3)

Answers (3)

prasad_ulagappan2
Contributor
0 Kudos

You can do it without an Adapter module for this. Use a adapter specific values in CC and use that in UDF to change the file name.

Former Member
0 Kudos

>>I have developed a Adapter Module for Renaming the flile at Receiver side.

What was the basic motive behind development of AM?

You can put file with desired fileName using DynamicConfiguration or Variable Substitution. Of using Standard parameters of File Adapter.

Is there unique requirement for it?

Also what you are doing you can do the same in Mapping also (using DynamicConfiguration class).

Thanks

Farooq

Edited by: Farooq Farooqui on Oct 17, 2008 5:04 PM

Former Member
0 Kudos

Hi Farooq,

My requirment was based on the content of the EDI file, i have to rename the file and the new file name may change on timely basis so we decided to go for Module .so that we can give name via module parameter.

In my above code i am assigning new name to fileName parameter but the file name is not changed .help me pls

Regards,

Rajesh.D

prasad_ulagappan2
Contributor
0 Kudos

You can get the content in a UDF easily than in Adapter module. My suggestion would be to go with UDF instead of Adapter module, which will be good for performance too.

Former Member
0 Kudos

Hi

If u want to use the Time stamp it's better use the "Adapter Specific attributes" if u r using SP12 .

Use the DynamicConfiguration to capture those in the target Interface and same is passed to the Recever File Adapter as %var%.xml

Search for Dynamic configuration on SDN u wud get enough codes and docs

regards

srini