Application Development and Automation 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: 
Read only

clear the selection screen

Former Member
0 Likes
2,309

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
Read only

naimesh_patel
Active Contributor
0 Likes
1,664

Hello,

Clear all parameters in the Initilization event.

Regards,

Naimesh

Read only

0 Likes
1,664

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

.

Read only

Former Member
0 Likes
1,664

hi,

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

Thanks & regards

Sreenu P

Read only

Former Member
0 Likes
1,664

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

Read only

Former Member
0 Likes
1,664

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

Read only

Former Member
0 Likes
1,664

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

Read only

Former Member
0 Likes
1,664

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

Read only

Former Member
0 Likes
1,664

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.

Read only

0 Likes
1,664

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.

Read only

Former Member
0 Likes
1,664

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.

Read only

0 Likes
1,664

Check one.

Read only

Former Member
0 Likes
1,664

Hi,

Just clear the variable in the initilization screen.

Thanks

Vikranth.K

Read only

0 Likes
1,664

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.