on 11-02-2011 2:39 PM
Hi Experts,
I am doing variable substitution in order to get any element of source payload and to create target file name based on that.
My payload is like this:-
-
<ns0:MT_Employee_Src xmlns:ns0="urn://FileToFile_ERD">
- <Details>
<EmpId>1</EmpId>
<Name>sds</Name>
<Designation>ABAP</Designation>
</Details>
</ns0:MT_Employee_Src>
And my configurations are like this
File Name Scheme : res_%vars%.xml
vars :payload:MT_Employee_Src,1,Details,1
I gone through the blogs ,but not succeeded.
Would you please give your assistance on this.
Thanks
Rabi
Hi,
Change the parameter which you have declared in Variable Subtitution in Communication channel.
if you want the file name as Empid then --> vars :payload:MT_Employee_Src,1,Details,1,Empid,1
if you want the file name as Name then --> vars :payload:MT_Employee_Src,1,Details,1,Name,1
if you want the file name as Designation then --> vars :payload:MT_Employee_Src,1,Details,1,Designation,1
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Refer to this blog, hope this helps you
Also refer to this blog:
http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
Thanks
Rohini
Hi All,
Thanks for your suggestions and replies.
Great .
This is solved now.
I was using source payload in variable substitution which should be of target payload.
Thanks
Rabi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Two corrections to what you have done
1.Use a field from your target message type for variable substitution.
2.Include the name of the field where you have stored the filename in * payload:MT_Employee_Src,1,Details,1* at the end
Regards,
Manjusha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Rabi
Only
vars :payload:MT_Employee_Src,1,Details,1
will not help as you need to pass the field value in variable which should contain a data to pass in file name. Her you have refered a node.
Pass:
vars :payload:MT_Employee_Src,1,Details,1,<Filed which contains file name scheme part eg. EmpId>,1
Regards
Raj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
As per your scenario, you want to use source field to get filename. Then create an extra field in your target structure, Assign that value to your field in target. (Assign value to designation field for instance)
In FCC , give filename schema as res_%var5%.xml (var5 is the field in target structure which you want to substitute)
Go to reference tab,
var5 : payload:MT,1,RecordSet,1,Detail,1,Designation,1 (hierarchy must be given )
In content conversion tab:
Details.fieldFixedLengths : 1,3,0,1..
Give 0 to the designation field as you are using it just as variable
Details.fixedLengthTooShortHandling : Cut
try this .
Thanks & Regards,
Rohini
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rabi,
For the payload as shown below
<ns0:MT_Employee_Src xmlns:ns0="urn://FileToFile_ERD">
<Details>
<EmpId>1</EmpId>
<Name>sds</Name>
<Designation>ABAP</Designation>
</Details>
</ns0:MT_Employee_Src>
Suppose you want to do variable substitution with value of say "Name" field. You want to achieve target filename as
res_sds.xml (as value of "Name" field is "sds").
Then you need following configurations
File Name Scheme : res_%var1%.xml
Variable substitution
Variable Name Reference
var1 payload:MT_Employee_Src,1,Details,1,Name,1
You need to mention name of the tag whose value you need in the filename. In your post you mentioned last tag as "Details" in reference field. This tag "Details" cannot be the last tag because it is being used as parent tag of the tags <EmpId>, <Name> and <Designation> and does not bear a value of its own.
Hope this solves your problem.
regards
Anupam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi RabiPanda,
the variable substitution feature of Receiver File adapter to get the Output file name as one of the Field value from payload.
take the file name from the paylode what u given...
please go through the below links.. this will slightly help u...
http://www.saptechnical.com/Tutorials/XI/Variable/substitution.htm
regards,
kesava.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
refer this [link|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/13704] [original link is broken] [original link is broken];. This would give idea about using variable substitution.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.