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

quarterly data result

Former Member
0 Likes
548

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.

3 REPLIES 3
Read only

Former Member
0 Likes
504

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.

Read only

Former Member
0 Likes
504

Hi,

Is this the same question as the below link?

Regards,

Ernesto.

Read only

0 Likes
504

yes related to same question, but while fetching data only input year's data is displayed.