Skip to Content

File channel ASMA issue: add .xml along with time stamp to sender file name

Hi Experts,

We have a scenario in which we are only passing the file using IC.

We need to pass the same file name from sender and add extension(.txt or .xml) along with timestamp.

If sender file name is pain001.ir8.003, It has to come with time stamp and extension.

I have used ASMA and add time stamp in channel, but that ll give the file name as "pain001.ir820150107_129403_222431.003" and ll not add extension.

I have two way to do it.:

1. Add mapping to this scenario and use dynamic mapping

2. write unix code to add extension before the channel picks the file.

Both of the above method will make the scenario complex. Is there any other way around.

Is it possible to do it with IC?

Please share your thoughts.

Regards,

Vikram

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • avatar image
    Former Member
    Jan 08, 2015 at 05:26 AM

    Hi,

    Please can you try in your file name parameter on the receiver channel.

    *.xml

    Regards,

    Jannus Botha

    Add comment
    10|10000 characters needed characters exceeded

    • Thanks for the links.

      In these links, everyone is mentioning to go for UDF or OS command, but I am looking for some alternate option, so that we don't have to go for message mapping or OS command.

      But I think, there is no other way around.

      Regards,

      Vikram

  • avatar image
    Former Member
    Jan 08, 2015 at 08:07 AM

    Hmmm... so it's a payment file which you want to send from ECC to some Bank as I predict it from your file name e.g. pain001. 😊

    Well the simple solution is to aks the ABAPer to make the changes in the program so that when the program writes the file then it shoul write with desired timestamp and doing so it will becaome passthrough interface from PI point of view.

    This is the best and most feasible solution in my opinion you can have.

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 08, 2015 at 05:01 PM

    Virkam,

    Please try my wiki Dynamic file name for pass-through scenario - SAP PI. It will have ESR objects.

    Get file name in Java mapping and replaceAll("\\.","_"). Please let me know, if you need more guidance.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 08, 2015 at 05:43 PM

    you can try the workaround as

    1. add adapter module AF_Modules/DynamicConfigurationBean

    AF_Modules/DynamicConfigurationBean  1

    parameters

    1key.0write http://sap.com/xi/XI/System/File FileName1value.0

    message.interface

    2. Enable Variable substituion & ASMA

    fName

    message:interface_name

    3. File name scheme as %fName%.txt or %fName%.xml

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 09, 2015 at 07:09 AM

    Hi All,

    I didn't find any simpler way so I did this using OS command.

    Thanks for your inputs.

    Regards,

    Vikram

    Add comment
    10|10000 characters needed characters exceeded