‎2005 Dec 30 5:06 AM
Hi all,
When we execute a program and again come back to the selection screen the values which we input should disappear. That is the select option or parameter should be empty again.
points will be rewarded.
Thanks.
‎2005 Dec 30 5:09 AM
CLear the select options and parameters in the Intialization event of the report. This will work like a charm.
Regards,
Ankur Bhandari
‎2005 Dec 30 5:13 AM
Hi,
Clear the parameters and select options in at selection screen. and exit.
some thing like this..
at selection-screen.
clear p_matnr.
clear s_vbeln[].
if p_matnr is intitial and s_vbeln[] is initial.
exit.
endif.
‎2005 Dec 30 5:17 AM
Here is one way, it requires you to move the value of the parameter to another field.
report zrich_0003.
tables sscrfields.
parameters: p_check type c.
data: x_check type c.
at selection-screen.
if sscrfields-ucomm eq 'ONLI'.
move p_check to x_check.
clear p_check.
endif.
start-of-selection.
write:/ x_check.
Regards,
Rich Heilman
‎2005 Dec 30 5:19 AM
‎2005 Dec 30 5:41 AM
Try this,
REPORT Z_ABB_1.
SELECTION-SCREEN BEGIN OF BLOCK B1.
PARAMETERS: P_MATNR LIKE MARA-MATNR.
SELECT-OPTIONS: S_DATE FOR SY-DATUM.
SELECTION-SCREEN END OF BLOCK B1.
AT SELECTION-SCREEN.
REFRESH S_DATE[].
clear P_MATNR.
START-OF-SELECTION.
WRITE : P_MATNR ,
S_DATE-LOW,
S_DATE-HIGH.
END-OF-SELECTION.
REFRESH S_DATE[].
clear P_MATNR.
‎2005 Dec 30 5:42 AM
‎2005 Dec 30 5:51 AM
do this.
AT SELECTION-SCREEN output.
clear so_project[] .
clear p_proejct.
‎2005 Dec 30 5:58 AM
All AT SELECTION-SCREEN events will not achieve what is asked here. Remember these AT SELECTION-SCREEN events will trigger even the first time user executes the program and if you are clearing out the parameters in these events, such as in AT SELECTION-SCREEN OUTPUT, then there won't be any values carried to the START-OF-SELECTION.
AT SELECTION-SCREEN OUTPUT is triggered every time the selection screen has to be shown. So if the user enters some values and presses 'ENTER' key, even then the values will be cleared. But if the user enters the values and immediately executes, then this will work. But that is asking too much from the user and it is too difficult to control.
Srinivas
‎2005 Dec 30 6:09 AM
Hi ,
Thanks Srinivas for the information.
I don't know about this.
One possible solution to this can be having a flag in the report i.e.
When the report is executed the flag is set and check the status of the flag in At-selection output and clear the select options and parameters depending upon the value of flag.
i.e.
AT SELECTION-SCREEN output.
IF flag_execute = 1.
clear so_project[] .
clear p_project[] .
flag_execute = 0.
endif.
‎2005 Dec 30 6:13 AM
‎2005 Dec 30 6:24 AM
Yours should work Rich, except for the burden of redundant data declarations. For every field on the selection screen we have to declare an equivalent variable or range and do all the moves. But if this is a feature that has to be there no matter what, then I guess your approach seems to be the most plausible one at this point. Anyone tried using FREE MEMORY at the end of list output in the END-OF-SELECTION and see if this erases the values in the memory?
Srinivas
‎2005 Dec 30 6:26 AM
Richs example works fine, Rich but this one doesnt have any select options. You mind modifying the same.
‎2005 Dec 30 6:27 AM
‎2005 Dec 30 6:27 AM
Hi Asit,
The flag setting doesnt work. cos when the program execution returns it resets the all the flags. So need to go with Rich's example.
Regards,
Ankur Bhandari
‎2005 Dec 30 6:28 AM
To extend Rich's example to select-options you have to use ranges.
ranges: r_matnr for mara-matnr.
at selection-screen.
if sscrfields-ucomm = 'ONLI'.
r_matnr[] = s_matnr[].<-- select-option on the screen
clear: s_matnr, s_matnr[].
endif.
‎2005 Dec 30 6:30 AM
Thanks Rich for trying it out. I am not in front of the system so I was not sure. Never used it for this purpose.
So FREE MEMORY does the trick!!!
Srinivas
‎2005 Dec 30 6:30 AM
All points to Srinivas your solution of freeing memory works. Thanks .
Regards,
Ankur Bhandari