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

itab declaration

Former Member
0 Likes
568

Hi,

Iam trying to declare two strucures into one itab like this.



data: begin of t_qmel occurs 0.
<b>     include structure qmel.
        include structure qmih.</b>
data:   fegrp like qmfe-fegrp,
        fecod like qmfe-fecod,
data: end of t_qmel.

Since common fields(MANDT & QMNUM) are existing in QMIH it is throwing the error.How can i avoid that? I dont want to declare field by field using QMIH.

cheers

kaki

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
543

You can include the second structure by adding a suffix like this:

INCLUDE STRUCTURE qmih AS name1 RENAMING WITH SUFFIX name2.

Effect

You can address the components included in INCLUDE STRUCTURE as a single entity using the group name name1. The behavior is the same as in addition 1. When the components of the structure s are included, the component names are renamed by appending the name name2. This allows you to include structure s more than once.

Hope this helps,

Rao A

Message was edited by: Rao Arimilli

3 REPLIES 3
Read only

Former Member
0 Likes
544

You can include the second structure by adding a suffix like this:

INCLUDE STRUCTURE qmih AS name1 RENAMING WITH SUFFIX name2.

Effect

You can address the components included in INCLUDE STRUCTURE as a single entity using the group name name1. The behavior is the same as in addition 1. When the components of the structure s are included, the component names are renamed by appending the name name2. This allows you to include structure s more than once.

Hope this helps,

Rao A

Message was edited by: Rao Arimilli

Read only

Former Member
0 Likes
543

&----


*& Report YCHATEST *

*& *

&----


*& *

*& *

&----


REPORT YCHATEST .

TYPES: BEGIN OF rec1,

f1(1) TYPE C,

f2 TYPE I,

END OF rec1.

TYPES: BEGIN OF rec2.

INCLUDE TYPE rec1 AS g RENAMING WITH SUFFIX _g.

INCLUDE TYPE rec1 AS h RENAMING WITH SUFFIX _h.

TYPES: END OF rec2.

DATA: str TYPE rec2.

The structure str consists of four components str-f1_g, str-f2_g, str-f1_h and str-f2_h. Using the group component str-g you can address the first two components; you can then address the latter two using str-h These substructures are of the type rec1.

Read only

0 Likes
543

Thanks for all posts

points alloted

cheers

kaki