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: 

SAVE, EDIT, DEL in Table Control

Former Member
0 Kudos

Can anyone give me example with code for SAVE ,Edit ,and Delete for table control.

I have seen ABAPDOCU example Except that Just i need SAVE, EDIT , DELETE.

Sample Source code , please.

3 REPLIES 3

amit_khare
Active Contributor
0 Kudos

Refer the links -

Regards,

Amit

Former Member
0 Kudos

hi,

try like this

u need to write this in user_command_1000 module of PAI.

CASE sy-ucomm.

WHEN 'SAVE'.

t_emp-empcod = empcod.

t_emp-empnam = empnam.

INSERT INTO zemp_d VALUES t_emp.

MESSAGE s002(zmesg). " Successfully saved

WHEN 'CHANGE'.

t_emp-empcod = empcod.

t_emp-empnam = empnam.

MODIFY zemp_d FROM t_emp.

MESSAGE s006(zmesg). "Successfully changed

WHEN 'DELETE'.

t_emp-empcod = empcod.

t_emp-empnam = empnam.

DELETE FROM zemp_d WHERE empcod = t_emp-empcod.

MESSAGE s007(zmesg). "Successfully deleted

ENDCASE.

here is my data declaration...(in top module)

TABLES:zemp_d.

TYPES : BEGIN OF ty_emp,

empcod TYPE zemp_d-empcod,

empnam TYPE zemp_d-empnam,

END OF ty_emp.

DATA : t_emp TYPE STANDARD TABLE OF ty_emp WITH HEADER LINE INITIAL SIZE 1.

DATA : empcod TYPE zemp_d-empcod,

empnam TYPE zemp_d-empnam.

reward me back if u have query

Former Member
0 Kudos

thanks ,

point has been givne