cancel
Showing results for 
Search instead for 
Did you mean: 

IDOC-XML to IDOC-Flat file conversion

Former Member
0 Kudos

Hi,

I have a scenario in which XI receives IDOCs from SAP system and XI has to convert these IDOC-XMLs to IDOC-Flatfiles and dump them in a FTP server. I followed the How-To guide below and it worked well.

____________________________________________________________________________________________________________

http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/46759682-0401-0010-1791-bd1972bc0b8a

____________________________________________________________________________________________________________

But i have a problem when IDOCs are bundled together. When i get a message which has 2-3 idocs packed together the target flat file does'nt look the way it has to. The 2 EDIDC40 segments occur together at the top and the data segments occur later at the bottom. How do i overcome this?

_____________________________________________________________________________________________________________

This is how the flat file looks:

EDI_DC40 1350000000000007139700 3024 PEXR2002 PAYEXT SAPECD LS ECDCLNT135 XMLHTTP B 0061000052 20090825103921 1E2A88C091AC11DEC34B001A6463721E 000000000088815020090825103919

EDI_DC40 1350000000000007140700 3024 PEXR2002 PAYEXT SAPECD LS ECDCLNT135 XMLHTTP B 0061000052 20090825111050 1E2A88C091AC11DEC34B001A6463721E 000000000088815220090825111049

E2IDKU1 1350000000000007139 1 000000 PEXEXTENDED PAYMENT ORDER 2000000003 ORG001

E2EDK03 1350000000000007139 2 000000 01120090825103919

E2EDK03 1350000000000007139 3 000000 02820090825

E2EDK03 1350000000000007139 4 000000 01720090825

E2EDK02 1350000000000007139 5 000000 0222000000003

E2EDK12000 1350000000000007139 6 000000 0261000000000

E2IDKU2 1350000000000007139 7 000000 001DO 001

E2IDKU3002 1350000000000007139 8 000000 CUS1550TEST2 20090825 000000125311

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Your mapping needs to be ready for supporting 1...n cardinality, It means that at target side you also have 1...n cardinality. In this case You can use multimapping. Then in PI is going to do the split. To reach this, You need to have a "enhanced" interface determination.

Regards

Ivan

Former Member
0 Kudos

Hi Jose,

I dont need to split the incoming message to individual idocs. say for example if the incoming message has 3 idocs i want the output file also to have 3 idoc flat structures in one file. Im able to get that. But the problem is the output structure looks like this:

EDI_DC40_IDOC1

EDI_ED40_IDOC2

EDI_DC40_IDOC3

Data_IDOC1

Data_IDOC2

Data_IDOC3

instead of

EDI_DC40_IDOC1

Data_IDOC1

EDI_ED40_IDOC2

Data_IDOC2

EDI_DC40_IDOC3

Data_IDOC3

Former Member
0 Kudos

Hi,

What are the parameters configuration of your Receiver FCC ?

Regards

Ivan

Former Member
0 Kudos

Well actually im not using FCC at all. Im just writing out the data as it is.

Former Member
0 Kudos

Hi Sakthi,

It seems you are getting like this only from the source file. Can you please check the source file how you are getting. If you are geting like this then the source program may need to change. I feel they got the looping wrong. So Please check it.

Regards,

---Satish

Former Member
0 Kudos

Hi Satish,

The source file is fine. the program im using is the program given in the How-To guide.

<?xml version="1.0" encoding="UTF-8" ?>

- <PEXR2002>

- <IDOC BEGIN="1">

+ <EDI_DC40 SEGMENT="1">

</EDI_DC40>

+ <E1IDKU1 SEGMENT="1">

</E1IDKU1>

:

:

:

</IDOC>

- <IDOC BEGIN="1">

+ <EDI_DC40 SEGMENT="1">

</EDI_DC40>

+ <E1IDKU1 SEGMENT="1">

</E1IDKU1>

:

:

:

</IDOC>

</PEXR2002>

former_member187339
Active Contributor
0 Kudos

Hi Sivashakthi,

As per the How-to Doc, Only the content of one IDoc per XI message can be processed.

So if there are more than one idoc in input it will be considered as a single idoc and all control segment are written first followed by data segments

Try doing a intermidiate mapping in XI so that the ABAP mapping is applied on 1 idoc rather than the collection

Regards

Suraj

Former Member
0 Kudos

Hi Suraj,

thanks for your inputs.

Yes i derived the same conclusion too.

It works well for one IDOC but when applied to a IDOC package it messes it up.

but my situation is i should not split the package into individual IDOCS, i should produce a target flat file which has all the idocs that came as a bundle intact. ie even if i do multimapping and split the IDOCs and do the ABAP mapping i still will have to group them back together and create a single flat file with all the IDOC flat structures together.

Is there a simple way to do this?

otherwise im thinking of 2 options:

either use BPM split the package, bundle them back together and send it. I still dont know if there are an technical limitations in BPM which will prevent this, like establishing a correlation.

OR

use a java map to rearrange the target flat file's EDI_DC40 segments.

Former Member
0 Kudos

Hi Sivasakthi,

You better use BPM, and setup a logical reciever/sender point, where you aggregate the incoming IDOCS and sendout the final IDOC..

former_member187339
Active Contributor
0 Kudos

Hii sivashakthi,

I will suggest this:

Since an abap mapping is used, create another Z program. This program's input will the complete XMLized IDoc and output will be a Flat IDoc.

For each input Idoc, this program will call the Idoc-to-Flat ABAP Program.

This way the performance will be increased(since BPM is not used)

Regards

Suraj

Answers (3)

Answers (3)

Former Member
0 Kudos

i tweaked the output file with a java map. thanks for all ur inputs.

Former Member
0 Kudos

Hi Siva,

As an alternative solution you can also configure your ALE to dump the IDOC into a File Port. Then have PI pick it up from the ECC server location and dump the file in the FTP server.

Regards,

Erwin

Former Member
0 Kudos

HI siva,

The How TO Guide you are referring is clearly for one IDOC per XI message.

Please note the following points:

u2022 The IDoc segment structure written to the file is based on the structure of the incoming IDoc.

The IDocs are written out u201Cas isu201D. The segment definitions will not be converted to a release

different from the one of the sender.

u2022 Always the full length of a segment is written out. (I.e. all the fields of one segment result in one

line of your file)

u2022 Only the content of one IDoc per XI message can be processed.

u2022 To keep the original IDoc number (DOCNUM) in the flat file, please uncomment the relevant

lines as marked in the coding.

u2022 No error handling is implemented.

If you want to use a package of IDocs then I feel you should just Import the IDOC in IR and create an ED for the IDoc after changing the Occurance of IDoc node to 0..unbounded and then map accordingly to your File structure using graphical mapping.

Regards,

Rahul