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 Selection Screen Values when you HIT the back button from the Output

Former Member
0 Kudos

Hi All,

How to clear the selection screen values, when the user HITS the back button from the output.

Please let me know the solution ASAP.

Appreciate if anyone of you guys can help me out.

Thanks in advance.

Cheers!

Suresh G

7 REPLIES 7

Former Member
0 Kudos

You should be able to do this at the AT SELECTION-SCREEN OUTPUT event.

Rob

Former Member

Hi

The data of selection-screen are setted in ABAP MEMORY so you need to clear it:

INITIALIZATION.

FREE MEMORY.

Max

Former Member

Hi,

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

.

Regards,

Gayathri

Former Member
0 Kudos

Hi suresh,

1. Simple.

2. we can use the event SELECTION-SCREEN OUTPUT.

(There we have to mention

all the fields to clear)

(either we can mention individually,

or we may use loop at screen concept also)

3. to get a taste of it,

4. just copy paste in new program.

REPORT abc.

*----


PARAMETERS : a(10) TYPE c .

PARAMETERS : b(20) TYPE c .

*----


START-OF-SELECTION.

WRITE 😕 'amit '.

*----


IMPORTANT.

AT SELECTION-SCREEN OUTPUT.

CLEAR a.

CLEAR b.

regards,

amit m.

0 Kudos

Hi Amit,

If you use the clear statement directly, it doesn't work. Anyways I have solved on my own and thanks alot for your time in replying back for this issue.

Basically we do it in Selection-Screen Output, but we need to capture the Memory ID for the back button using EXPORT MEMORY & later Import the same. Then we can use

Loop at screen.

... Refresh / Clear Selection-screen fields based on whether you use a select-options or parameters.

Once again Thanks alot.

Cheers!

Suresh G

Former Member
0 Kudos

Just have the statement 'FREE MEMORY' as the last statement of your code.

0 Kudos

Srinivas,

'FREE MEMORY' is a obselete statement in Abap OO.

Cheers!

Suresh G