2007 Feb 07 3:37 PM
Hi All,
I am trying to update my custom tables using Update Task function module.
FM update task
Insert table A
Insert table B
endFM.
In main program.
Call FM in Update Task.
If sy-subrc = 0.
Commit work.
Endif.
To this FM if I pass a record which already exist in table A. Still the system sets Sy-subrc = 0 after execution of FM. Because of this I am unable to identify whether update is successful or not.
Please help.
2007 Feb 07 3:55 PM
Hi Vimal,
Just specifying IN UPDATE TASK will not return any return code to your program as this FM will not run in the same LUW as your program does.
Regards,
John.
2007 Feb 07 3:55 PM
Hi Vimal,
Just specifying IN UPDATE TASK will not return any return code to your program as this FM will not run in the same LUW as your program does.
Regards,
John.
2007 Feb 07 4:01 PM
Vimal,
if the INSERT tries to insert an existing key, check for sy-subrc = 4 in the function module, raise an error (duplicate key) and the iupdate process is aborted - you will get express message.
It might be better to
first lock the table
then check the existence of key
then call update function (update process will unlock).
Regards,
Clémens
2007 Feb 07 4:09 PM
Hi Clémens,
Thanks for the reply. Actually I am going to run this program in batch mode. Will this cause any issue if I raise an exception & if I get express message. Will the processing will be normal for other records.
Thanks,
Vimal