04-13-2006 10:26 AM
In a report, after executing the program, when the back button is pressed, the selction secren should not contain the previous value.
Satis
04-13-2006 10:28 AM
Hello,
Clear all parameters in the Initilization event.
Regards,
Naimesh
04-13-2006 10:29 AM
Refer this thread where the code mentioned below solves the problem.
tables sscrfields.
data temp_fcode type syucomm.
parameters: p_var1 type i.
selection-screen pushbutton /2(10) button1 user-command ABC.
initialization.
button1 = 'Clear'.
at selection-screen output.
check temp_fcode ne space.
clear p_var1.
at selection-screen.
temp_fcode = sscrfields-ucomm.
start-of-selection.
write p_var1
.
04-13-2006 10:30 AM
hi,
Using SET/GET Parameters will stores earlier values should be brought & Display
Thanks & regards
Sreenu P
04-13-2006 10:35 AM
hallo Satis,
that works:
in the exit pai-module after pressing F3:
don't write leave to scrren 0, but
CASE ok_code.
WHEN '&F03'.
SUBMIT reportname VIA SELECTION-SCREEN.
ENDCASE.
if it works for you, it would be nice to give points,
i have none yet...
thanks
Samir
04-13-2006 10:38 AM
Hi,
When you run your report is there any default values.
at the end of your report clear/refresh your selection screen parameters etc.
Regards
vijay
04-13-2006 10:42 AM
Hi
for this note down the pf status of the screen
go to the menu painter and see the fcod for back button
than do the coding as
case sy-ucomm (ok_code)
when 'back'
clear all parameters
04-13-2006 10:46 AM
I checked different things a few times:
that statement definitely works and seems to be the simplest way:
CASE ok_code.
WHEN '&F03'.
SUBMIT reportname VIA SELECTION-SCREEN.
ENDCASE.
after that the selection-screen is initail.
Samir
04-13-2006 11:03 AM
Hi,
Just add <b> FREE MEMORY </b> in initialization instead of clearing each and every parameter on selection-screen. This will clear the contents in the selection screen.
sample code:
REPORT ZTEST499.
tables: mara.
parameters: p_date like sy-datum.
select-options: s_matnr for mara-matnr.
initialization.
free memory.
start-of-selection.
WRITE : 'TEST'.
Regards,
Sailaja.
04-13-2006 11:26 AM
Hi Sathish,
I suppose your requirement is like this:
"you have some fields in the selection screen and you have input some values on it. When an event triggers, you want all the fields to be cleared . This should not be done like CLEAR a,b,c,d."
There is a solution to this .
Just check this code.
parameters: a(10),
b(10).
initialization.
free memory.
at selection-screen.
clear screen.
When execute button in the selection screen is pressed, both the fields will be cleared. This can be extended to any number of fields.
Regards,
SP.
04-13-2006 12:26 PM
Hi Sathish,
1. we have to apply some little logic to do this.
2. we to use the following concepts :
export .. to memory id
imprt .. from memory id
start-of-selection.
at selection-screen output.
3. Just copy paste this in new program.
(it will CLEAR the fields, after execution
and pressing BACK button)
4.
REPORT ZAM_TEMP00 .
*----
parameters : a(10) type c default 'Hi'.
parameters : b(10) type c default 'Friend'.
data : flag type c.
*----
IMPORTANT
start-of-selection.
flag = 'X'.
export flag to memory id 'FLAG'.
write 😕 'hello'.
*----
IMPORTANT.
at selection-screen output.
import flag from memory id 'FLAG'.
if flag = 'X'.
flag = ''.
a = ''.
b = ''.
endif.
flag = ''.
export flag to memory id 'FLAG'.
regards,
amit m.
04-13-2006 8:03 PM
04-13-2006 8:11 PM
Hi,
Just clear the variable in the initilization screen.
Thanks
Vikranth.K
04-13-2006 8:16 PM
Just to clarify, if you execute the program, you go through INITIALIZATION, SELECTION SCREEN and then the program execution and output. But when you come back to selection screen after the output, you will <b>not</b> go through INITIALIZATION event again, unless you go all the way back.