Application Development and Automation 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: 

How to fix does not have a structure of a selection table?

walkerist
Participant
0 Kudos
1,341

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.

2 REPLIES 2

mimanchi
Explorer
0 Kudos
1,071

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.

matt
Active Contributor
0 Kudos
1,071

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.