‎2022 Sep 29 8:31 AM
I wrote below code.
DATA:kstar_t TYPE STANDARD TABLE OF kstar .
LOOP AT kstar_t TRANSPORTING NO FIELDS WHERE kstar <= '89999999' AND kstar >= '8000000' .
ENDLOOP.
I want to check in table kstar_t whether exist data in some range. But it has error "kstar has no structure so do not have a component kstar". So what's the correct way to loop where in a single field table? Thx.
‎2022 Sep 29 8:36 AM
You have 2 types of internal tables, those with lines which are structures containing components (field names), and those without component -> usually the "pseudo-component" TABLE_LINE can address the whole line:
DATA:kstar_t TYPE STANDARD TABLE OF kstar .
LOOP AT kstar_t TRANSPORTING NO FIELDS WHERE table_line <= '89999999' AND table_line >= '8000000'.
ENDLOOP.
‎2022 Sep 29 8:36 AM
You have 2 types of internal tables, those with lines which are structures containing components (field names), and those without component -> usually the "pseudo-component" TABLE_LINE can address the whole line:
DATA:kstar_t TYPE STANDARD TABLE OF kstar .
LOOP AT kstar_t TRANSPORTING NO FIELDS WHERE table_line <= '89999999' AND table_line >= '8000000'.
ENDLOOP.
‎2022 Sep 29 9:29 AM
You need to create a proper table type:
TYPES:
BEGIN OF ty_kstar,
kstar TYPE kstar,
END OF ty_kstar.
TYPES:
tt_kstar TYPE STANDARD TABLE OF ty_kstar.
DATA:
t_kstar TYPE tt_kstar.
*...
LOOP AT t_kstar INTO DATA(s_kstar) WHERE kstar BETWEEN '8000000' AND '89999999'.
* Do something.
ENDLOOP.