Skip to Content

How to select all data from a table to a structure using one select statement?

SELECT * from /brlt/subsc INTO dup_table WHERE Type = ls_request_input_data-Type AND Dl1 = ls_request_input_data-Dl1.

The statement above is going in a loop instead of selecting all rows at once in a structure.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Oct 31, 2019 at 11:47 AM

    A structure is something flat, is like a table with only one line. So you cannot have a whole table inside a structure.

    You have to declare a table

    SELECT * from /brlt/subsc 
           INTO TABLE @DATA(dup_table) 
           WHERE Type = @ls_request_input_data-Type 
           AND    Dl1 = @ls_request_input_data-Dl1.

    or use your statement, because it is the right way to read a table in a structure

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 31, 2019 at 02:20 PM

    Hello Amit Krishna,

    SELECT.. ENDSELECT is Loop which will basically fetch one entry at a time until the last entry is reached. It is considered as a client cursor that will induce a lot of work load on the communication between Application and Database server. It is not a recommended approach as well. You can proceed with the code suggested by Frederic Girod.


    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.