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: 

date validations for fiscal year

Former Member
0 Kudos

My selection screen has select option for date in that it shold take financial year i.e from april to march.

suppose if date-low = dec2008 date-high = feb2008. how shld i write the code for this.validations etc. it should not give error saying lower value is higher than high value.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

>

> My selection screen has select option for date in that it shold take financial year i.e from april to march.

>

> suppose if date-low = dec2008 date-high = feb2008. how shld i write the code for this.validations etc. it should not give error saying lower value is higher than high value.

It will not show error as you have to give DEC2008 - FEB2009 for fiscal year 2008. Not DEC2008 - FEB2008.

Regards

Karthik D

4 REPLIES 4

jaideepsharma
Active Contributor
0 Kudos

Hi,

Can you please write the code of your report.

KR Jaideep,

Former Member
0 Kudos

>

> My selection screen has select option for date in that it shold take financial year i.e from april to march.

>

> suppose if date-low = dec2008 date-high = feb2008. how shld i write the code for this.validations etc. it should not give error saying lower value is higher than high value.

It will not show error as you have to give DEC2008 - FEB2009 for fiscal year 2008. Not DEC2008 - FEB2008.

Regards

Karthik D

0 Kudos

thanks karthik . I realized it but a bit late.

0 Kudos

Hi,

Anyhow you need to be careful with the validations of Fiscal year, i used the below code in one of my reports which gets Date and fiscal year as inputs;


Data : fisYr1(4) TYPE n, fisyr2(4) TYPE n.
CLEAR : fisyr1, fisyr2.
IF S_date-low+4(2) LE 3.
  fisyr1 = s_date-low+(4) - 1.
ELSE.
  fisyr1 = s_date-low+(4).
ENDIF.
IF S_date-high+4(2) LE 3.
  fisyr2 = s_date-high+(4) - 1.
ELSE.
  fisyr2 = s_date-high+(4).
ENDIF.
IF fisyr1 NE fisyr2.
  invalid_date_Range = 'X'.
ELSEIF fisyr1 NE p_fisyr.
  invalid_fiscal_year = 'X'.
ENDIF.

Regards

Karthik D