Hi experts,
I want to create a table type with single field and without referring to the structure at DB level.
Can I refer to any data element, If this is possible how to use this Table type.
I have created a table type by referring to Data element but not able to use it.
For example..
ztt_mattnr is a table type which is referring to matnr.
When I am trying to use it for For all entries it is throwing me an error.
data it_mara type ztt_mattnr.
SELECT * FROM mara INTO TABLE lt_mara
FOR ALL ENTRIES IN it_mara
WHERE matnr = it_mara-matnr.
How to overcome this ?
BR,
Eshwar
use below code.
SELECT * FROM mara
INTO TABLE lt_mara
FOR ALL ENTRIES IN lt_matnr
WHERE matnr = lt_matnr-table_line.
Hi Eshwar,
You Can create table type as Range Table type ZTEST_RTB and give data Data Element as MATNR and give Structured Row Type ZTEST_STC and click on create and activate the range table type .
make the changes of the above select query with
DATA : r_matnr TYPE ZTEST_RTB.
DATA : lt_mara TYPE TABLE OF mara.
SELECT * FROM mara INTO TABLE lt_mara
WHERE matnr in r_matnr.
I hope this will be helpful.
Thanks & Regards,
Raghunadh Kodali
Add a comment