Skip to Content
-2

Declaration of an internal table from db table

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?

Add comment
10|10000 characters needed 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)
  • Get RSS Feed

2 Answers

  • Best Answer
    Sep 21, 2017 at 08:56 AM
    data users type table of usr01.
    
    Add comment
    10|10000 characters needed characters exceeded

  • Sep 21, 2017 at 09:10 AM

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