on 10-29-2013 10:26 AM
I have a file where each field is seperated by newline and each record is seperated by '~' as below
~
02344
xyz
234.00
~
9807
asdd
3456.00
My target had to come as below
<header>
<id>02344</id>
<name>xyz</name>
<amount>234.00</amount>
</header>
<header>
<id>9807</id>
<name>asdd</name>
<amount>3456.00</amount>
</header>
Please provide me the parameters and parameter values to be used in FCC in sender File adapter
Thanks,
Lalitha
Hi Lalitha
There is no standard way to do this FCC because the filed separator is new line. If you use new line 'nl' as field separtor, then you will not get the desired structure.
The easiest solution will be writting a java mapping for the same. The java map will read the file and populate the output strcuture.
If you need any help on java mapping , then provide me the test file and output structure. I will provide you the code.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the Solution. I have Asked our JAva developer to create the staructure which I was telling.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Lalitha,
IMO, there is no standard way to read such a file unless other forum members have a standard solution.
However, I can suggest a workaround.
Read the file with records having just one field.
The data in PI will look something like below:
<Record>
<field>~<\field>
<field>02344<\field>
<field>xyz<\field>
<field>234.00<\field>
...............
..................
<\Record>
Have a 2 step mapping in ESR.
In the first mapping, use a UDF and look for tilda ~ in the field queue. after tilda, first value of field will be id, second value name and third value amount... and so on. Use a while loop....
Generate a intermediate structure like below.
In first mapping,
<header>
<id></id>
<name></name>
<amount></amount>
</header>
in the second mapping, do whatever is the mapping requirement.
Hope it helps!
Ambrish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Lalitha,
Please refer the below link for the possible options
https://scn.sap.com/thread/2128819
Regards
Bhargava krishna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Lalitha,
Use this link to configure the FCC parametes http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm
Try with these parameters in FCC:
NameA.fieldSeparator: 'nl'
NameA.endSeparator = ~
Regards
Sai
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.