08-28-2009 7:29 AM
Hi Experts,
I am doing a normal report, using screen-groups and loop at screen where
the entered data will get updated in Ztable (dbtab).
IF SY-SUBRC EQ 0. "If all my condition satsifies (coding).
insert ZABC.
IF SY-SUBRC = 0.
UPDATE ZXYZ.
IF SY-SUBRC = 0.
MESSAGE : I002 WITH 'RECORD CREATED SUCCESSFULLY''.
ELSE.
MESSAGE : E003 WITH 'SYSTEM ERROR'.
ENDIF.
ENDIF.
ENDIF.
ENDLOOP.
AT SELECTION-SCREEN.
CASE SSCRFIELDS-UCOMM.
WHEN 'FC01'. " Refresh button
CLEAR: FIELD1,FIELD2, FIELD3, FIELD4, FIELD5, FIELD6, FIELD7.
ENDCASE.
Now my user don't want the refresh button, but he wants all the fields get cleared automatically.
After the POP-UP message ' RECORD CREATED'...( which will be displayed in seperate dialogue box )
all the fields should get cleared automatically.
Regards
Karthik
Edited by: Karthik R on Aug 28, 2009 12:00 PM
08-28-2009 7:37 AM
Hi,
I guess this wil work:-
IF SY-SUBRC EQ 0. "If all my condition satsifies (coding).
insert ZABC.
IF SY-SUBRC = 0.
UPDATE ZXYZ.
IF SY-SUBRC = 0.
MESSAGE : I002 WITH 'RECORD CREATED SUCCESSFULLY''.
CLEAR: FIELD1,FIELD2, FIELD3, FIELD4, FIELD5, FIELD6, FIELD7.
ELSE.
MESSAGE : E003 WITH 'SYSTEM ERROR'.
CLEAR: FIELD1,FIELD2, FIELD3, FIELD4, FIELD5, FIELD6, FIELD7.
ENDIF.
ENDIF.
ENDIF.
ENDLOOP.
Regards,
Tarun
08-28-2009 7:33 AM
hi
in the INITIALIZATION event you can clear all the fields or elaborate ur problem a bit more.
08-28-2009 7:37 AM
Hi,
I guess this wil work:-
IF SY-SUBRC EQ 0. "If all my condition satsifies (coding).
insert ZABC.
IF SY-SUBRC = 0.
UPDATE ZXYZ.
IF SY-SUBRC = 0.
MESSAGE : I002 WITH 'RECORD CREATED SUCCESSFULLY''.
CLEAR: FIELD1,FIELD2, FIELD3, FIELD4, FIELD5, FIELD6, FIELD7.
ELSE.
MESSAGE : E003 WITH 'SYSTEM ERROR'.
CLEAR: FIELD1,FIELD2, FIELD3, FIELD4, FIELD5, FIELD6, FIELD7.
ENDIF.
ENDIF.
ENDIF.
ENDLOOP.
Regards,
Tarun
08-28-2009 7:44 AM
Dear Tarun,
I have already tried this , but its not working !!
Please advice me
Karthik
08-28-2009 7:46 AM
08-28-2009 7:49 AM
Hello,
Are these fields you are talking about to be cleared the ones that are part of the selection screen or simply fields that you are using in your report and not the parameters used on the selection screen?
Regards,
Sachin
08-28-2009 8:02 AM
Dear Tharun,
My entire report is on the selection-screen, when user enters one input and press enter
some other fields wll be displayed using AT SELECTION-SCREEN event and I have used
AT SELECTION-SCREEN OUTPUT for * LOOP AT SCREEN* .
There are several input in my selection where the user will enter data manually and when he executes all necessary data
will go and save in my Z table. displaying a pop-up window "SUCCESSFULLY CREATED".
This pop-up window will be displayed in seperate screen, when the pop-up window is
displayed the user will press enter so that it will take to the initial screen (ie my selection-screen )
where all the fields are displayed as same as when they where displayed before the data getting saved to
my Z table.
So the user is asking that when the press enter on the pop-up window and when it takes
to the initial screen all the fields should be cleared.
all this come under Start-of-selection.
I think U are confused by my requirement.
Regards
Karthik
08-28-2009 8:06 AM
Hi,
Try clearing all the screen fields on your selection screen in the event AT SELECTION-SCREEN OUTPUT. Whenever you come back to your selection screen this event is triggered hence all the parameters holding the old values will be cleared whenever the screen is redisplayed.
Regards,
Sachin
08-28-2009 8:13 AM
Hi,
I guess i understood your requirement a little bit.
If i am not wrong, you can follow the below approach to solve your problem.
First of all u r modifying the screen using AT SELECTION-SCREEN OUTPUT.
You are taking all the field values from this selection screen into the START-OF-SELECTION.
Take the value from the screen using the variables and clear the screen fields before moving to START-OF-SELECTION.
AT SELECTION-SCREEN OUTPUT
"<<your code
lv_field1 = field1. "<--assign screen field value to a variable
"move all screen field values
CLEAR : field1, field2. "<--clear all screen fields
START-OF-SELECTION
"<--use all the variables populated above instead of screen fields.
Hope this helps you.
Please let me know if you have any queries.
Thanks & Regards,
Tarun
08-28-2009 7:40 AM
Hi ,
C the Bellow Code.It will solve ur problem.
IF SY-SUBRC EQ 0. "If all my condition satsifies (coding).
insert ZABC.
IF SY-SUBRC = 0.
UPDATE ZXYZ.
IF SY-SUBRC = 0.
MESSAGE : I002 WITH 'RECORD CREATED SUCCESSFULLY''.
CLEAR: FIELD1,FIELD2, FIELD3, FIELD4, FIELD5, FIELD6, FIELD7. " Modified
ELSE.
MESSAGE : E003 WITH 'SYSTEM ERROR'.
ENDIF.
ENDIF.
ENDIF.
ENDLOOP.
Hope ur porblem resolved.
Regards,
Shankar GJ
08-28-2009 7:57 AM
Hi,
If you are talking about the parameters on the selection screen, then you can write the CLEAR statement in the AT SELECTION-SCREEN or AT SELECTION-SCREEN OUTPUT event.
PARAMETERS: var(10) TYPE c.
AT SELECTION-SCREEN.
IF ( var CA sy-abcde ).
MESSAGE 'Only Numerals' TYPE 'I'.
CLEAR var.
ENDIF.