‎2007 May 21 10:26 AM
Hi all,
I have to get these following output :
1) Material Number
2) Material Description
3) UNSPSC code
4) Standard Price
5) Per
6) Unit
7) Volume per [Pricing date 1]
8) Volume per [Pricing date 2]
9) Volume per [Pricing date 3]
10) Volume per [Pricing date 4]
11) Volume per [Pricing date 5]
12) Contract price per [Pricing date 1]
13) Per
14) Unit
15) Contract price per [Pricing date 2]
16) Per
17) Unit
18) Contract price per [Pricing date 3]
19) Per
20) Unit
21) Contract price per [Pricing date 4]
22) Per
23) Unit
24) Contract price per [Pricing date 5]
25) Per
26) Unit
ekpo:- matnr, menge, netpr, peinh, bprme
ekko:- ekorg
mara:- meins
mbew:- stprs, peinh
cawn:- atwrt
makt:- maktx
the user will enter 5 consecutive months as date and the desired output will be obtained.
please help me out with the logic in specific code format.
thanks in advance.
regards
vivek
‎2007 May 21 10:55 AM
hi vivek,
declare 5 parameters of type d1-m1
d1-m2
;;
;
d1-m5
[ means parameters of database table d1 of m1 type fields which has the months value]
and declare a internal table having alll therquired fields
as
types: begin of itab ,
f1 type d1-f1,
......
.................
.........
fn type dn-fn,
end of itab.
data: itab1 type itab occurs 0 with header line.
start-of-selection.
select a~matnr
bmaktx amenge
anetpr apeinh
a~bprme
c~ekorg
d~meins
e~stprs
e~peinh
f~atwrt
from ekpo as a
inner join makt as b
ekko as c
mara as d
mbew as e
cawn as f
into table itab1
where d1-m1 = 'm1' and
[ where give d1 as database table and m1 and field corresponding to that table]
d1-m2 = 'm2' and
d1-m3 = 'm3' and
d1-m4 = 'm4' and
d1-m5 = 'm5' .
if helpful reward some points.
with regards,
suresh babu aluri.
‎2007 May 21 10:55 AM
hi vivek,
declare 5 parameters of type d1-m1
d1-m2
;;
;
d1-m5
[ means parameters of database table d1 of m1 type fields which has the months value]
and declare a internal table having alll therquired fields
as
types: begin of itab ,
f1 type d1-f1,
......
.................
.........
fn type dn-fn,
end of itab.
data: itab1 type itab occurs 0 with header line.
start-of-selection.
select a~matnr
bmaktx amenge
anetpr apeinh
a~bprme
c~ekorg
d~meins
e~stprs
e~peinh
f~atwrt
from ekpo as a
inner join makt as b
ekko as c
mara as d
mbew as e
cawn as f
into table itab1
where d1-m1 = 'm1' and
[ where give d1 as database table and m1 and field corresponding to that table]
d1-m2 = 'm2' and
d1-m3 = 'm3' and
d1-m4 = 'm4' and
d1-m5 = 'm5' .
if helpful reward some points.
with regards,
suresh babu aluri.
‎2007 May 21 10:58 AM
Hi,
selection-screen begin of block temp with frame.
select-options : so_month for <tablename>.
selection-screen end of block temp
start-of-selection.
select ekpo~matnr
ekpo~menge
ekpo~ netpr
ekpo~peinh
ekpo~bprme
ekko~ekorg
mara~meins
mbew~stprs
mbew~peinh
cawn~atwrt
makt~maktx
into corresponding fields of table <internal table name>
from ekko
inner join ekpo on ekkoebeln eq ekpoebeln
inner join mara on ekpomatnr eq maramatnr
inner join mbew on maramatnr eq mbewmatnr
inner join makt on maramatnr eq maktmatnr
where <month field> in <so_month>
for this u will have to create select options so_month field in the selection screen
end-of-selection
regards
suresh
Message was edited by:
Suresh Krishnan