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

Refresh selection screen (select-options)

Former Member
0 Likes
6,360

Hi,

Please guide me on this: i have a selection screen with few fixed select-options and few dynamic options.

i want to clear all selection screen variables .

I am reading all selection screen variables using FM

CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'

     EXPORTING

       curr_report     = sy-repid

     TABLES

       selection_table = itab1. -> all variables got in itab1.


Now, i want to clear all select-options and parameter which are captured in itab1.


i saw somewhere that FM  RS_SELECTIONSCREEN_UPDATE can be used for this.

But i tried .may be i am mistaken somewhere. Please guide me if this is the right FM to refresh selection screen variables and if yes how to use it?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,224

Hi abhishek,

Why can't we try with simple clear statement once you fill the selection screen data in Itab.

Check whether Itab is initial or not initial.depending on this you can simply write the statement clear.

clear : P_var1,s_var1.

7 REPLIES 7
Read only

former_member185613
Contributor
0 Likes
3,224

Hi Abhishek,

By clear you mean erase all the data in the select option right? Did you try REFRESH itab1[] and see if it is refreshed?

Regards,

~Athreya

Read only

0 Likes
3,224

itab1[] contains names of variables only. not the exact values that user entered on selection screen.

So, refreshing itab1 not serves any purpose.

Suppose there are 5 select-options select-options are there on selection screen:

select-options1

select-option2

select-options3

select-options4

select-options5.

User entered multiple values (say 50) in each of them. now itab1 will only contain 5 values i.e name of selection screen variables.

Read only

Former Member
0 Likes
3,225

Hi abhishek,

Why can't we try with simple clear statement once you fill the selection screen data in Itab.

Check whether Itab is initial or not initial.depending on this you can simply write the statement clear.

clear : P_var1,s_var1.

Read only

0 Likes
3,224

I can't write p_var1 or s_var1 because most of the selection screen variables are dynamically created.so at run time i dont know their names.

That why i am using FM :

CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'

     EXPORTING

       curr_report     = sy-repid

     TABLES

       selection_table = itab1. -> all variables got in itab1.


Now , itab1 containes all the variable names and now i need to refresh each variable.


something like this,


loop at itab1.

refresh(itab1-selname). => itab1-selname will contain the name of select-option S_VAR1 so i need to write something like Clear S_VAR1[]. dynamically!

endloop.

Read only

Tomas_Buryanek
Product and Topic Expert
Product and Topic Expert
0 Likes
3,224

SELECT-OPTIONS: s_uname FOR sy-uname.

DATA: l_string TYPE string.

FIELD-SYMBOLS: <dyn> TYPE any.

l_string = 's_uname' && '[]'.

ASSIGN (l_string) TO <dyn>.

CLEAR <dyn>.

-- Tomas --
Read only

0 Likes
3,224

Thanks,solved my problem.

Just curious to know, can the same be achieved from FM RS_SELECTIONSCREEN_UPDATE .If yes then how?

Read only

Tomas_Buryanek
Product and Topic Expert
Product and Topic Expert
0 Likes
3,224

It is used only for F4 events on selection screen. According to FM documentation and where-used list:


This function module allows you to supply values to any fields of the

standard selection screen in the

AT SELECTION-SCREEN ON VALUE REQUEST.... event.

-- Tomas --