Skip to Content
avatar image
Former Member

Variable Substitution for File Name Scheme

Hi all,

Please clarify the following issue.

I have two source field

Transfer Order number - 0000000222

Tranfer Order line item - 0001

Both i map it into one target field

The target field output is - 0000000222#0001

I need a file name which starts with ABC <TranferOrderNumber>.txt.

The problem is, when i try to use payload i get output

(ABC0000000222#0001.txt). The reason is i use the target field which has concatenated.

Please give me a solution where i would get output

(ABC0000000222.txt).

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    Sep 25, 2006 at 01:14 PM

    Anandha,

    use Dynamic Configuration of Adapter-Specific Message Attributes to set the file name instead of plain Variable Substitution.

    You can do it in the same mapping you use to generate target message.

    Check these references on dynamic configuration:

    http://help.sap.com/saphelp_nw2004s/helpdata/en/43/03612cdecc6e76e10000000a422035/frameset.htm

    /people/william.li/blog/2006/04/18/dynamic-configuration-of-some-communication-channel-parameters-using-message-mapping

    Just make the mapping and then set your receiver file adapter to use the adapter specific attribute instead of the default name field.

    In your specific case, the filename string should be something like:

    String filename = "ABC" + order_number + ".xml"

    Regards,

    Henrique.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 25, 2006 at 12:51 PM

    Hi Anandha,

    To get the value correct what you need to do is that you can add up a new node in your target structure and pass the transfer order no only to that field.

    In the filename schema give the value as ABC%var%.txt where %var% stands for the XML path for your new node in your target structure for transfer order number.

    when you use the content conversion you can use the 'Cut' method to suppress the node which is having only the transfer order number. For this you can refer to the configuration of the sender file adapter

    Cheers

    JK

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Anandha,

      Pls do check this blog and you can get the usage of 'cut' method in the content conversion

      /people/sravya.talanki2/blog/2005/08/11/solution-to-the-problem-encountered-using-variable-substitution-with-xi-sp12

      Cheers

      JK

  • Sep 25, 2006 at 12:58 PM

    Hi,

    Use Adapter Specific Identifiers , instead of Variable Name substitution.

    Sender File adapter --> Adapter Specific Attributes --> Select File Name

    Reciver File Adapter -->Adapter Specific Attributes --> Select File Name

    In the mapping , use this code in an UDF to change the filename to what you want,

    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String filename="YOURFILENAME";
    String rSourceFileName = conf.put(key,filename);
    
    

    Regards,

    Bhavesh

    Add comment
    10|10000 characters needed characters exceeded