Application Development and Automation 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: 
Read only

Consumption Calculation,

Former Member
0 Likes
1,151

Hi SAP Abap expert,

My roles is a functional, I'm in process to develop new report for 6 months total of consumption.

Table contain the data of consumption can be grap from MVER.

The Total for each Month can be grap from fields GSV01- GSV13.

let say, current month is GSV04, how can i tell the abapers to Grap GSV03 in SQL Statement

Please Help, just learning

3 REPLIES 3
Read only

Former Member
0 Likes
881

Hi,

as u said that u want GSV03 field data. u can just tell him to grap the required field by giving the TABLE NAME and FIELD NAME.

tell him how the data is stored in these fields.i.e., each field contains monthly data GSV01-GSV13.

reward if helpful

raam

Read only

Former Member
0 Likes
881

Hi,

Tell ABAPer to pick current month from system date with using

Function Module "DATE_TO_PERIOD_CONVERT"

where I_DATE = SY-DATUM

and I_PERIV = 'K1'

get month & year

Example month(MON) = 01 & Year(Y1) = 2008.

Now use the following code.

concatenate GSV MON into l_gsvbr

now from table mver select query

select ******* ***** ****** into table itab

where matnr = ****

and werks = ***

and gjahr = Y1.

loop at itab.

if l_gsvbr = GSV01.

l_gsv = itab-gsv01.

elseif l_gsvbr = GSV02.

l_gsv = itab-gsv02.

******

*******

*******

endif.

endloop.

If it is helpful pls reward me.

Regards

Srimanta

Read only

Former Member
0 Likes
881

Hii Srimanta/Abapers

Thank for your quit reply

The report i would like to develop is like this

Material (MATNR) = ABC123

Current Month (System Month) = April

N-3 (MVER-GSV**) = March

N-2 (MVER-GSV**) = February

N-1 (MVER-GSV**) = January

if current month = <April>, how the program could determine for column N-3 is what month ? and also same with N-2 and N-1

please help