cancel
Showing results for 
Search instead for 
Did you mean: 

Update Function Module Not Working

0 Kudos

Hi,

I have a UPDATE FUNCTION MODULE, where it is triggered while clicking on SAVE button. While entering a value and storing that field as lead value for a record. likewise we can enter many values of type numbers and the latest one entered will be the lead value for that record. But when we are deleting the latest lead value, while debugging i am able to get the next lead. And i can see that value is getting stored in INTERNAL TABLE, but while updating database table with the statement

UPDATE (Table name)
SET zzlead_app_npo = lw_lead_base_data-external_id
zzlead_npi_desc = lv_zzlead_npi_desc
WHERE guid = lw_item_d_01-guid.

Sometimes it is failing, there is percentage of around 30% success and 70% failure. After the update i can see the sy-subrc is 0, calling the update function module like

*****Updating the record**************

CALL FUNCTION 'UPDATE FM NAME' IN UPDATE TASK
EXPORTING
is_item_d_01 = lw_item_d_01
is_item_d_02 = lw_item_d_02
iv_action = 'U'.

*******Deleting the record************

CALL FUNCTION 'UPDATE FM NAME' IN UPDATE TASK

EXPORTING
is_item_d_01 = lw_item_d_01
is_item_d_02 = lw_item_d_02
iv_action = 'D'.

Have stuck with the issue for quite a long time, help needed.

Sandra_Rossi
Active Contributor

You update "is failing [...] 70% failure" but how can we help you, it's a problem of logic in your whole program, the record has not been written yet. To understand better what's the real logic, I suggest that you use an ABAP trace with "no aggregation" mode (transaction code SAT) or an SQL trace with "abap stack" option (transaction code ST05).

You say "after the update [...] sy-subrc = 0", if you're talking of this value after "call function ... in update task" then it's useless checking that because the documentation says "The system field sy-subrc is undefined after the statement CALL FUNCTION ... IN UPDATE TASK is executed." The update function modules are effectively called at the next COMMIT WORK. If you want to know whether the call is successful, just check in transaction SM13 if there are failed update tasks or not.

Accepted Solutions (0)

Answers (0)