Application Development and Automation 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: 
Read only

Read flat file into IDOC

Former Member
0 Likes
576

Hello All,

I have a file in application server, now I need to convert this file into IDOC format and save the records in SAP database. Can any one provide us the steps to do this. I would like to know how to create a port for file type to read the flat file.

Thank you,

Hello All,

I have a file in application server, now I need to convert this file into IDOC format and save the records in SAP database. Can any one provide us the steps to do this. I would like to know how to create a port for file type to read the flat file.

Thank you,

2 REPLIES 2
Read only

Former Member
0 Likes
535

Hi,

Create a Z program in se38 and in that you will have to make use of OPEN DATASET, READ DATASET and CLOSE DATASET statements to read the fiel from the application server.

IDOC is just an intermediate document with some structure.

It does not have a capability to read a file by itself.

The file had to be explicitely read from the application server making use of the above statements and then pass the data to the idoc structure.

For more help do F1 on these statements.

Regards,

Ankur Parab

Read only

Former Member
0 Likes
535

steps

1) create a corresponding IDOC for fields of File. (Segments in IDOC consist of fields)

2) create message type

3) assign message type to IDOC type

4) read file an push fields in to corresponding fields of IDOC

5) Caal a inbound FM for IDOC to push data into SAP IDOC databse for future use.

6) if want to process data of this IDOC then u need process code(FM)

now go step by step..u ll find enough material online for above steps

cheers