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

internal table

Former Member
0 Likes
829

Hi,

In an internal table of a report, Can I write like this?

Because the fields i'm taking are referring to "structure" fields not table fields.

please let me know...

thanks.

<b>begin of t_data occurs 0,

stype like bgr00-stype,

group like bgr00-group,

mandt like bgr00-mandt,

usnam like bgr00-usnam,

start like bgr00-start,

xkeep like bgr00-xkeep,

nodata like bgr00-nodata,

tcode like blf00-tcode,

lifnr like blf00-lifnr,

bukrs like blf00-bukrs,

ekorg like blf00-ekorg,

ktokk like blf00-ktokk,

tbnam like blfa1-tbnam,

anred like blfa1-anred,

name1 like blfa1-name1,

name2 like blfa1-name2,

name3 like blfa1-name3,

name4 like blfa1-name4,

sortl like blfa1-sortl,

stras like blfa1-stras,

end of t_data.</b>

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
719

Hi,

Absolutely right.You can refer the structure fields for your internal table.

6 REPLIES 6
Read only

Former Member
0 Likes
720

Hi,

Absolutely right.You can refer the structure fields for your internal table.

Read only

0 Likes
719

thnx for the reply.

but ther will be no data in structures, right?

so how come the data will be displayed in the output.

please let me know.

thanks

Read only

0 Likes
719

Hi Sey,

You are only using the structure of the fields for your internal table fields.You need to populate the table through a select from data base tables which contains the fields data.

Read only

0 Likes
719

thanks very much.

Read only

0 Likes
719

Hi Sey,

For example..

You can use the structure ADDR.But you have to populate from the table SADR which has the data.

DATA:BEGIN OF ITAB OCCURS 0,

ANRED LIKE ADDR-ANRED,

NAME1 LIEK ADDR-NAME1,

END OF ITAB.

Now populating the table..

SELECT ANRED NAME1 FROM SADR INTO TABLE ITAB

WHERE ANRED = '10000'.

Some thing like this...

Message was edited by: Phani Kiran Nudurupati

Read only

Former Member
0 Likes
719

Hi Sey,

Yes you can define your fields with reference to a structure field also.

Lanka