Skip to Content

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

passing selection condition dynamically

Hi All,

I have a requirement where, i have to pass the variant values to the select query dynamically.

for ex:

SELECT (i_dbfieldcat) FROM (w_tabname)

INTO TABLE <t_itab> where (variant name).

I used one function module RS_VARIANT_CONTENTS

CALL FUNCTION 'RS_VARIANT_CONTENTS'

EXPORTING

report = s_report

variant = var1

MOVE_OR_WRITE = 'W'

  • NO_IMPORT = ' '

  • EXECUTE_DIRECT = ' '

  • IMPORTING

  • SP =

tables

  • L_PARAMS =

  • L_PARAMS_NONV =

  • L_SELOP =

  • L_SELOP_NONV =

valutab = I_VTAB

  • OBJECTS =

  • FREE_SELECTIONS_DESC =

  • FREE_SELECTIONS_VALUE =

EXCEPTIONS

VARIANT_NON_EXISTENT = 1

VARIANT_OBSOLETE = 2

OTHERS = 3

In the output i got the values in I_VTAB. when i pass this internal table , select query is unable to understand.

Any suggestion how to resolve this.

For Ex: i need to fetch values from mara table MATNR = 99 to 120 values.

The above internal table I_VTAB only gives as I1= 99 to 120 ( MATNR field description) is missing. So unable to pass it to the select query.

Please suggest.

Thanks and regardds

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