Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Generating Flat File from Idoc

Former Member
0 Kudos

Hi,

I would like to know is there any way to generate flat file from Idoc.

Thanks

Kishore

1 ACCEPTED SOLUTION

christian_wohlfahrt
Active Contributor
0 Kudos

Hi Kishore!

It might not be as flat as you expect (file structure looks more like IDOC structure, but it's a text file):

In partner profiles (WE20) in customizing of outbound message, tab outbound options you can define a receiver port. This can not only be a system, but several different types. Hit F4, in second tab you can define a file output.

Regards,

Christian

3 REPLIES 3

christian_wohlfahrt
Active Contributor
0 Kudos

Hi Kishore!

It might not be as flat as you expect (file structure looks more like IDOC structure, but it's a text file):

In partner profiles (WE20) in customizing of outbound message, tab outbound options you can define a receiver port. This can not only be a system, but several different types. Hit F4, in second tab you can define a file output.

Regards,

Christian

Former Member
0 Kudos

Hi,

The prolem with this is that IDoc have a structured format (i.e. header and segments, very much a tree-like structure). Creating a flat file from such a structure is not an easy task, because this kind of structure is difficult to re-create in, say, an ASCII file. So, the "native" file format of an IDoc is a structured text file, as well. It has several lines (roughly speaking, each line corresponds to a segment).

My preferred file format for IDocs is, of course, XML. With XML you are able to map the tree-like segment structure of IDocs with great ease. You can have a look at the various XML formats under http://ifr.sap.com.

Also, you can transform XML documents easily with stylesheets and so on.

Regards, Joerg

Former Member
0 Kudos

Hi Kishore,

I dont know if you see my answer to the same ask from 04/18.

You can send the IDoc to a flat file, creating a PORT of the file type. If you send the IDoc in this way, you have the complete idoc in the strcutures text file.

If you have to create a flat file using the data into the IDoc, but not with idoc format, you can use a type ABAP port. In this port, you have to put a function module name that process the idoc and create the flat file (and put it in the application server). Use the function module OWN_FUNCTION as example to create your own FM.

Regards

PabloX