I have a few field names in LT_FIELDS. I am trying to concatenate the data in that internal table in a specific format and append it to LT_WHERE for a dynamic select query.
Below is the snippet I wrote:
TYPES: BEGIN OF ty_whr,
fieldname TYPE string,
END OF ty_whr.
DATA(lt_fields) = VALUE rsds_frange_t( ).
DATA(lt_where) = REDUCE ty_whr(
INIT whereclause = VALUE ty_whr( )
FOR <fields> IN lt_fields
NEXT whereclause =
COND #( WHEN whereclause IS NOT INITIAL
THEN <fields>-fieldname && | IN | && |@| && <fields>-fieldname && | AND |
ELSE <fields>-fieldname && | IN | && |@| && <fields>-fieldname
) ).
I am getting this error on concatenation part:
String calculation not permitted here
Is the syntax wrong here?