05-18-2010 10:29 PM
Hi,
I have a scenario in which i have to generate a MBGMCR IDOC whenever a material document is posted ans send this to XI.
Now i have to put a condition to process only IDOCs that have a particular vendor number must be sent out to XI and others have to stop inside the SAP system itself.
I saw that we could use ABAP-PI port to control the IDOC before being sent out. So i added the ABAP-PI port with a FM
ZOWN_FUNCTION which is a copy of OWN_FUNCTION with the following code added in the end.
CALL FUNCTION 'IDOC_INBOUND_ASYNCHRONOUS' DESTINATION 'XIDCLNT100'
TABLES
idoc_control_rec_40 = I_EDIDC
idoc_data_rec_40 = I_EDIDD
But when execute this is get an error,
"IDoc adapter inbound: Sender port is initial"
But i can see that the sender port value in the EDI_DC has a value 'SAPECD'.
I've not had much luck with resolving this error. I feel the error is misleading and the sender port is not really the problem, but im not sure.
Is the approach i'm using right or should i use some other function?
Any suggestions?
05-19-2010 4:11 PM
05-20-2010 7:25 PM
I resolved it myself.
Its the same procedure.
Copy own_function to my fm ZOWN_FUCTION. Call the FM IDOC_INBOUND_ASYNCHRONOUS in destination XI.
I just found that when i call the FM the import parameters are of type EDI_DC40 and EDI_DD40 whereas the type im passing to it is EDIDC and EDIDD. thats why the mismatch.