Skip to Content
avatar image
Former Member

Renaming File at Receiver Side

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Oct 17, 2008 at 11:24 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 17, 2008 at 11:33 AM

    >>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

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 17, 2008 at 11:44 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded