I am wirtting a FM that will create IDoc of type OILORD (Sales Order).
I am using 'MASTER_IDOC_DISCTRIBUTE' fm to do so.
Now my problem is the IDoc gets created but is in status '30'.
In my partner profile i have ticked on trigger imm.
also when i create a sales order through VA01 it is creating the IDoc and the status of that idoc is '03'. mind you its the same idoc. of type OILORD and even they have used same FM i.e. MASTER_IDOC_DITRIBUTE'
also after calling FM MASTER_IDOC_DITRIBUTE' in my FM i am checking for sy-subrc and when sy-subrc is 0 i call commit work.
I need to create the IDoc ( with status '03') through my FM only..
I am aware that by executing program RSEOUT00 or via Tcode we14 or BD87 I can process the IDoc with status 30 and change the status to 03 .. i did try using submit stmt and submit the idoc number that is returned by the 'communication_idoc_control' to program RSEOUT00 but it didnt help...
in fact when i call the RSEOUT00 program externally and execute it with the idoc number it does change the status of the IDOC from 30 to 03 but if i do the same via my FM it doesnt do any thing ..
so can any one help me with this..