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

Creating Inbound IDoc

Former Member
0 Likes
3,523

Hi All,

I want to know how to create an Inbound IDoc within the same sap system? I want to create it using my own program, no external system.

Message type is wminve and basic type is wmivid01. This is for inventory count purpose.

Will 'idoc_inbound_write_to_db' help? But this is 'Not Released'.

What is the other way? Your help will be highly appreciated.

Thanks,

Sagar

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,053

Hi,

You can use the FM "IDOC_INBOUND_SINGLE" for the same.

For eg:

CALL FUNCTION 'IDOC_INBOUND_SINGLE'

EXPORTING

PI_IDOC_CONTROL_REC_40 = IDOC_HEADER

IMPORTING

PE_IDOC_NUMBER = DOCNUM

TABLES

PT_IDOC_DATA_RECORDS_40 = IDOC_DATA

EXCEPTIONS

IDOC_NOT_SAVED = 1

OTHERS = 2.

You first need to populate the IDOC_DATA & IDOC_HEADER

Thanks,

ajay

9 REPLIES 9
Read only

Former Member
0 Likes
2,053

Thre is some function module,

IDOC_INPUT*POST(I do not have SAP access) u try in se37. u may find it.

Happy coding

//Kiran

Read only

Former Member
0 Likes
2,053

hi,

there is function module IDOC_INPUT_<MSG TYPE>

you can use it.

thanks,

sachin.

Read only

0 Likes
2,053

It doesnt look like for this message type. Is there any other way to post and process inbound IDoc?

Read only

Former Member
0 Likes
2,053

If your objective is to create dummy Idocs and test in dev system, then go for Tcode WE19.

Regards

Meenakshi

Read only

Former Member
0 Likes
2,054

Hi,

You can use the FM "IDOC_INBOUND_SINGLE" for the same.

For eg:

CALL FUNCTION 'IDOC_INBOUND_SINGLE'

EXPORTING

PI_IDOC_CONTROL_REC_40 = IDOC_HEADER

IMPORTING

PE_IDOC_NUMBER = DOCNUM

TABLES

PT_IDOC_DATA_RECORDS_40 = IDOC_DATA

EXCEPTIONS

IDOC_NOT_SAVED = 1

OTHERS = 2.

You first need to populate the IDOC_DATA & IDOC_HEADER

Thanks,

ajay

Read only

0 Likes
2,053

Hi Ajay,

That looks good option. I will test it tomorrow and award points.

Thank you very much,

Sagar

Read only

0 Likes
2,053

Hi ajay,

I am getting 'Function module not allowed: BAPI_IDOC_INPUT1' error (status 51). I created partner profile with BAPI as process code.

What is going wrong? Any Idea?

Edited by: Sagar Lipare on Oct 8, 2008 5:18 AM

Read only

0 Likes
2,053

Hi Ajay,

This works. Its creating and processing IDoc but it doesnt return any errors messages in the processing. Whats the way to get errors also?

Thanks for your help,

Sagar

Read only

0 Likes
2,053

Hi,

Well this is the issue with this FM......I was able to use only two Exception's given in the FM.....

Ajay