Skip to Content
-2

Declaration of an internal table from db table

Sep 21, 2017 at 08:38 AM

51

avatar image
Former Member

Hi,

When I want to declare an internal table of a data base table, I first create a table type structure of this db table. Is there a way to do this only using abap, without using any 'Z' table type object?

10 |10000 characters needed characters left characters exceeded

Ibrahim,

data: it_mara type standard table of mara,

      wa_mara type mara.

it_mara type standard table of mara => Internal table has the complete structure of Mara with all the fields, holds a number of records

wa_mara type mara => Work area has the complete structure of Mara with all the fields, holds a single record (not a table)

You need table type and line type only when you are working with deep structures ie.

For ex say itab has fields => field1,field2,field3.

field1 single value

field2 single value

field3 deep structure which can hold a set of records.

Here for field3 you need a deep structure only if it has to hold a set of records.

Ex of a deep structure.........

tt.jpg

Just declare this in a test program,and put a break point and check the internal table and workarea,you will get an idea.

K.Kiran.

tt.jpg (36.5 kB)
0
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Mike Pokraka Sep 21, 2017 at 08:56 AM
1
data users type table of usr01.
Share
10 |10000 characters needed characters left characters exceeded
Koen Hesters Sep 21, 2017 at 09:10 AM
0

Hi,

Types: Begin of struct_user,
	user type usr01-user,
        useradres type adres01-useradres,
       End of struct_user.
DATA: inttab_user type table of struct_user.
somewhat more complex if you have to user different tables
Share
10 |10000 characters needed characters left characters exceeded