‎2007 Feb 22 5:57 AM
Hi all
i have 6 tables from which the output is fetched...ekko, ekpo, mara, makt, mbew, s012, ausp.
ekorg from ekko - select option
mtart and meins from mara where mtart is select option
maktx from makt
stprs and peinh from mbew
atwrt from ausp
matnr from ekpo
wemgm from s012..., but with this field i need 5 different columns. wemgm giving the sum of po amount in month jan, wemgm2 in feb.........wemgm5 in may.
like wise netpr from ekpo. ... 5 columns with this field....netpr1 for the price of materials in jan..netpr2 in feb.....
same is the case for ekpo-peinh and ekpo-bprme, for each field i need 5 columns coreesponding jan to may.
Kindly tell me how to define the internal tables and write the select statements for this requirement. i am new to programming , so not able to understand wht to do.
pls help me.
thanks in advance
‎2007 Feb 22 6:24 AM
Declare your internal table like .
data : begin of itab_ekpo ,
your fields what you required ,
end of itab_ekpo.
data : begin of itab_s012 ,
your fields for
end of s012,
data : begin of itab_final,
now here to have fields of wemgm for diff months
netpr for diff months ,
peinh for diff months ,
bprme for diff months ,
end of itab_final.
select from ekko based on sales organization
then based on above data select from ekpo .
then loop at itab_ekpo and selecte from diff tables to merge into itab_final.
This should be logic .For getting amount for different months write only one select query .
Please reward if useful.