‎2009 Jul 20 12:13 PM
Hi,
i am created a Z program with 20 fields as selection screen. after execution of the program i am getting the output. if i press F3 (Back) all the selection screen values exist. I want to clear the selection screen values once the output is generated and if i press F3.
Thanks in advance.
Regards,
Bala Subramanyam Reddy K
‎2009 Jul 20 12:15 PM
Hi,
Write code to clear your selections fields in the event at selection-screen output.
Sample code
At selection-screen output.
clear : p_matnr,
s_ebeln.
At selection-screen output event is similar to the PBO in module pool programming. It will be called always before the selection screen is called. So when you click on the back button, this event is called and and all you selection fields are cleared.
Hope this helps.
Regards,
Sachin
‎2009 Jul 20 12:16 PM
Hi,
In the Event INITIALIZATION....clear all the selection screen variables....
Regards,
Vimal.
‎2009 Jul 20 12:25 PM
Hi
you have to clear the parameters and select options in the event
AT SELECTION-SCREEN OUTPUT,
Please see the sample code below.
REPORT z709_test.
*
PARAMETERS: name(10) type c ,
add(20) type C .
INITIALIZATION .
AT SELECTION-SCREEN output.
clear : name ,add.
START-OF-SELECTION.
write: name, add.
.
Hope it will help.
Thanks,
Deepanker Dwivedi
‎2009 Jul 20 12:35 PM
hi all,
thanks for your response.
but, already some validations are going in AT SELECTION-SCREEN OUTPUT.
whenever i press enter all the values are cleared. with out exectuing...
so my problem is.... .once the output is generated then if i press F3 then only values should be clear.
thanks
balu
‎2009 Jul 20 12:46 PM
Hello,
Initilization event executes only once where program is executed.
AT SELECTION-SCREEN output is the correct event to clear all the values.
Thanks,
Anand.
‎2009 Jul 20 12:51 PM
Hello Redy,
Check the sy-ucomm value when ur pressing BACK button of the list. Now clear all the selection-screen parameters and select-options in AT SELECTION_SCREEN OUTPUT EVENT only if sy-ucomm matches the sy-ucomm of F3. else go ahead with your validations.
Regards,
Shafivullah Mohammad
‎2009 Jul 20 12:57 PM
>
> Hello,
> Initilization event executes only once where program is executed.
> AT SELECTION-SCREEN output is the correct event to clear all the values.
quote}
@Anand:
please write your code in at selection screen output and press enter and then see the output . and what is link of initialization with at-selection-screen output?
@reddy:
i have tried this and telling you the solution. go with it and let me know what problem you are facing
by the way what is your next screen of the selection screen? are you calling a screen or are you using some FM only to display ALV or what?
‎2009 Jul 20 12:17 PM
Hi,
Clear all the fields in AT SELECTION-SCREEN OUTPUT event.
But you need to set a flag variable during this process and clear the fields
like
at selection-screen output.
if sy-ucomm = 'ONLI'.
clear fields
endif.
Regards
Sarves
‎2009 Jul 20 12:18 PM
Hi,
Write your code in the AT SELECTION-SCREEN OUTPUT. event. Clear the selection screen variables in this event.
‎2009 Jul 20 12:29 PM
HI,
You could clear all your fields in AT SELECTION-SCREEN OUTPUT event.
regards,
Nitin
‎2009 Jul 20 12:41 PM
Do not do it it at selection screen output.
Because: lets say u fill the values and press enter . first at-selection screen will be triggered and then at selection-screen output will be triggered which will clear the fields.
the better method is.
lets say you are getting ALV output in the next scrren. so u must have called a FM to show the ALV. after the FM call. u clear the selection screen variables.
like
call function 'reuse_alv_grid_display'.
............
.......
.........
...................
" and now call a perform for clear_all.
perform sub_clear_all.
.
form sub_clear_all.
clear: p_abc, p_def, s_abc,s_def. .....
endform.so when you press back the FM will exit and the next perform for clear all will be called and it will clear all the screen elements.
‎2009 Jul 20 12:39 PM
Hi
Try this,,,
set a flag after execute and thn check it with back.
Case sy-ucomm.
when execute.
flag = 'X'.
when back.
if flag = 'X'.
clear variables.
clear flag.
endif.
endcase.
you can also write the same code in AT SELECTION-SCREEN OUTPUT
if flag = 'X'.
clear variables.
clear flag.
endif.
this should wrk,
Hope this helps.
‎2009 Jul 20 12:47 PM
HI all,
i am trying all the solutionss.. but nothing is working.
so, please test from your end and give the solution.
enter the values and press enter and execute and press F3. if it is working for you then give the solutions.
thanks for all
‎2009 Jul 20 12:47 PM
Hi,
use a flag for this purpose. set the flag at END-OF-SELECTION. and in the event AT SELECTION-SCREEN OUTPUT clear the screen element if the flag is set.
thanks,
Renjith.
Edited by: Renjith Munnilath on Jul 20, 2009 1:50 PM
‎2009 Jul 20 1:03 PM
PARAMETERS : P_MATNR TYPE MATNR.
AT SELECTION-SCREEN OUTPUT.
CLEAR : P_MATNR.
START-OF-SELECTION.
WRITE : P_MATNR.
try with this program and give me solution if it is working for anybody.
enter the material value and press enter and press execute and press F3. here the value should be clear in the selection screen when i press F3.
‎2009 Jul 20 1:11 PM
Hi ..
Put these line of code at the end of your report
FIELD-SYMBOLS : <fs> .
ASSIGN ('(RSDBRUNT)MEMKEY-INT_MODE') TO <fs> .
IF sy-subrc = 0 .
<FS> = '01' .
ENDIF.remember these should be the last line to be executed in report . for example if you have ALV report the put this after the FM call..
PARAMETERS : p_matnr TYPE matnr.
START-OF-SELECTION.
WRITE : p_matnr.
FIELD-SYMBOLS : <fs> .
ASSIGN ('(RSDBRUNT)MEMKEY-INT_MODE') TO <fs> .
IF sy-subrc = 0 .
<fs> = '01' .
ENDIF.
‎2009 Jul 20 1:17 PM
>
> PARAMETERS : P_MATNR TYPE MATNR.
>
> AT SELECTION-SCREEN OUTPUT.
> CLEAR : P_MATNR.
>
> START-OF-SELECTION.
>
> WRITE : P_MATNR.
>
> try with this program and give me solution if it is working for anybody.
>
> enter the material value and press enter and press execute and press F3. here the value should be clear in the selection screen when i press F3.
this will NOT solve your problem as i am 100% sure that your p_matnr will be cleared before you press execute.
‎2009 Jul 20 1:23 PM
Hi Bala ,
You must Use Selection-Screen Output Event to clear the Parameters you want to free when you return back to your selection screen.
Apart from this You must also Specify the event End-Of-Selction in your Program.
If this doesnot work ,
Check if you have assigned any Memory ID to your Selction Screen Parameter ,
In that case free the Memory Id ,at the AT SELECTION-SCREEN OUTPUT event.
Another simple solution is to set the Default values for each of the parametres and select options as space.
Regards
Rajesh Kumar.
‎2009 Jul 20 3:32 PM
Assuming you don't want to create a routine to clear your selection screen, here is an alternative solution that will work.
First, make sure you have a transaction code for your report. Next, create a new GUI status and assign a custom function code to the Back button. Now you can catch the command within the AT USER-COMMAND event. Here, you simply issue the command LEAVE TO TRANSACTION <report transaction code>.
Because this command deletes the current internal session from the stack and creates a new one, the current program data including the selection screen input fields will be initialised.
Obviously, this doesn't apply to any selection screen fields you are defaulting (e.g. with DEFAULT or GET/SET parameter Id) but I am assuming you would want to keep any default values, otherwise why would you set them in the first place?
‎2016 Feb 03 1:34 PM
‎2009 Jul 21 3:18 AM
Hi Reddy,
Here is the solution.
<li><font color=red>Note: Do not use BACK function code to Back button and same way to exit, cancel buttons also. Do not use standard function codes to those 3 buttons.</font>
I hope that it solves your problem.
Thanks
Venkat.O
REPORT ztest_notepad.
DATA:ucomm TYPE sy-ucomm.
PARAMETERS : p_date TYPE datum.
"AT SELECTION-SCREEN OUTPUT
AT SELECTION-SCREEN OUTPUT.
IMPORT ucomm FROM MEMORY ID 'VENK1'. "Import the Function code stored in the memory id VENK1
CASE ucomm.
WHEN 'BACK1'.
CLEAR p_date.
ENDCASE.
"START-OF-SELECTION
START-OF-SELECTION.
SET PF-STATUS 'STATUS'. "Set your own pf-status STATUS. Give Function codes to BACK, EXIT, CANCEL.
WRITE p_date.
"AT USER-COMMAND
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'BACK1'.
ucomm = sy-ucomm.
EXPORT ucomm TO MEMORY ID 'VENK1'. "Export Function code BACK to memory id VENK1
LEAVE SCREEN.
ENDCASE.
‎2009 Oct 22 8:21 AM
‎2009 Oct 22 8:21 AM