‎2008 Nov 26 12:56 AM
Hello,
I have created a function module (Z_FIRST) that read JIT Tables and update a Ztable with some flags. The same function module is also calling BAPI for goods movement.
I am calling the above function module (Z_FIRST) in another function module (Z_SECOND) with IN UPDATE TASK option. I have given the correct input parameters required by Z_FIRST to update the enteries in ZTABLE but I did not see any update in ZTABLE. Neither the goods movement happened. I am not sure where I am wrong.
Please see the sample code below for more information:
The function module Z_FIRST is called in Z_SECOND as written below:
CALL FUNCTION 'Z_FIRST' IN UPDATE TASK
EXPORTING
PRODN = V_JIT
EXTST = V_STATUS
The code in Z_FIRST is taking the values of V_JIT and V_STATUS and reading some database tables and ZTABLE. Based on some conditions it update some flags in ZTABLE.
If I run the function module Z_FIRST without giving IN UPDATE TASK option, it successfully update ZTABLE and does the Goods movement. But it is not doing the same in IN UPDATE TASK.
Could you please let me know where I am doing wrong.
Thanks
‎2008 Nov 26 1:41 AM
some things you can check
1- is there a commit work in your first FM? that only will trigger the FM in update task.
2- Are you passing all the required parameters to the 2nd FM? are those 2 parameters you passing enough to find the entry in Z table and update that.
‎2008 Nov 26 2:47 AM
As MxG said, check the existence of "COMMIT WORK" first.
Without "IN UPDATE TASK", commit will be automatically performed if there is a dialog switch;
But with "IN UPDATE TASK", commit will ONLY be performed when statement "COMMIT WORK".
‎2008 Nov 26 6:00 AM
You have to use explicit COMMIT WORK. after calling the such FM to complete SAP LUW.
‎2008 Nov 26 7:07 AM
Hi ,
Commit work is required to be done when ever any update task is done to database .
You need to write "COMMIT WORK" at end of FM .
After COMMIT WORK Dialog Process is free to proceed with next user input .Final Part of SAP UW is done .
Your parameters must be correct otherwise without using "COMMIT WORK" records could not have been updated
‎2009 Jun 16 4:47 PM