‎2006 Feb 14 10:11 PM
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>
‎2006 Feb 14 10:17 PM
Hi,
Absolutely right.You can refer the structure fields for your internal table.
‎2006 Feb 14 10:17 PM
Hi,
Absolutely right.You can refer the structure fields for your internal table.
‎2006 Feb 14 10:22 PM
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
‎2006 Feb 14 10:24 PM
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.
‎2006 Feb 14 10:27 PM
‎2006 Feb 14 10:29 PM
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
‎2006 Feb 14 10:17 PM
Hi Sey,
Yes you can define your fields with reference to a structure field also.
Lanka