Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Declaration of an internal table from db table

Former Member
0 Kudos

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?

1 ACCEPTED SOLUTION

pokrakam
Active Contributor
data users type table of usr01.
3 REPLIES 3

kiran_k8
Active Contributor
0 Kudos

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.

pokrakam
Active Contributor
data users type table of usr01.

kohesco
Active Contributor
0 Kudos

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