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: 

selection screen events , clear selection option

k_gjergja
Participant
0 Kudos

Hi ,

I have to clear all input fields on selection screen after the transaction been executed. I try to do it on following way .

I set up  at-selection-screen event  with tag gv_run . Gv run is populated with 1 during the selection and indicates that the program has been

already executed and so when after execution flow comes again to at-selection-screen event and gv run = 1.  s_bname should be  refreshed and

screen displayed without values in input fields;

Problem is when  the program flow  comes second time at at-selection-screen event gv_run is not any more 1 it is 0. and refresh is not done .

I cannot figure where that value has been changed . In debugger i cannot find it because the program jumps straight to at-sel-screen event and

the values is already gone

Please advice

Chris

INITIALIZATION

*clear variables ( not screen fields.)

AT SELECTION-SCREEN output.

   if  gv_run = 1.
     refresh s_bname.
    
gv_run = 0.
     endif.



START-OF-SELECTION.
 
gv_run = 1.

2 REPLIES 2

Former Member
0 Kudos

Since its a global variable it resets when the program has been executed.So gv_run is again set to 1. Try calling the program again using SUBMITT satatement after you reach the end of start of selection without passing anyvalue. so that the program is called again internally.

Former Member
0 Kudos

Hi

Try this code....

DATA:COUNT TYPE I.
DATA: y TYPE string.

INITIALIZATION.
IMPORT COUNT FROM MEMORY ID 'VAM'.

SELECTION-SCREEN: BEGIN OF BLOCK B1.
PARAMETER: x TYPE PAYR-ZALDT.
SELECTION-SCREEN: END OF BLOCK B1.


AT SELECTION-SCREEN OUTPUT.
  IF COUNT > 0.
     CLEAR X.
ENDIF.

START-OF-SELECTION.
ADD 1 TO COUNT.
CASE x+4(2).
WHEN '01'.
CONCATENATE  'Jan' x+6(2',' x+0(4) INTO y .

WHEN '02'.
CONCATENATE  'Feb' x+6(2',' x+0(4) INTO y .

WHEN '03'.
CONCATENATE  'Mar' x+6(2',' x+0(4) INTO y .

WHEN '04'.
CONCATENATE  'Apr' x+6(2',' x+0(4) INTO y .

WHEN '05'.
CONCATENATE  'May' x+6(2',' x+0(4) INTO y .

WHEN '06'.
CONCATENATE  'Jun' x+6(2',' x+0(4) INTO y .

WHEN '07'.
CONCATENATE  'Jul' x+6(2',' x+0(4) INTO y .

WHEN '08'.
CONCATENATE  'Aug' x+6(2',' x+0(4) INTO y .

WHEN '09'.
CONCATENATE  'Sep' x+6(2',' x+0(4) INTO y .

WHEN '10'.
CONCATENATE  'Oct' x+6(2',' x+0(4) INTO y .

WHEN '11'.
CONCATENATE  'Nov' x+6(2',' x+0(4) INTO y .

WHEN '12'.
CONCATENATE  'Dec' x+6(2',' x+0(4) INTO y .

ENDCASE.

WRITE😕 x.
WRITE😕 y.
EXPORT COUNT TO MEMORY ID 'VAM'.
END-OF-SELECTION.

Regards

Vamshi