Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to Display

Former Member
0 Kudos
198

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.

5 REPLIES 5

Former Member
0 Kudos
140

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.

Prasoon
Active Contributor
0 Kudos
140

Hi,

   You may use the Function Module: CONSUMPTION_READ_FOR_MM to get the consumption details.

Regards,

AKPT

Former Member
0 Kudos
140

you have any idea about How Can I write the Coding?

Prasoon
Active Contributor
0 Kudos
140

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

Former Member
0 Kudos
140

Thank you