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: 

read select options

Former Member
0 Kudos

Hi,

is there any function which I can use to get the values from the select options ? I nedd the values to fill my header of the alv.

9 REPLIES 9

Former Member
0 Kudos

Hi,

Check FM: S_SELECTIONSCREEN_READ

Regards,

HImanshu

0 Kudos

sorry I can't find S_SELECTIONSCREEN_READ in se37. is this not a function?

0 Kudos

That would be R S_SELECTIONSCREEN_READ. Can be used to read data from dynpros, but I think the FM I told you is better for what you want to do.

Regards,

Sergio

Former Member
0 Kudos

Function RS_REFRESH_FROM_SELECTOPTIONS

Pass SY-CPROG to it and get the table with the parameters.

Regards,

Sergio

0 Kudos

hi ,

with functions RS_REFRESH_FROM_SELECTOPTIONS I only get the name of the select-options but not the values in it.

0 Kudos

I just tested RS_REFRESH_FROM_SELECTOPTIONS and it worked for me.


REPORT  ztestefh11.

TABLES lips.

PARAMETERS: p_lgort TYPE lips-lgort.
SELECT-OPTIONS: s_werks FOR lips-werks.


DATA: lt_rsparams TYPE TABLE OF rsparams WITH HEADER LINE.

CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
  EXPORTING
    curr_report     = sy-cprog
  TABLES
    selection_table = lt_rsparams
  EXCEPTIONS
    not_found       = 1
    no_report       = 2
    OTHERS          = 3.

IF sy-subrc <> 0.
  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.


BREAK-POINT. "Check contents of lt_rsparams here

The values I passed are there:

1 SELNAME KIND SIGN OPTION LOW 1 P_LGORT |P | | |BA01 2 S_WERKS |S |I |EQ |DS01

Of course if you test it on SE37 it will just give you the parameters with no values.

Edited by: Sérgio Oliveira on Aug 27, 2009 5:36 PM

0 Kudos

sorry sergio I think I can't explain it.

What I want is following, when I have the selection like for example storage locations 10 - 30 without 20

I want to get 10 and 30, which I can use for the header.

There are so many possibilities which the user can select, like eq ne only and so on

0 Kudos

Hi,

That was from ECC6 try with RS_READ_SEL_OPTIONS if you are on a lower version.

REgards,

Himanshu

0 Kudos

On that 10 - 30 case, RS_REFRESH_FROM_SELECTOPTIONS would give you the following:

S_LGORT |S |I |EQ |10 | S_LGORT |S |I |EQ |30 |

Now, of course you could have E, NE, BT etc

S_LGORT |S |I |BT |10 |30 S_LGORT |S |E |EQ |20 |

In that case maybe you should try to select the customizing or main master data tables of those data elements, eg: Storage locations are from table T001L. So you select the entries from that table using S_LGORT (in this case you need S_WERKS too). For both examples I mentioned, you would get only the two entries you want, 10 and 30. Then you loop on it and include the storage location codes on the text of the ALV header (and even the st. loc. description to make the user happier).

But of course you would have to do a different select and loop for each selection-option you have, and parameters for dates, quantities and other non-db-related fields would not work like that.

Regards,

Sergio