09-14-2010 9:27 AM
Hi Experts,
In the user exit 'Exit_sapllmde_006' of l_idoc_input_wmmbxy am using function module WFMC_MESSAGE_SINGLE for triggering orders05 idoc. The function module l_idoc_input_wmmbxy updates the table EKBE. But this update takes place only after the complete execution of the function module l_idoc_input_wmmbxy . In the user exit of orders 'Exit_sapleinm_002' am fetching value from ekbe table and populating. But since this table is getting updated later only this segments filled by fetching value from ekbe table are empty.
I tried using commit work and wait. But it didnt work. Tried copying WFMC_MESSAGE_SINGLE to Zfunction module and calling that in update task but this is also not working.
Is there any way to make the table get updated before calling the function module for triggering orders.
Regards
Sridevi S
09-14-2010 9:37 AM
try Calling the function module DB_COMMIT
if it is critical u can try adding some loop or delay to see if it is getting commited after few seconds.
09-14-2010 9:40 AM
Hi,
I am not sure if this would be the only way to achieve your purpose.
But what you can do is, write a program which in turn will call the funciton module WFMC_MESSAGE_SINGLE to trigger the
orders.
And in the user exit, call the program, passing it the required parameters(to be passed to FM ) and schedule to be triggered after,
say, two or five minutes. So when the program triggers database tables would have already been updated for you to fetch the
data.Please dont forget to pass the end time for the program, else it will get scheduled for that perticular time, daily.
Hope this helps.
Regards,
Sagar
09-14-2010 10:10 AM
Hi sagar,
Can u tell me how to schedule the FM to trigger after 2 or 5 minutes.
The table EKBE is getting updated only after the completion of l_idoc_input_wmmbxy. But am calling the fucntion module for triggering the orders05 idoc in the user exit of l_idoc_input_wmmbxy.
Regards
Sridevi S
09-14-2010 10:14 AM
Hi Sridevi...
I checked the flow of the program...the flow is like this
L_IDOC_INPUT_WMMBXY->PERFORM WMMBID01_VERARBEITEN USING IDOC_NUMMER->MB_CREATE_GOODS_MOVEMENT->Exit_SAPLLMDE_006
I guess the EKBE update is happening in the function module MB_CREATE_GOODS_MOVEMENT(Correct me if am wrong)..if that is the case then you cannot put an explicit commit in the user exit cause then you would loose the whole concept of SAP LUW...
My suggestion would be to use a perform routine on commit..
PERFORM WFMC_MESSAGE_SINGLE ON COMMIT and within this you can call the funtion module WFMC_MESSAGE_SINGLE...My guess is since the MB_CREATE_GOODS_MOVEMENT would commit first your ORDERS IDoc exit should be able to read the data from EKBE...
Furthermore, your update task funda might not work here becuase all the MB update function modules are normal function modules and the moment you called WFMC_MESSAGE_SINGLE in update task, a nes update session would be created..you would not have a control on when this update session is executed and hence you may or may not find the data in EKBE...
Hope this helps.....
Regards,
Sitakant...
Edited by: Sitakant Tripathy on Sep 14, 2010 11:15 AM
09-14-2010 10:23 AM
Hi,
You are using the correct enhancement for For FOLLOW-UP actions. But you may not get EKBE data in these actions. What kind of data is required from EKBE for further processing ? Can X_EMKPF & X_IMESEG be used as alternate source of data ?
Regards
Vinod
09-14-2010 10:47 AM
hi vinod,
since am calling wfmc_message_single for triggering orders05 idoc in that exit i can pass only nast entries. There is no way to pass X_EMKPF & X_IMESEG values. I want this function moudle to be called after the updation of ekbe table. how to do this..?
regards
Sridevi S
09-14-2010 10:48 AM
Hi Sridevi,
Did u try what I suggested ...would like to know whether it did work or not ..
Regards,
Sitakant....
09-14-2010 10:59 AM
Hi sitakant,
Am trying what u have mentioned. am facing some problems as am coding this perform inside an include. Perform is showing error when used with syntax perform nast_update using p_valu on commit.
regards
Sridevi S
09-14-2010 11:38 AM
Hi Sridevi,
I hope you are creating a new include for this perform routine...
Regards,
Sitakant
09-14-2010 11:07 AM
Hi,
Make use of badi MB_DOCUMENT_BADI to call your Fm.
Use method MB_DOCUMENT_UPDATE. This method will be called in update task.
But make sure that your are not using an COMMIT statement in this method else it would lead to a dump.
Another way is to trigger a workflow after the event GoodsMovement.assigned of business object BUS2017 (Goods Movement).
In this workflow you can call your function modue.
Regards,
Ankur Parab