2011 Apr 25 10:33 AM
Hello everyone,**
*I have a function module where ,at end of current quarter, i need to fetch data of last 3 quarters including current quarter .*
eg:
I/P :QTR 1 YEAR 2010
O/P
QTR VALUE
Q12010 ITAB DATA
Q22009 ITAB DATA
Q32009 ITAB DATA
Q42009 ITAB DATA
I/P :QTR 2 YEAR 2010
O/P
QTR VALUE
Q22010 ITAB DATA
Q12010 ITAB DATA
Q32009 ITAB DATA
Q42009 ITAB DATA
I/P :QTR 3 YEAR 2010
O/P
QTR VALUE
Q32010 ITAB DATA
Q22010 ITAB DATA
Q12010 ITAB DATA
Q42009 ITAB DATA
I/P :QTR 4 YEAR 2010
O/P
QTR VALUE
Q42010 ITAB DATA
Q32010 ITAB DATA
Q22010 ITAB DATA
Q12010 ITAB DATA
but getting only 2010(eg) all 4 quarters data for all the input options.
how to write a select query for getting the result as shown above?
In my DB table year and quarter fields are separate.
Hello everyone,**
*I have a function module where ,at end of current quarter, i need to fetch data of last 3 quarters including current quarter .*
eg:
I/P :QTR 1 YEAR 2010
O/P
QTR VALUE
Q12010 ITAB DATA
Q22009 ITAB DATA
Q32009 ITAB DATA
Q42009 ITAB DATA
I/P :QTR 2 YEAR 2010
O/P
QTR VALUE
Q22010 ITAB DATA
Q12010 ITAB DATA
Q32009 ITAB DATA
Q42009 ITAB DATA
I/P :QTR 3 YEAR 2010
O/P
QTR VALUE
Q32010 ITAB DATA
Q22010 ITAB DATA
Q12010 ITAB DATA
Q42009 ITAB DATA
I/P :QTR 4 YEAR 2010
O/P
QTR VALUE
Q42010 ITAB DATA
Q32010 ITAB DATA
Q22010 ITAB DATA
Q12010 ITAB DATA
but getting only 2010(eg) all 4 quarters data for all the input options.
how to write a select query for getting the result as shown above?
In my DB table year and quarter fields are separate.
2011 Apr 25 5:16 PM
I'd create a dynamic where clause.... and populate it like:
where.....
( year eq '2011' and quarter eq 'Q2' ) or
(year eq '2011' and quarter eq 'Q1' ) or
(year eq '2010' and quarter eq 'Q4' ) or
(year eq '2010' and quarter eq 'Q3' )
. . .
It's really very easy to figure out what your where clause should say, depending upon the first or last quarter to be reported.
2011 Apr 26 12:31 AM
2011 Apr 26 4:55 AM
yes related to same question, but while fetching data only input year's data is displayed.