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

structure declaration

Former Member
0 Likes
1,159

Can i put an include(of a SAP table) during my structure definition ? I know that is possible in an internal table definition, but something got me wrong when i try to insert a include into a structure, see bellow :

BEGIN OF E_COMP,

INCLUDE ZM098, "other SAP table

SOMA(5) TYPE P,

DATA TYPE D,

END OF E_COMP.

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,114

Please try it like this.



data: begin of e_comp.
        include structure zm098. "other SAP table
data: soma(5) type p,
      data type d.
data: end of e_comp.

Regards,

Rich Heilman

9 REPLIES 9
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,115

Please try it like this.



data: begin of e_comp.
        include structure zm098. "other SAP table
data: soma(5) type p,
      data type d.
data: end of e_comp.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
1,114

data : BEGIN OF E_COMP,

INCLUDE structure ZM098. "other SAP table

data :SOMA(5) TYPE P,

TYPE D,

END OF E_COMP.

regards

srikanth

Read only

Former Member
0 Likes
1,114

You need to mention the keyword STRUCTURE after INCLUDE.

i.e. INCLUDE STRUCTURE ZM098.

-Kiran

Read only

Former Member
0 Likes
1,114

Try like this

DATA:BEGIN OF E_COMP,

INCLUDE ZM098. "other SAP table

DATA: SOMA(5) TYPE P,

TYPE D.

DATA: END OF E_COMP.

If useful reward points.

Regards,

Vasanth

Read only

Former Member
0 Likes
1,114

HI,

Check it out

replace the include statement with

INCLUDE STRUCTRE ZM098.

Regards,

Naveen

Read only

manuel_bassani
Contributor
0 Likes
1,114

Hi Andre,

the following code should work


DATA  BEGIN OF E_COMP,

      INCLUDE STRUCTURE ZM098.

DATA: SOMA(5) TYPE P,
      DATA TYPE D,

      END OF E_COMP.

Regards, Manuel

Read only

Former Member
0 Likes
1,114

hai

Check the bellow Structure Declaration

the changes in bold characters

<b>data: begin of e_comp.

include structure zm098.

data: soma(5) type p,

data type d.

data: end of e_comp.</b>

Thanks & regards

Sreeni

Read only

Former Member
0 Likes
1,114

HI Andre.



REPORT zarun_2.

DATA   : BEGIN OF e_comp <b>OCCURS 0</b>. "Internal table with header line
        INCLUDE STRUCTURE emara. <b>"Include Structure in MARA table</b>
DATA  :  soma(5) TYPE p,
         data    TYPE d,
         END  OF  e_comp.



Regards,

Arun Sambargi.

Read only

0 Likes
1,114

hi all,

Tks for those who answered me, but the right addiction was it :

TYPES : BEGIN OF E_COMP.

INCLUDE STRUCTURE ZM098.

TYPES : TESTE LIKE ZM098-VALOR_01,

END OF E_COMP.

tks everybody,

André