Skip to Content
0
Former Member
Jan 22, 2008 at 09:42 AM

CHECK

17 Views

HI GURUS AGAIN I AM NOT DELETE AND INSERT DATA IN MY TABLE THAT IS CREATED BY ME AS ZEMP. PLZ SEND THE CODES FOR IT WILL WORK RIGHT.

tables: zemp.

DATA: itab like table of zemp with header line.

select-options: s_eno for zemp-eno obligatory,

s_ENAME for zemp-ENAME no intervals obligatory,

s_EADDRE for zemp-EADDRESS no intervals obligatory,

s_ESTATE for zemp-ESTATE no intervals obligatory.

parameters: p1 as checkbox,

p2 as checkbox.

start-of-SELECTION.

if p1 = 'X'.

itab-ENO = s_ENO-low.

itab-ENAME = s_ENAME-LOW.

itab-EADDRESS = s_EADDRE-LOW.

itab-ESTATE = s_ESTATE-LOW.

APPEND ITAB.

IF SY-SUBRC 0.

INSERT zemp from table itab.

WRITE: 'SAVED'.

endif.

ENDIF.

if p2 = 'X'.

SELECT ENO ENAME EADDRESS ESTATE FROM zemp into TABLE ITAB

WHERE ENO = s_ENO AND

ENAME = s_ENAME AND

EADDRESS = s_EADDRE AND

ESTATE = s_ESTATE.

DELETE zemp FROM itab.

IF SY-SUBRC = 0.

WRITE:/ 'DELETED'.

ENDIF.

endif.

plz rply.