04-15-2008 8:42 AM
HELLO,
i have to delete the name when i display it will display the name of the and the same i have to delete from table what to write the delete condition.
Also only one name is displaying when i am clicking again in display it not shows other name the same name is repeating, what i have to do in dipslay the next name and so.
please let me know i already tried. it not deleting, the code which i have used is.
&----
*& Report ZGOM1
*&
&----
*&
*&
&----
REPORT ZGOM1.
CALL SCREEN 200.
&----
*& Module USER_COMMAND_0200 INPUT
&----
text
----
MODULE USER_COMMAND_0200 INPUT.
tables : ZPERSONAL.
data : begin of itab occurs 0,
NAME LIKE ZPERSONAL-NAME,
ADDRESS LIKE ZPERSONAL-ADDRESS,
TELNO LIKE ZPERSONAL-TELNO,
MOBILENO LIKE ZPERSONAL-MOBILENO,
COUNTRY LIKE ZPERSONAL-COUNTRY,
end of itab.
case sy-ucomm.
when 'DISP'.
select NAME ADDRESS TELNO MOBILENO COUNTRY FROM ZPERSONAL INTO TABLE ITAB
*
select * FROM ZPERSONAL INTO corresponding fields of ITAB.
loop at itab.
move itab to zpersonal.
endloop.
endselect.
when 'EXIT'.
LEAVE PROGRAM.
when 'CLEAR'.
CLEAR ITAB.
WHEN 'RESET'.
CLEAR ITAB.
WHEN 'DELETE'.
delete FROM ZPERSONAL WHERE NAME = ITAB-NAME.
*
*
ENDCASE.
when 'DISP'.
select NAME ADDRESS TELNO MOBILENO COUNTRY FROM ZPERSONAL INTO TABLE ITAB.
move-corresponding itab to zpersonal.
append itab.
loop at itab.
move-corresponding itab to ZPERSONAL.
endloop.
*endselect.
endcase.
ENDMODULE. " USER_COMMAND_0200 INPUT
&----
*& Module STATUS_0200 OUTPUT
&----
text
----
MODULE STATUS_0200 OUTPUT.
SET PF-STATUS 'xxxxxxxx'.
SET TITLEBAR 'xxx'.
move-corresponding itab to ZPERSONAL.
ENDMODULE. " STATUS_0200 OUTPUT
04-15-2008 8:47 AM
Hi Sujatha,
You seem to check WHEN 'DISP' twice in the same CASE statement. what r u exactly trying to achieve.
Please explain much clearly of what u exactly require.
Reward points if u feel this helps,
Kiran
04-15-2008 8:50 AM
Hi,
Write....
WHEN 'DELETE'.
DELETE ZPERSONAL.
Reward points if useful.....
Regards
AK
04-15-2008 10:36 AM
WHEN 'DELETE'
DELETE ZPERSONAL where name = nam1.
commit work.
Than and only than changes will gets reflected to database.
reward if it helps.