Application Development and Automation 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: 
Read only

clear after save and modify

Former Member
0 Likes
791

hi sap,

i have screen with 6fields so when i save the record is been saved but after the save i want the screen to be cleared. how can i clear it?

2 when i save the new record its been saved but when i modify the record the record is been modified but i would like to give the apropriate message so i have given the logic but its not working whats worng with my logic can you please correct it?

FORM saverecord .

TABLES : zt024.

DATA: i_zt024 TYPE TABLE OF zt024.

DATA: wa_zt024 LIKE LINE OF i_zt024.

SELECT SINGLE * FROM zt024 INTO wa_zt024 WHERE ekgrp = zt024-ekgrp

AND eknam = zt024-eknam

AND ektel = zt024-ektel

AND telfx = zt024-telfx.

IF sy-subrc = 0.

MESSAGE e003(z001).

ELSE.

MOVE : zt024-ekgrp TO wa_zt024-ekgrp,

zt024-eknam TO wa_zt024-eknam,

zt024-ektel TO wa_zt024-ektel,

zt024-telfx TO wa_zt024-telfx,

zt024-ldest TO wa_zt024-ldest,

zt024-smtp_addr TO wa_zt024-smtp_addr.

IF NOT wa_zt024-ekgrp = zt024-ekgrp.

APPEND wa_zt024 TO i_zt024.

COMMIT WORK.

MESSAGE s000(zfiex).

ELSEIF wa_zt024-ekgrp = zt024-ekgrp..

MODIFY zt024 FROM TABLE i_zt024.

COMMIT WORK.

MESSAGE s007(znew).

ENDIF.

ENDIF.

ENDIF.

3 REPLIES 3
Read only

sridhar_meesala
Active Contributor
0 Likes
678

Hi,

In order to clear the fields after saving write clear statement after the saving has been done.

Like :

CLEAR : zt024-eknam ,

zt024-ektel,

zt024-telfx,

zt024-ldest,

zt024-smtp_addr.

CALL SCREEN 'screen no.'.

Thanks,

Sri.

Read only

sivasatyaprasad_yerra
Product and Topic Expert
Product and Topic Expert
0 Likes
678

IF NOT wa_zt024-ekgrp = zt024-ekgrp.

APPEND wa_zt024 TO i_zt024.

COMMIT WORK.

MESSAGE s000(zfiex).

ELSEIF wa_zt024-ekgrp = zt024-ekgrp..

MODIFY zt024 FROM TABLE i_zt024.

COMMIT WORK.

MESSAGE s007(znew).

I don't see any difference in the IF and ELSEIF block which is marked as green. Both conditions are same..So, always IF block will be executed. ELSEIF block will never be executed. Correct this..

Edited by: Siva Satya Prasad Yerra on Jun 17, 2009 6:46 PM

Read only

Former Member
0 Likes
678

resolved