on 09-25-2006 6:17 PM
Hi all,
Could you please help me out in how to use attributes in variable substitution....
Regards,
Sundar
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sundararamaprasad,
<i>>>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?).</i>
To overcome this u can use Dynamic Configuration to extract the file name in the beginning of the message mapping itself. Once u have extracted the name u can save it in a Global Container and use it anywhere in the same message Mapping.
Regards
Neetu
Hi Neetu,
I dont think it will work for my scenario. The Problem is using multi mapping i'm going to produce 3 files. If i use dynamic configuration as you said it will not work. what ever global variable i use when i define it as a filename in one message it will override the filename which i specified for the previous message.
Regards,
Sundar
Hi,
><i>The Problem is using multi mapping i'm going to produce 3 files. If i use dynamic configuration as you said it will not work. what ever global variable i use when i define it as a filename in one message it will override the filename which i specified for the previous message.</i>
This makes a lot of sense. I guess you will have to use Variable Name substitution, but you will not be able to access the attributes . Need to make a dummy field or something of that sort.
Regards,
Bhavesh
I have a similar problem - I am producing 38 files which come to the receiver adapter and variable substitution doesn't work (I get no output). The message comes in form: Messages
|___ Message1
|__ 38 x MyRootElement
|__ pob <xxx>
How to use variable substituion here? I tried to put into reference:
payload:MyRootElement,1,pob,1
but got nothing to the output. In SXMB_MONI see even no payload in Response section..
Any idea how to workaround it? SAP documentation states nothing about such situation
Thank for anything Rasto
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
Hi Sundar,
please give some more detailled information.
Regards Mario
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.