Application Development 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: 

clear the selection screen

Former Member
0 Kudos

In a report, after executing the program, when the back button is pressed, the selction secren should not contain the previous value.

Satis

13 REPLIES 13

naimesh_patel
Active Contributor
0 Kudos

Hello,

Clear all parameters in the Initilization event.

Regards,

Naimesh

0 Kudos

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

.

Former Member
0 Kudos

hi,

Using SET/GET Parameters will stores earlier values should be brought & Display

Thanks & regards

Sreenu P

Former Member
0 Kudos

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

former_member188685
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

0 Kudos

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.

Former Member
0 Kudos

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.

0 Kudos

Check one.

Former Member
0 Kudos

Hi,

Just clear the variable in the initilization screen.

Thanks

Vikranth.K

0 Kudos

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.