‎2007 Jun 27 1:10 PM
hi ,
i have a requirement of developing a ALV report. i should fetch data from one view i.e, CAUFV for fields AUFNR,SOWRK,AUART,GSTRP,RSNUM and from 4 other tables RESB (MATNR,MENGE,PSMNG), RSDB(BANFN,BNFPO) etc for six fields. so i dont understand how to deal with view and how to declare internal tables.
so can anybody send how the declaration will be and how the select statement will be.
warm regards,
kiran.
points will be awarded.
‎2007 Jun 27 1:14 PM
Hi,
View is nothing but a temporary transparent table .U can use diz view as a table itself.. select query and internal table declaration is asusual.
Regards,
Ashok...
‎2007 Jun 27 1:19 PM
Hi,
Internal table declaration
This may be your final internal table of this query...
data : begin of itab occurs 0 ,
aufnr type CAUFV -AUFNR,
sowrk type CAUFV -SOWRK,
auart type CAUFV -AUART,
gstrp type CAUFV -GSTRP,
rsnum type CAUFV -RSNUM,
matnr type resb-MATNR,
menge type resb-MENGE,
psmng type resb-PSMNG,
banfn type RSDB-BANFN,
bnfpo type rsdb-BNFPO,
end of itab.
Select statemant.
just fetch needed fields frm caufv and with the corresponding fields os caufv fetch values from other 2 tables...
Regards,
Ashok...
‎2007 Jun 27 1:20 PM
first of all you should declare view in your report.........
you can use your view as same like structure........
and for better purpose you should select require fields from select tables with where conditions and then collect them to a one internal table.
finally as per your requirment you should use your ALV functions
and pass proper parameter.
if you get confusion again reply to me.
‎2007 Jun 27 1:21 PM
Hi
declare the view like
TABLES: viaufks. " PM Order Details
CLEAR: i_ord.
REFRESH: i_ord.
SELECT aufnr " PM Order No
equnr " Equipment Number
tplnr " Functional Location
auart " Order Type
aedat " Order Date
swerk " Maintenance Plant
werks " Plant
ktext " Order Text
kokrs " Controlling Area
objnr " Object Id
kostl " Cost Center
INTO TABLE i_ord
FROM viaufks
WHERE aufnr IN s_aufnr AND
equnr IN s_equnr AND
tplnr IN s_tplnr AND
swerk IN s_swerk AND
aedat IN s_date AND
auart IN s_auart.
<b>Reward points for useful Answers</b>
Regards
Anji
‎2007 Jun 27 1:28 PM
HI.
No diffrence between view and table whilde doing select quary.
Reward all helpfull answers.
Regards.
Jay