Skip to Content
author's profile photo Former Member
Former Member

how to use attributes in variable substitution???:(

Hi all,

Could you please help me out in how to use attributes in variable substitution....

Regards,

Sundar

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 25, 2006 at 06:13 PM

    Hi Sundar,

    please give some more detailled information.

    Regards Mario

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 25, 2006 at 06:18 PM

    Mario,

    by attributes I guess he means XML tags attributes (which can be accessed through XPath's expressions such as /Root/@Attribute ).

    Sundy (lol, your name is too large),

    for that, I think you'll have to use dynamic configuration instead of plain variable substitution.

    Regards,

    Henrique.

    Add a comment
    10|10000 characters needed characters exceeded

    • 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

  • author's profile photo Former Member
    Former Member
    Posted on Sep 26, 2006 at 04:26 AM

    Hi Guys,

    I'm doing multi-mapping...so i can not use dynamic configuration for each msg in the target. If i use dynamic configuration only the last dynamic configuration which i have specified for the last msg will be effective for all..(Is there any way to overcome this?). so i'm specifying an attribute to the root node and assiging filename to it. I can not add an addition element to the XML structure and then remove the value of that element in File Content Conversion using fixedLengthTooShortHandling.....what i can have is extra attributes...so for example consider my XML structure to be like this

    <?xml version="1.0" encoding="utf-8"?>

    <Root fname="myfile.txt">

    <a>.....

    </a>

    </Root>

    so how to assign the value in the attribute fname as my output filename using the variable substitution?

    Regards,

    Sundar.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.