on 06-07-2012 9:04 AM
Hi,
My source flat file structure is in the format as below:
ABD,EFG,LMN
I want to convert it into an XML structure as below in the sender communication channel:
<Record>
<VIN>ABD</VIN>
<VIN>EFG</VIN>
<VIN>LMN</VIN>
</Record>
Request you to help me in giving the MTB parameters to use one field mulitple times in the same node.
Thank you.
Regards,
Subbalakshmi Musunuri
Hi Subbalaxmi,
You can read the data like below:
MT_Source
Record --- 0.... unbounded
field1
field2
field3
FCC with fieldSeperator ','
this will give you something like below
MT_source
Record
<field1>ABD</field1>
<field2>EFG</field2>
<field3>LMN</field3>
So in the graphical mapping, you do a straight map:
MT_target
<Record> --- 0 --- unbounded
<VIN>
do duplicate subtree twice on record and then map field1, field2 and field3 to record node like below:
field1 -> exists-> createIf -> Record (0)
field2 -> exists-> createIf -> Record (1)
field3 -> exists-> createIf -> Record (2)
map field1, field2 and field3 directly to VIN.
this should work.
Hope you have understood the logic!
Ambrish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Subbalaxmi,
Can you please send us the sample file, that what you are getting.
Thanks,
Sreenivas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
source structure:-
My source flat file structure is in the format as below:
ABD,EFG,LMN
Gothrough the below links same as your requirement.
http://www.riyaz.net/sap/xipi-file-content-conversion-for-simple-structure/75/
http://www.riyaz.net/sap/xipi-file-content-conversion-for-complex-structures/79/
http://wiki.sdn.sap.com/wiki/display/XI/Basic+File+Adapter+Content+Conversion
http://www.saptechnical.com/Tutorials/XI/Contentconversion/page1.htm
like so many document document are available please check it do u r work in great way.
Thanks and regards,
Kesava.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi All,
Even I am facing the similar problem as Subbalaxmi, but I am getting an error PARSE_PAYLOAD_ERROR.
I am creating the FCC parameters exactly as mentioned in the above help links.
But still getting the error. Can anyone help me into this?
Input and output structures as below:
Input Text file:
H 0298 ABC Tech Test
BEF0458 A00 017302959ERNEST HARVEY S 15 FAIRLAWN CT HILTON HEAD ISLAN SC 29926104019400911MM
The XML output File should be:
<Record>
<Detail>
<REC_CTRL>BEF0458</REC_CTRL>
<FILLER></FILLER>
<MEMBER_CODE>A</MEMBER_CODE>
<MEMBER_SEQ_NO>00</MEMBER_SEQ_NO>
<MEMBER_SSN>017302959</MEMBER_SSN>
</Detail>
</Record>
I am using Content Conversion at Sender Adapter, with the following parameters:
Header.fieldFixedLengths 1,4,25,5
Item.fieldFixedLengths 1,2,2,3,8
Header.fieldNames Key,Rec_Control,ID,CompName,Text
Item.fieldNames Key,REC_TYPE,CLIENT_NO,NAME
Header.endSeparator 'nl'
Item.endSeparator 'nl'
Header.fieldSeparator 'nl'
Item.fieldSeparator 'nl'
Header.keyFieldValue 1
item.keyFieldValue 2
Header.keyFieldInStructure ignore
Item.keyFieldInStructure ignore
I am getting error PARSE_PAYLOAD_ERROR.
Can anyone please help me into this?
Hi,
You can achieve this using FCC. In the adapter parameters just mention the field name and the separator.
The other option is use message options:
http://help.sap.com/saphelp_nw04/helpdata/en/24/4cad3baabd4737bab64d0201bc0c6c/content.htm
Regards,
Sainath Chutke
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Is there any specific reason to have same field names multiple times inside same segment?
Because, definitely you cannot create a DataType with same field name inside same Record.
You can elaborate your requirement, like the scenario and what is expected at receiver side. so that we can think of some solutions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I guess i went wrong above, at least you can define one DataType field VIN with occurrence as 1..unbounded under Record. So your source structure would be like
Record 1..unbounded
VIN String 1..unbounded
So you can configure Sender File Content Conversion as below,
DocumentName : your Message Type name
DocumentNamespace : your Message Type namespace
Recordset Structure : Record,*
Recordsets per Message : *
in the table specify below parameter and value,
Record.fieldSeparator: ,
Record.fieldNames: VIN,VIN,VIN
in Record.fieldNames specify VIN max number of times you may expect in a single line.
I hope this should work and solve your problem
-Zameer
Hi,
To convert a flat file structure into XML in sap xi/pi, you have to use FCC parameters in sender adapter in this case.
Please Follow below links to configure it.
http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm
http://wiki.sdn.sap.com/wiki/display/XI/File+Content+Conversion
Regards
Aashish Sinha
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.