2022 Oct 31 8:39 AM
I was having a issue with my table T_KOMV
t_komv TYPE STANDARD TABLE OF komv,
lx_komv TYPE komv,
lc_ZB00 VALUE 'ZB00'.
I was trying to check if ZB00 is in T_KOMV but having an issue that T_KOMV does not have a structure of a selection table.
Here's my code:
IF LC_ZB00 IN T_KOMV[].
*Do something
ENDIF.
2022 Oct 31 8:58 AM
hi
T_komv must be defined using RANGES if you want to use IN.
DATA: t_komv TYPE STANDARD TABLE OF komv,
ls_komv TYPE komv,
lc_zb00(4) VALUE 'ZB00'.
RANGES: rt_komv FOR komv-kschl.
IF lc_zb00 IN rt_komv[].
*do something
ENDIF.
2022 Oct 31 9:23 AM
KOMV is a table. It has many fields. Your LC_ZB00 is presumably refering to one of the fields in KOMV. Nowhere do you say what field it is, so exactly how you expect your code to work at all, I really don't know.
I suggest you read the documentation on IN as used in condition expression, RANGES and also take the time to read the document on LOOP AT ... WHERE, READ TABLE and table expressions.
Programming by guessing the syntax is rarely successful.