Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to use read statement on a select options

Hi all,

I am trying to read the all the values on user selection screen select options.

I have an internal table loaded with data.

So while looping this internal table, I need to check the table certain tank field (lgort) against the select options tank values entered by user.

It is fine when user uses the multiple values on the select options since I use the "READ" statement on the select options and get the matching values.

Example: when user uses the multiple value selection on a select-options to enter values A554 and A555

The select-options table will be:

sign   option    low         high

I          EQ       A554

I          EQ       A555

LOOP AT gt_output_location INTO gw_output.

 

  READ TABLE s_lgort INTO gw_lgort WITH KEY low = gw_output-lgort.

    IF sy-subrc = 0.

    * append row to another table.

    ENDIF.

ENDLOOP.

Problem:

Example: when user uses range on a select-options to enter values A554 and A555

sign   option    low         high

I          BT      A554       A555

The read statement can only get matching value A554.  

LOOP AT gt_output_location INTO gw_output.

 

  READ TABLE s_lgort INTO gw_lgort WITH KEY low = gw_output-lgort.

    IF sy-subrc = 0.

    * append row to another table.

    ENDIF.

ENDLOOP.


Anyone have any idea on this?? Thanks!!

Former Member
Not what you were looking for? View more on this topic or Ask a question