cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple IDOC-xml to flat file

Former Member
0 Kudos

Hi Guys,

Can somebody please suggest me how to achieve this.

Basically, I have a requirement in which I have to convert the custom ORDER05 iDoc into a flat file BUT it will contain multiple IDocs

Example

Source (XML) ---> PI ---> Multiple IDOC Flat file

EDI_DC40  5000000000007422540731 3022  ZORDERS05                                                    ORDERS                    

E1EDK01                       50000000000074225400000010000000     1.00000     0030                                    

EDI_DC40  5000000000007422540731 3022  ZORDERS05                                                    ORDERS                    

E1EDK01                       50000000000074225400000010000000     2.00000     0050                                    

EDI_DC40  5000000000007422540731 3022  ZORDERS05                                                    ORDERS                    

E1EDK01                       50000000000074225400000010000000     3.00000     0070       

EDI_DC40  5000000000007422540731 3022  ZORDERS05                                                    ORDERS                    

E1EDK01                       50000000000074225400000010000000     4.00000     0080       

I Know there is a module SAP_XI_IDOC/IDOCXmlToFlatConvertor avaliable in PI 7.11 which convert the IDOC-xml to flat file but I don't know if that can handle the multiple enhanced IDoc.

I am also thinking of ABAP mapping provided by SAP in the How to Guide but I don't think that can handle multiple IDocs either.

so please advice how to get the desired output in SAP PI 7.31.

Regards,

Asif

Accepted Solutions (0)

Answers (2)

Answers (2)

giridhar_vegi
Participant
0 Kudos

Hi Asif ,

          you can do as shaikh said it will work.

Thanks

Giridhar

azharshaikh
Active Contributor
0 Kudos

Hi Asif,

Are you going to write new file per IDOC message groups or using the same file to dump the data...

If you need to write the IDOC in same Output file, you can process single IDOC (Idoc 1 by 1)  in PI and keep writing the converted flat data into the output file in Append mode.

Regards,

Azhar

Former Member
0 Kudos

Hi Azhar,

Thanks for your input but I don't think it will solve my problem because my requirement is that I have to bundle all the idocs in one file and then dump it to the FTP Server and not one by one and in case the connection breaks or file got corrupted during append then I will loose all the data so I don't think this solution will really work.

I think ABAP Mapping will solve this but I am not sure if we can use custom Idoc and whether or not it will write in a sequence mentioned above.

Let me know you have any other solution.

azharshaikh
Active Contributor
0 Kudos

Hello Asif,

I believe, You can change the Signature of our Idoc Structure in MM and OM  to 0..Unbounded. You can handle multiple occurrence of Idoc and map it to your target structure.


Hope it helps.


Regards,

Azhar

Former Member
0 Kudos

Hi Azar,

You can bundle all the idocs in one message by using idoc bundling and use the module SAP_XI_IDOC/IDOCXmlToFlatConvertor  to convert Idoc xml to Idoc flat file.

Please go through the below thread.

http://scn.sap.com/community/pi-and-soa-middleware/blog/2013/04/12/converting-idoc-xml-to-flat-file-...


Regards,

Raju.

Former Member
0 Kudos

Thanks guys I have already done that but my question is that.

Can this module been handle multiple extended/enhanced IDocs because as far as I know this will only hand one iDoc and not multiple as I want the output to be.

EDI_DC40

ED1DK01

EDI_DC40

E1EDK01

EDI_DC40

E1EDK01

Please suggest

engswee
Active Contributor
0 Kudos

Hi Asif

Have you checked out the official documentation for PI 7.31 regarding this module?

Adding IDOCXmlToFlatConvertor in the Module Processor -  Adding Modules to the Module Processor - SA...

There is a note at the end that says:

This module can convert the payload in IDoc XML format containing multiple IDocs to IDoc Flat format, only if the IDoc type and the message type are the same.

This is different from the documentation on PI 7.11 that does not specifically say that.

Adding IDOCXmlToFlatConvertor in the Module Processor - Adding Modules to the Module Processor - SAP...

It's possible that SAP has enhanced the functionality in the new versions.

My suggestion to you is to just test it out if you haven't already. No better around it than a lil trial and error - especially since the documentation says it is supported.

Once you have tested it and if you have further issues, then you can open a thread providing further details of any errors you encountered.

Rgds

Eng Swee

Former Member
0 Kudos

Thanks Eng,

I will try and let you know but I am wondering is it possible to have your direct email address as I really need your help in PO.

Could you please contact me on muiqbal at hotmail dot co dot uk

Many Thanks

engswee
Active Contributor
0 Kudos

I've moved my reply so that it's not directly under yours so that you can remove your email address.

Hi Asif

Please note that according to item 6 of the , posting of private information is discouraged (other than in the user profile.)

Regarding your request, it would better if you post any queries you have directly in the forum. This way it is accessible to all members of the forum who can provide you assistance. Not everybody is online at the forum all the time, so it is in your own best interest to have your queries available publicly.

Rgds

Eng Swee

Former Member
0 Kudos

Hi Eng,

I have got time and now I have configured the bean but it is not generating the correct output for also EDI_DC40 is missing.

Here is the Output generated by the IDoc Bean without EDI_DC40

          017000000000000000046C 012   /AFS/ORDERS05                 ZFORJPORD5                    ORDERS                        NEW   E      ORDERSSAPDPO    LS  SAPPO                                                                                                SAPPCT    LS  1                                                                                                    20150310082843         

                                                                                                                        

          017000000000000000046C 012   /AFS/ORDERS05                 ZFORJPORD5                    ORDERS                        NEW   E      ORDERSSAPDPO    LS  SAPPO                                                                                                SAPPCT    LS  1                                                                                                    20150310082843              

Also some additional information has been added

E2EDK01005                    017000000000000000000000100000001000                                                                                                                                                                                                                                                                                                                                                                

Z2JPK01000                   017000000000000000000000200000102  PNAXORD4901810000005-08729-20150131124530865

Z2JPK02000                    017000000000000000000000300000102001NAXORD4901810000005-08729-20150131124530865  

Can somebody please suggest how to get the following output

EDI_DC40  017000000000000000046C 012   /AFS/ORDERS05                 ZFORJPORD5                    ORDERS                        NEW   E      ORDERSSEEBURGER LS  SEEBURGER                                                                                            SAPPCT    LS  1                                                                                                    20150310075121                                                                                                                                  

E2EDK01005                                                     000                                                                                                                                                                                                                                                                                                                                                                

Z1JPK01                                                          PNAEXORD4901810000005-08729-20150131124530865

Z1JPK02                                                        001NAEXORD4901810000005-08729-20150131124530865              

I have also attached the file.

Regards,

Asif