Skip to Content

Creation of Table type with out using structure

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Dec 05, 2014 at 06:17 AM

    use below code.

    SELECT * FROM mara

    INTO TABLE lt_mara

    FOR ALL ENTRIES IN lt_matnr

    WHERE matnr = lt_matnr-table_line.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 05, 2014 at 06:32 AM

    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
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.