Skip to Content
author's profile photo Former Member
Former Member

chk for

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 18, 2008 at 06:11 AM

    Hi Jayant,

    The code u wrote is correct.And we have to mention 'X' as capital ok.

    if p1 = 'X'.

    And also before inseting data into ztable we have to modify the internal table.

    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.

    modify itab.

    INSERT zemp from table itab.

    endif.

    Reward points if helpful.

    Kiran Kumar.G.A

    Have a Nice Day..

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 18, 2008 at 06:24 AM

    Hi,

    goto program and goto test and in that debugging.

    other way is after selection u want to debug then give /h in command field and then do debugging.

    and in ur program use capital letters 'X'.

    PLzz reward points if it helps.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.