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

creating Types and Internal table

Former Member
0 Likes
590

Hi,

I created

Types: begin of itab,

field 1 ...

-


-


Field 30,

End of itab.

Data: lt_itab type table of itab.

I need to create a second type itab1 with all the itab fields and also new fields field31 and field32.

I don’t want to declare all the 30 fields again for the second one.

Can any one tell me how to create this?

Thanks.

rajesh

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
557

You can INCLUDE TYPE.



Types: begin of itab,
       field1 type string,
       field2 type string,
*      More Fields in here.
       Field30 type string,
       End of itab.

Data: lt_itab type table of itab.

TYPES BEGIN OF new_itab.
       INCLUDE type itab.
TYPES: field31 type string,
       field32 type string,
END OF new_itab.

Regards,

Rich Heilman

5 REPLIES 5
Read only

Former Member
0 Likes
557

Like this..


  TYPES BEGIN OF new_itab.
          INCLUDE STRUCTURE itab.
  TYPES:  initiator_per_no        TYPE ptreq_actor-objid,
* declare your other fields here which are different 
  END OF new_itab.

A.

Read only

Former Member
0 Likes
557

hi, if u have already created a internat table with the fields and you want to use those fields in creating of another table, follow the below format to do so.

Data: begin of ty_itab2.

include structure itab1.

<fields>.

Data: end of ty_itab2.

it will work, reward points if help ful

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
558

You can INCLUDE TYPE.



Types: begin of itab,
       field1 type string,
       field2 type string,
*      More Fields in here.
       Field30 type string,
       End of itab.

Data: lt_itab type table of itab.

TYPES BEGIN OF new_itab.
       INCLUDE type itab.
TYPES: field31 type string,
       field32 type string,
END OF new_itab.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
557

hi

good

data: itab1 type standard table of itab.

thanks

mrutyun^

Read only

0 Likes
557

Hi ,

Thanks for all my problem solve,

I gave the points all usefull answers.

Thanks.

Rajesh