2014 Feb 13 4:49 PM
There are twelve fields ( for 12 months material consumption saved ) in MVER Table. I want to display Previous Three Months Consumption Based On In Put Date.How Can I write The Coading.
Ex-12-Months Material Consumption Saved In GSV01, GSV02...GSV12 In MVER Table.I want If I input 01/2014(MM/YYYY). Then i need to see the sum of the values of three months before of the actual mothn 12/2013+ 11/2013+ 10/2013 and the sum of consumption should display in my out put table.
2014 Feb 13 4:55 PM
i found this code but does not work :
SELECT SINGLE GSV01 GSV02 GSV03 GSV04 GSV05 GSV06 GSV07 GSV08 GSV09
GSV10 GSV11 GSV12
FROM MVER
INTO (IT_MVER-GSV01,IT_MVER-GSV02,IT_MVER-GSV03,IT_MVER-GSV04,
IT_MVER-GSV05,IT_MVER-GSV06,IT_MVER-GSV07,IT_MVER-GSV08, IT_MVER-GSV09,
IT_MVER-GSV10, IT_MVER-GSV11, IT_MVER-GSV12 )
WHERE MATNR = IT_MARC-MATNR AND
WERKS = P_WERKS AND
GJAHR = S_DATE-LOW+0(4).
*LINE ADDED BY ANIL ON 15.10.2007
month = s_date-LOW+4(2).
do 3 times.
month = month - 1.
concatenate 'IT_MVER-GSV' month into str.
condense str no-gaps.
assign (str) to <fs>.
case ctr.
when 1.
IT_FINAL-consum1 = <fs>.
when 2.
IT_FINAL-consum2 = <fs>.
when 3.
IT_FINAL-consum3 = <fs>.
endcase.
ctr = ctr + 1.
enddo.
2014 Feb 13 7:08 PM
2014 Feb 14 3:19 PM
2014 Feb 14 3:47 PM
Hi,
For the FM: CONSUMPTION_READ_FOR_MM ,the import parameters will be :
MATNR (Material number)
WERKS (Plant)
PERKZ (Period indicator)
PERIV (Fiscal year variant)
Export tables:
GES_VERB_TAB: (Table of total consumption)
UNG_VERB_TAB : (Table of unplanned consumption)
You can test the FM with the values and write the coding accordingly with the help of abaper.
Regards,
AKPT
2014 Feb 14 5:12 PM