cancel
Showing results for 
Search instead for 
Did you mean: 

IDOC to flat file and vice versa

former_member296836
Participant
0 Kudos

Dear community,

we should send IDOCs to flat files and read plain files and map them to IDOCs.

Is there any comfortable way to do this without doing a huge content conversion for

IDOCs? Exist a SAP standard for such process?

We receive the IDOC as normal IDOC. Would it be more easy to save the IDOCs

directly as flat file on ERP file system??

System PI 7.11

IDOCS: WHSCON, WHSORD and WMMBXY

Regards

Chris

Edited by: Christian Riekenberg on Feb 1, 2012 2:41 PM

Accepted Solutions (1)

Accepted Solutions (1)

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

there is even a blog from Bill about this:

http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/13743

+ remember that only from 7.31 you can create multiple IDOCs in one flat file (and the other way round)

till 7.31 you can only work on single IDOC basis

Regards,

Michal Krawczyk

former_member296836
Participant
0 Kudos

Thanks to all. The module looks as a solution. I will check.

Former Member
0 Kudos

There are many beans provided eg XMLAnonymizerBean, which you can use to convert an idoc to flat file without using File coontent conversion.

here you can directly give field seperator which you want to use in your flat file.

thanks

Shefali S

Former Member
0 Kudos

Hey folks!

We have a PI 7.31 SPS5 Java-only installation here and are using the module IDOCFlatToXmlConvertor. For single IDocs with one line for the EDC_DC40 header and the others for the IDoc payload the conversion works. But when we want to process multiple IDocs from the same type within one file, we see this error in the log:

Module Exception 'com.sap.aii.af.idoc.exception.IDOCModuleException: No data segments for DOCNUM = ' found, cause: <null>

Are there any requirements how the multiple IDocs have to be structured within the file?

Best regards

Heinrich

Update:

I found out that the module wants each record to contain the corresponding DOCNUM to find the matching records. The non-SAP sender system normally does not set this value. Is there a way to "convince" the module to convert the IDocs nevertheless?

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

If the target format is the flat idoc format then the best scenario is to save the idoc from the ECC system as flat and then transfer the file as a normal file-to-file pattern.

In this case the return flow flat idoc inbound to the ECC would be a bit more complex, but if you don't need any changes in the idoc then you can also do file to file and then use startrfc (if that's still available) [http://www.easymarketplace.de/startrfc.php]

If however the target format is a different file you then need the xml idoc with mapping and file content conversion and vice-versa.

Regards,

Horia

Shabarish_Nair
Active Contributor
0 Kudos