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: 

comparing period and date

Former Member
0 Kudos

hi,

Are period and date , directly comparable.

that is...i have

seloption:SO_PERIOD: 02.2005 to 03.2006

and Ztable like this...

col1 col2

xxx 01.2005

yyy 02.2005

yyy 03.2005

yyy 01.2006

yyy 04.2006

will the statement..

select col1 from ztable where col2 in so_period.....return all values

pls help.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

The period should be stored with the forma YYYYMM, so you need only sort the data by COL2.

U can use the data element SPMON.

Max

4 REPLIES 4

Former Member
0 Kudos

Hi

The period should be stored with the forma YYYYMM, so you need only sort the data by COL2.

U can use the data element SPMON.

Max

0 Kudos

hi,

sorry there is typographical error

here is the right....one

Are period and date , directly comparable.

that is...i have

seloption:SO_PERIOD: 02.2005 to 03.2006

and Ztable like this...

col1 col2

xxx 01.01.2005

yyy 01.02.2005

yyy 02.01.2005

yyy 01.03.2006

will the statement..

select col1 from ztable where col2 in so_period.....return all values

pls help.

Former Member
0 Kudos

Fiscal periods are not necessarily the same as the month in a date. You will probably have to do a conversion.

Rob

Former Member
0 Kudos

Hi,

You need to use the function module <b>DATE_TO_PERIOD_CONVERT</b> to convert the date to Fiscal year and the Period, so you will get these both the fields.

in your case this is reversse, you need to get the date based on the Fiscal year and the perios, so use the function module function modules to get the date and write the select statment.

HR_GB_PERIOD_DATES

CYCP_GET_PERIOD_FIRST_DATE_D

Regards

Sudheer