‎2009 Dec 22 11:23 AM
Hi All,
From our OIL application we have a call to the core delivery update FM WS_DELIVERY_UPDATE starting new task.Before the call we are exporting a variable to memory and deep inside the FM we have an oil routine which checks the value of this variable to decide on further flow. But since the FM is called in new task the variable is not available here.
We cannot use the SET GET parameter also as this value can be different for each session.
Can anyone suggest how to set and get the parameter value in this flow.
With regards,
Usha
‎2009 Dec 22 11:44 AM
Set Get parameter is the best option as u can fetch the same variables in different sessions.
Else you can create a table and insert, fetch and delete the variables as and when required.
Regards,
Vimal.
‎2009 Dec 22 11:52 AM
Hi,
You can create variable in the TVARC table update it and use the same. Once you are done using the same delete it.
Regards,
Aditya
‎2009 Dec 22 12:26 PM
Hi,
One options is to create a z table and store the value in it. This value along with other fields can also include the session number etc.. so that if there are multiple users / sessions, then there is no confusion/conflict/wrong data.
Another options is using EXPORT var.... to DATABASE ID. This will store the variable in standard table in some raw format, and then your routine can pick it up using IMPORT var from DATABASE ID.
regards,
amit m.
‎2009 Dec 23 9:01 AM
Hi All,
Thank you for your inputs, I cant create Z tables as it is SAP standard code which needs to be modified, nor use SET/GET.
Is there any way to figure out if a FM was called in new task? Some system variable?
My requirement is FM WS_DELIVERY_UPDATE is called in new task and from here there is a call to a form routine where I need to figure out if the call was from a FM in new task. Is there a way? Please help.
With regards,
Usha
‎2009 Dec 23 9:57 AM
Hi usha,
for this we can use the FM
TH_IN_UPDATE_TASK
If the return value of IN_UPDATE_TASK = 1, it means it is called in update task, other wise not.
regards,
amit m.
Edited by: Amit Mittal on Dec 23, 2009 3:28 PM
‎2009 Dec 24 6:05 AM
Hi Amit,
I tried using the FM TH_IN_UPDATE_TASK but it returns a 0 when checked from a form routine inside WS_DELIVERY_UPDATE which is called in a new task.
Does this FM work only for Update task and not for a FM called in new task? Is yes is there any other function module which will check my case of new task?
With regards,
Usha
‎2009 Dec 24 8:19 AM
Hi again,
To check whether the FM is running in new task or not - This is what I have tried (this may not be the best way), but it works fine.
1. The variable to check inside the called FM is SY-CPROG.
2. This variable will have value.
RS_TESTFRAME_CALL - If being checked from se37
Z / Y program - if called from the original z / y program (WITHOUT new task).
SAPMSSY1 - if being called using NEW TASK (and no debugging)
hope this helps.
Regards,
Amit Mittal.