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: 

Table Type inside of own SAP table

Former Member
0 Kudos

Hi all,

How is it possible to implement your own created Table Type inside of an created table in SAP?

Kind regards,

Pieter

1 ACCEPTED SOLUTION

former_member203305
Active Contributor
0 Kudos

Hi,

it can not be done as you want, but u can copy the table and then add the fields that u want, or u can do it inside the program, such as...sth like this

data: begin of ztable occurrs 0,

         id type i,

include sflight type sflight.

     end of ztable.

Regards

Miguel

8 REPLIES 8

PeterJonker
Active Contributor
0 Kudos

Just create a field and give it the type (your tabletype). It is that simple.

0 Kudos

Peter,

True, but the error underneath was generated while including the table type:

The "ZPIL_TT_SFLIGHT" table type has as line type the structure of SFLIGHT.

Regards,

Pieter

0 Kudos

I guess it can't be donne for a ddic table. It can only be done for structures and maybe on tables that won't be displayed in se16 for example (You can imagine why )

0 Kudos

Yeah you are right. Sorry for my previous wrong answer. This will only work with structures.

My apologies

Former Member
0 Kudos

But of course it can't work for DDIC tables. This is only for internal tables

former_member203305
Active Contributor
0 Kudos

Hi,

it can not be done as you want, but u can copy the table and then add the fields that u want, or u can do it inside the program, such as...sth like this

data: begin of ztable occurrs 0,

         id type i,

include sflight type sflight.

     end of ztable.

Regards

Miguel

Former Member
0 Kudos

You can also use APPEND structure in the database tables .

you can check it here : Adding an Append Structure (SAP Library - Tables)

Hope it helps.

It will help you to add the fields of the structure in your table...

raymond_giuseppi
Active Contributor
0 Kudos

Don't try to insert a deep structure in a transparent table, better use an INDX table, and statements like IMPORT, EXPORT and DELETE of data clusters to update database (look at online documentation of those statements, and there look for database keyword in medium option)

(Ref :ABAP Programming (BC-ABA) , The ABAP Programming Language, Saving Data Externally, Saving Data Objects as Clusters, Data Clusters in the Database, Cluster Databases)

NB: Actually you could add a LRAW type field at the end of the table, but would then be required to some assign casting to move the internal table to/from this field (Unicode rules) and be limited in size to a INT2 type field that you add before the raw type and where you must put the actual length... so better forget. (Ref: Data Types in the ABAP Dictionary)

Regards,

Raymond