on 03-04-2009 6:13 AM
Hi Experts,
I am doing the scenario of Proxy sender to File receiver and my purpose is to Create the text file
as per the filename available in Source Message payload.
I am using the Variable Substitution method for this as shown below.
Source Message Structure:-
<Row> -
having Cocurence 1.1
<Filename> -
having Cocurence 1.1
<Item> -
having Cocurence 1.Unbounded
<Field1>
<field2>
<Item>
<Item>
<Field1>
<field2>
<Item>
<Row>
Target structure is same as the source structure and i have mapped the Filename field of the Source
with the Target structure Filename.
In ID the following is the File receiver CC Configuration.
File Name Scheme:- %Dyn_filename%
In Advance tab, I have selected the Enable option and added one row as Variable name %Dyn_filename%
and Reference as payload:Row,1,Filename,1
In testing I am getting the Error as 'variable Dyn_filename is not found in Message payload'.
Please suggest me.
Regards,
Jagesh
Try replacing the name Dyn_filename with some name with all characters in lower case.
Regards,
Prateek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Prateek,
Correct, I have changed the Variable name to all lowercase and I have also changed the reference Content as 'payload:MT_Targetstruct,1,Row,1,Filename,1'
Now Output file is now created with the Filename available in Message payload.
One more problem I found is:- I am using the File Content conversion as Message protocol and Recordset structure as Row,Item with following details.
ITEM.fieldSeparator ,
ITEM.endSeparator 'nl'
Row.fieldSeparator 'nl'
But filename which is available in target message structure is also being written in the Output File. I don't want Filename in the Output file.The content of the Output file is as shown below.
Filename.txt,Field1,Field2
Field1,Field2
Field1,Field2
So please suggest me how to avoid this unwanted Elements on Output file.
Thanks for your valuable reply.
Regards
Jagesh
Hi Jagesh,
Its possible to handle your scenario using dynamic configuration in your file receiver, but I think variable substitution is much convenient option.
As Shabz mentioned, you should use "fixedLengthTooShortHandling" for avoiding the filename as a part of the message content. Check the following blog : /people/sravya.talanki2/blog/2005/08/11/solution-to-the-problem-encountered-using-variable-substitution-with-xi-sp12
thanks,
Pooja Pandey
Hi Pooja,
Hi Pooja,
Thanks for your valuable reply..
I tried with the same. but still Filename is appearing in Output file.Giving you some details regarding my Receiver File Configuration settings.
Target Message Type:-
<MT_Target_Struct>
<Row>----
1.1 occurence
<Filename_test>----
1.1 occurence
<ITEM>----
1.unbounded occurence
<Field1>
<Field2>
<ITEM>
<ITEM>
<Field1>
<Field2>
<ITEM>
<Row>
<MT_Target_Struct>
Recordset structure:- Row,Filename_test,ITEM
Row.fieldSeparator----
>'nl'
Filename_test.fieldFixedLengths----
>0 (Zero)
Filename_test.fixedLengthTooShortHandling----
>Cut
ITEM.fieldSeparator----
>,
ITEM.endSeparator----
>'nl'
I want only ITEM node to be written in the output file.
Please suggest.
Regards,
Jagesh
try
Recordset structure:- Filename_test,ITEM
Filename_test.fieldFixedLengths----
>0 (Zero)
Filename_test.fixedLengthTooShortHandling----
>Cut
ITEM.fieldSeparator----
>,
ITEM.endSeparator----
>'nl'
If this doesnt work, then modify the structure.
Put Filename_test towards the end of XML i.e after ITEM and try the FCC,
Recordset structure:- ITEM,Filename_test
ITEM.fieldSeparator----
>,
ITEM.endSeparator----
>'nl'
Filename_test.fieldFixedLengths----
>0 (Zero)
Filename_test.fixedLengthTooShortHandling----
>Cut
You still havnt considered the option of using dynamic configuration and adapter specific message attributes as i had mentioned in the earlier post. The issue with using CUT is that it will not completely remove the line but rather it will post and empty line. Try dynamic configuration with ASMA it is much more powerful, easy and recommended.
Hi Shabarish,
I have tried as you have suggested in your last reply but still Filename is coming in Output File.
I think I must go for Dynamic Confg. method.
Can you suggest me how to use Dynamic confg. method for proxy sender to File receiver??? (Filename is available in Source structure)
Please suggest.
Regards,
jagesh
Hi Jagesh,
Remember few things:
1) The variable substution should use the xpath of the target payload
2) Use lowercase variable names in both File name scheme & variable substitution table
Try if this works
payload:Row,1,Filename,1,item,1
Regards,
Varun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Jagesh,
Use these values as Shabarish mentioned and let us know.
Filename.fixedLengthTooShortHandling, Value column = Cut
Regards,
Pavan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Variable name should be in lower case
Sameer!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
as prateek says try all lower case,
does your mapping test successful,
test configuration in ID ,
check the payload ....
my thought is , mapping is the pain area.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
1. Make sure there is a value in your field in your target XML for the file name
2. Why use variable substitution when you have the option of Dynamic configuration?
have a look -
/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
http://help.sap.com/saphelp_nw04/helpdata/en/43/03612cdecc6e76e10000000a422035/frameset.htm
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.