‎2009 Feb 02 7:46 PM
Hi everyone,
I have written a custom inbound iDoc processing function module where I am using the below function modules to create an operative network and activities within that network.
BAPI_PS_INITIALIZATION
BAPI_BUS2002_CREATE
BAPI_TRANSACTION_COMMIT
BAPI_NETWORK_MAINTAIN
After the last function module call I am doing COMMIT WORK AND WAIT and then BAPI_TRANSACTION_COMMIT and then executing another function module BAPI_NETWORK_COMP_ADD to create article components within the operative network activities. But this function module is not executing successfully and the e_message_table gives error that the activities does not exit.
The strange thing is that when I execute only BAPI_NETWORK_COMP_ADD in a separate test program with the same parameters hardcoded, it executes successfully.
I also tried the variations like STARTING NEW TASK and IN BACKGROUND TASK but still it is not working.
Can someone let me know if you have experienced this before and any other solutions which I can try?
‎2009 Feb 02 7:58 PM
Hi,
Try using "IN UPDATE TASK". This makes the function (or BAPI in this case) to run when the program is saving the actual data, and judging by the BAPI names, the last BAPI is changing the object created in the second BAPI.
Guy.
‎2009 Feb 02 8:12 PM
Thanks. I tried that now but it is giving me a short dump with message:
Non-update function module called for update.
Probably because this is a non update function module but I cannot turn it to an Update FM because I need to provide the exporting parameters since it is an iDoc posting FM.
Any other ideas?
‎2009 Feb 02 10:00 PM
I solved the problem by myself.
For those who are still looking for the solution of this problem - refer to note 672750. As per this note you need to do some initialization. So just put a statement before BAPI_NETWORK_COMP_ADD call:
CALL FUNCTION 'CO_ZF_DATA_RESET_COMPLETE'.
and the problem will be solved.