Application Development and Automation 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: 
Read only

Delete entries from database tables using update function module

Former Member
0 Likes
2,319

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
Read only

Former Member
0 Likes
1,191

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
Read only

Former Member
0 Likes
1,191

use Pass by Value .

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

Read only

Former Member
0 Likes
1,192

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 ..........