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 entry

Former Member
0 Likes
500

Hi Guys

I want to delete particular entry from ALV output and press save,it should refresh and should update the database table.

How can i proceed on this.

Thanks in advance

4 REPLIES 4
Read only

former_member189059
Active Contributor
0 Likes
469

FORM PAI_INPUT.

OK_CODE = SY-UCOMM.

CASE OK_CODE.

WHEN '&TEM'. " im not sure what the code is for the save button (u can also make your own button in a toolbar)

LOOP AT itab.

MOVE itab TO Zexttable. " zexttable is the external db table in this case

UPDATE Zexttable.

ENDLOOP.

MESSAGE S000(E4) WITH 'Data successfully saved to'

'database table'.

ENDCASE.

ENDFORM. "pai_input

Read only

Former Member
0 Likes
469

Hi,

for this delete all the database table entries first before saving the modified details.

after that use

MODIFY <DBTAB> FROM TABLE ITAB.(HERE ITAB IS UR INTERNAL TABLE WHICH CONTAINES THE DATA U R DISPLAYING IN THE ALV.)

rgds,

bharat.

Read only

Former Member
0 Likes
469

Program <b>BCALV_EDIT_04</b> This report illustrates how to add and remove lines to a table using the ALV Grid Control and how to implement the saving of the new data.

reward points it if it is usefull ..

Girish

Read only

Former Member
0 Likes
469

hi,

check the BLog:for deleting an entry:

/people/srilatha.t/blog/2007/04/13/alv-grid--delete-row-function

Capture the changes into an Internal Table based on the fields and update the Database table with that internal table using Modify/insert or Update