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: 

need a sollution for a logic

Former Member
0 Kudos

Hi all,

Presently iam developing an ALV report related to MM. I want a logic for calculating previous six months consumed quantity(material).The date for calculating g the quantity is sy-datum.the fields to calculate the qty. are given below.

Table- ( MVER-(GSV01-12)), period ind is MONTH

where as MVER is the table and GSV01 is the field.

GSV0# indicates consumed qty for particular month.

GJAHR- is the Fiscal Year.

In this we have to consider the calendar year and fiscal year concept.

Ex: present calendar year is 2007 where as current fiscal year is 2008.

calendar year starts from JAN-1st month----


ends with DEC12th month.

where as fiscal year starts from April-1st month----


ends with MARCH-12TH month.

For ex. the report is executing today i.,e is 05/06/2007 we have to calculate the consumed qty. for previous six months.In this synnario we have to exclude the present month why because this is the running month.We have to calculate the consumed qty. for the months like (MAY,April,march) of 2008 and (FEB,JAN,DEC) of 2007 fiscal years.

Appreciate a quick feedback.

2 REPLIES 2

Former Member
0 Kudos

hi

i believe you are trying to confuse fiscal/calendar year with your requirement...from your question it's clear that you want past six months of consumed qty from the report run date so your interval will be

report run month - 1 month -> then six months from that time, right? for this, you can use the two fms in this order

RP_CALC_DATE_IN_INTERVAL, give current date, months 1 and signum - (this will give last month)

LAST_DAY_OF_MONTHS -> give the date from the prev. fm and get the last day of the prev. month

RP_CALC_DATE_IN_INTERVAL -> give that date, months 6 and signum - (this will give six months from there) -> add 1 to this date to get the 1st day of the month

if helpful, reward

Sathish. R

Message was edited by:

Sathish

Former Member
0 Kudos

Hi Kumar,

How do you want to calculate the fiscal year. Is it going to be constant, as the fiscal year is based on the company code level, for eg company codes in different countries can have different fiscal year. If it is going to be April to March always then let me know as logic will depend on the same.

Reward points if useful.

Regards,

Atish