Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Delete entries from database tables using update function module

Former Member
0 Kudos

Hi All,

I need to delete entries from database tables using the update function module. I am calling the FM by this method -

CALL FUNCTION 'Z_CL_DELETE' IN UPDATE TASK EXPORTING P1 = L_GUID P2 = TABLENAME.

But the problem with update function modules is that it does not accept reference parameters.

What code shall i write exactly in the FM so that enties get deleted from the databse table TABLENAME for the parameter L_GUID.

Thanks ,

Pradipta.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hello Pradipta Paul,

You can delete the Database table entries using MODIFY keyword also it but first using MODIFY table just get all the data from the database table to the internal table.

After fetching all the data then keep the loop to the internal table.

example

Loop at itab into wa_itab.

Modify database table name from wa_itab index sy-tabix.

endloop.

But ITAB and WA_ITAB structure must be same just like the DATABASE table.

It will work ..........

2 REPLIES 2

former_member188685
Active Contributor
0 Kudos

use Pass by Value .

check the check box against the parameter. you can see two checkboxes optional and passby value.

Former Member
0 Kudos

Hello Pradipta Paul,

You can delete the Database table entries using MODIFY keyword also it but first using MODIFY table just get all the data from the database table to the internal table.

After fetching all the data then keep the loop to the internal table.

example

Loop at itab into wa_itab.

Modify database table name from wa_itab index sy-tabix.

endloop.

But ITAB and WA_ITAB structure must be same just like the DATABASE table.

It will work ..........