cancel
Showing results for 
Search instead for 
Did you mean: 

XML-IDOC to Plain File: File Receiver Cnt Conversion Problem Nested Stucts

0 Kudos

Hi all,

I have an IDOC-XI-File scenario and I have a problem with the file receiver adapter and the content conversion parameters when the final data type has nested structures. Imagine that I have something similar to the following:

My desire is to get something similar to this in the output file:

SEGMENT0;HEADER

SEGMENT1;100

SEGMENT2;0200000716

SEGMENT3;1000

SEGMENT2;0200000717

SEGMENT3;1000

SEGMENT3;1001

SEGMENT3;1002

But what we are getting is this:

SEGMENT0;HEADER

SEGMENT1;100

SEGMENT2;0200000716;SEGMENT3;1000

SEGMENT2;0200000717;SEGMENT3;1000;SEGMENT3;1001;SEGMENT3;1002

The content conversion parameters of the file receiver are as follow:

Recordset Structure: IDOC,EDI_DC40,E1STATS,Z1HDSTAT,Z1ITSTAT

IDOC.fieldSeparator: ;

IDOC. endSeparator: ‘nl’

IDOC. addHeaderLine: 0

EDI_DC40.fieldSeparator: ;

EDI_DC40. endSeparator: ‘nl’

EDI_DC40. addHeaderLine: 0

E1STATS.fieldSeparator: ;

E1STATS. endSeparator: ‘nl’

E1STATS. addHeaderLine: 0

Z1HDSTAT.fieldSeparator: ;

Z1HDSTAT. endSeparator: ‘nl’

Z1HDSTAT. addHeaderLine: 0

Z1ITSTAT.fieldSeparator: ;

Z1ITSTAT. endSeparator: ‘nl’

Z1ITSTAT. addHeaderLine: 0

I’ve tried to use the parameter beginSeparator=’nl’ for the segments Z1ITSTAT but it’s not working. I haven’t been able to find a solution in the other forums. Can anybody help me?

Thanks in advance

Roger Allué Vall

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

It is not possible to do a content conversion to this structure. Try to use one more mapping and get the structure like

<MT_TRG>

<Node1>

<fld1>a</fld1>

<fld2>a</fld2>

.

.

<fldN>z</fldN>

</Node1>

<Node2>

<fld1>a</fld1>

<fld2>a</fld2>

.

.

<fldN>z</fldN>

</Node2>

.

.

.

<NodeN>

<fld1>a</fld1>

<fld2>a</fld2>

.

.

<fldN>z</fldN>

</NodeN>

</MT_TRG>

Regards,

Jai Shankar

Answers (3)

Answers (3)

0 Kudos

Now I understand what you mean. Thanks, it worked fine.

Former Member
0 Kudos

Hi,

There is another round about way to keep the sequencing in place(if at all that is getting lost)...

The trick is to convert the IDOC-XML to IDOC flat file format....this can be done very easily using an ABAP mapping and a standrad Function module....it is explained in the How-to document ...

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/46759682-0401-0010-1791-bd1...

If you were write the output of the mapping to a file using file adapter, without content conversion you would have all the sequencing in place...however, it would have details of the whole IDoc...

Now if you want specifics only..then after the standrad FM is called...loop through the IDOC data and extract only the required stuff....this way the sequencing is not lost..

Thanks.

prabhu_s2
Active Contributor
0 Kudos

as jai pointed out, the expected doc strucutre shud be like

<root>...

<nameA>

<value1>value</value1>

<value2>value</value2>

<value3>value</value3>

</nameA>

<nameB>

<value4>value</value4>

</nameB>

......

</root>

also refer to :

<a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/ae/d03341771b4c0de10000000a1550b0/frameset.htm">Converting File Content in the Receiver Adapter</a>

0 Kudos

Can you explain it with my example? I can't see what you mean.

<ZSYSEX01>

.<IDOC BEGIN="1">

....<EDI_DC40 SEGMENT="SEGMENT0">

........<FIELD1>HEADER</FIELD1>

....</EDI_DC40>

....<E1STATS SEGMENT="SEGMENT1">

........<FIELD2>100</MANDT>

........<Z1HDSTAT SEGMENT="SEGMENT2">

...........<FIELD3>0200000716</FIELD3>

...........<Z1ITSTAT SEGMENT="SEGMENT3">

...............<FIELD4>1000</FIELD4>

...........</Z1ITSTAT>

........</Z1HDSTAT>

........<Z1HDSTAT SEGMENT="SEGMENT2">

...........<FIELD3>0200000717</FIELD3>

...........<Z1ITSTAT SEGMENT="SEGMENT3">

...............<FIELD4>1000</FIELD4>

...........</Z1ITSTAT>

...........<Z1ITSTAT SEGMENT="SEGMENT3">

...............<FIELD4>1001</FIELD4>

...........</Z1ITSTAT>

...........<Z1ITSTAT SEGMENT="SEGMENT3">

...............<FIELD4>1002</FIELD4>

...........</Z1ITSTAT>

........</Z1HDSTAT>

....</E1STATS>

.</IDOC>

</ZSYSEX01>

Regards,