Skip to Content
avatar image
Former Member

REG: Output File Name

Hi All,

I have a file to file scenario where mapping is not used. My Input file name is "XXXX.txt" and i want the output file name as "XXXX.dat". But the problem is XXXX is not a constant value but a dynamic value and i cant use a UDF because there is no mapping for this interface. Is there any other method by which this can be achived?

Thanks,

Siva

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    May 19, 2009 at 09:08 AM

    use a simple java mapping that will pass the inputstream to the outputstream... that means no transformation of the data is done 😊 and in this java mapping use dynamic configuration to set the file name.

    You will find all required details in this blog - /people/shabarish.vijayakumar/blog/2009/03/26/dynamic-configuration-vs-variable-substitution--the-ultimate-battle-for-the-file-name

    chk the wiki links etc in the blog for sample codes

    Add comment
    10|10000 characters needed characters exceeded

    • hi,

      in case you don't want to do it in a java mapping like Shabarish suggested

      you can also do it (set dynamic configuration attribute Filename) inside an

      adapter module - this way there will be no need for any mapping nor interface

      mapping and you can handle everything inside the file comminication channel

      both approaches require exactly the same amount of code writing in my opinion

      Regards,

      Michal Krawczyk

  • avatar image
    Former Member
    May 19, 2009 at 09:14 AM

    Hi!

    For your input file you can work as follows:

    Put the file in a special directory and then read this directory using wildcard filename definition:

    e.g. *.txt looks for and processes all files ending with *.txt

    For your output file (receiver file adapter) you may work with os command "rename" and/or try it using this stuff:

    http://help.sap.com/saphelp_nwpi71/helpdata/en/44/6a316af5a23672e10000000a114a6b/content.htm

    Regards,

    Volker

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 19, 2009 at 09:33 AM

    Hi,

    Select the Adapter Specific Message attrributes (Filename,File Type) for both Sender and Receiver communi. Channel.

    Regards

    Jagesh

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 19, 2009 at 10:04 AM

    Hi,

    Easily you can acheive it by using Adapter Specific Message attrributes property without writing Java code

    Sameer

    Add comment
    10|10000 characters needed characters exceeded