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: 

Inbound IDOC issues.

Former Member
0 Kudos

We are creating an interface program which will do the following.

1.) Read the file from the legacy system which has legacy data in 'X' file format.

2.) Convert this file format which is in X format to a format 'Y' which is acceptable to WMMBID02 idoc type.

3.) Use this file and call the function module EDI_DATA_INCOMING which will read this file and create the idoc .

Now we are facing issues/roadbolcks on point 2 , on how do we convert our legacy file format to the structure accepted by this IDOC type,

1.)like what will be the format of the new file?

2.)which data will be constant and which data will be mapped to the legacy file viz PO number / quantity.

Any inputs on this. if someone has already implemented something similar , Please let me know

Ankur Bhandari

ankur.bhandari@gmail.com

10 REPLIES 10

Former Member
0 Kudos

Ankur,

I don't think the usage of IDOC's is right in this case. You use IDOCs when you are sending / receiving data between two SAP systems.

In this case you should find the right BAPI and use that to post the data to your application.

Regards,

Ravi

0 Kudos

I am using IDOC so that I am able get all the error handling and workflow capabilities , which other wise I will have to code it. Also I am just modifying the file which the legacy sytem is sending, my program is going to behave like a file processor.

Regards,

Ankur Bhandari

0 Kudos

Ankur,

Your program will have to read the file in whichever format it is. As IDOC will NOT expect a file to be read, your custom program will have to understand the fields and convert that into the IDOC structure which you can find in WE30. You will have to fill in each segment data from the file and create the idoc.

Regards,

Ravi

0 Kudos

Thanks Ravi ,Yes WE30 appears to be helpful, will have to create a structre similar to one in WE30 and then map it I guess and then write the structure into a file .

Am I going the right way ?

Regards,

Ankur Bhandari

0 Kudos

right. What all you have to do is:

Step 1: get the legacy file data in your internal table, do any mapping/conversion if needed.

Step 2: Map the data to the data structures defined for the IDOC segments you see in WE30.

Step 3. Call function IDOC_INBOUND_ASYNCHRONOUS.

Here you need to pass the an internal table with the segment data. Also you need to pass a table with IDoc control records like idoc type, message type etc.

Let me know if you need sample code on this.

0 Kudos

I am not using IDOC_INBOUND_ASYNCHRONOUS.

Still a question ,

How do I create a file which has the same layout/structure as the one for Idoc type WMMBID02 and populate/modify it with my data from legacy file.??Regards,

Ankur Bhandari

0 Kudos

Why do you need to create a file? I don't understand then. What I understand of your requirement is that you are getting an input legacy file from which you need to create inbound idocs in R3. If that's what you want, then you can follow the steps I mentioned. In this case you don't need to create another file, just call the IDOC_INBOUND_ASYNCHRONOUS in the proper way. Do you need to create another file for any other purpose?

Former Member
0 Kudos

hi ankur,

instead of using the FM EDI_DATA_INCOMING, use the application RBDMANI2 which will generate the idocs automatically. it will take the file name as input and create the idocs automatically. that is much helpful than mapping the files.

shylesh

Former Member
0 Kudos

I need to create the file because, I am using a program which already exists and it doesnt uses IDOC_INBOUND_ASYNCHRONOUS. I have to reformat the file so that it has the same layout as the the IDOC type, hence need to create the file.

Ankur Bhandari

ankur.bhandari@gmail.com

0 Kudos

You mean you want to create the file to call the function EDI_DATA_INCOMING after that? In that case you could do without the file creation part as I said.

But if you want to use another program which is already using EDI_DATA_INCOMING, then yes, you have to re-format the file. I don't know any standard way of doing that.