Skip to Content
0
Former Member
Jan 18, 2008 at 06:05 AM

chk for

16 Views

hi gurus

i have a problem in this code yhat iam not delete and insert the data in

my table plz chk the code and give info abt it.

also tell me how to debug a report or codes by step by step.

codes:

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.