Application Development and Automation 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: 
Read only

table type in oops

Former Member
0 Likes
569

hi guys

suppose we have a table type created in abap ddic.

say z_t_tabtyp and it has a line type say z_l_lintyp.

in my oops program i have declared say

data: g_itab type z_t_tabtyp.

By doing this I will achieve an internal table without a header line.

The problem: If i want to add a few more fields to this internal table WITHOUT changing the table type z_t_tabtyp which is a global structrure. How can i do that.

I have tried the following:

data: begin of itab.
         include structure z_t_tabtyp
data:  fields like table-field,
         end of itab.

it gives me an error saying z_t_tabtyp must be a flat structure.

Any suggestions??

Thanks a lot for looking.

Regards

Sameer

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
540

Hello,

Try this:


data: begin of itab.
         include structure z_t_tabtyp. (instead of the table type use the line type)
data:  fields like table-field,
         end of itab.

The error occurs because z_t_tabtyp is a table type, try using the line type, not the table type. (Just use the line type declared in the table type z_t_tabtyp).

Regards,

4 REPLIES 4
Read only

Former Member
0 Likes
541

Hello,

Try this:


data: begin of itab.
         include structure z_t_tabtyp. (instead of the table type use the line type)
data:  fields like table-field,
         end of itab.

The error occurs because z_t_tabtyp is a table type, try using the line type, not the table type. (Just use the line type declared in the table type z_t_tabtyp).

Regards,

Read only

0 Likes
540

Thanks David

I figred that out,

full points for u though

Read only

0 Likes
540

You're welcome and thank you Sameer!

Regards

Read only

Former Member
0 Likes
540

i achieved the desired result by the following code

TYPES: BEGIN OF gt_char_typ.
         INCLUDE TYPE ZU7_S_HBR_SALES_REPORT_CHAR.
TYPES:   vbelv LIKE vbfa-vbelv,
       END OF gt_char_typ.
DATA: gt_char TYPE TABLE OF gt_char_typ.

all other suggestions are welcome.

Thanks again for looking.