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: 

First date and last date of current year

Former Member
0 Kudos
1,415

Hi

how can i get first and last date of current year, thanks for your help

1 ACCEPTED SOLUTION

Former Member
0 Kudos
363

try this

<b>FIRST_AND_LAST_DAY_IN_YEAR_GET</b>

7 REPLIES 7

Former Member
0 Kudos
363

Hi

FIRST_DAY(4) = SY-DATUM(4).

FIRST_DAY+4(4) = '0101'.

LAST_DAY(4) = SY-DATUM(4).

LAST_DAY+4(4) = '1231'.

Max

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
363

You can do that very simply like so.



report zrich_0001.

data: first type sy-datum.
data: last type sy-datum.


first = sy-datum.
first+4(4) = '0101'.
last  = sy-datum.
last+4(4) = '1231'.

write:/ first, last.

Regards,

Rich Heilman

former_member583013
Active Contributor
0 Kudos
363

FIRST_AND_LAST_DAY_IN_YEAR_GET

Greetings,

Blag.

Former Member
0 Kudos
364

try this

<b>FIRST_AND_LAST_DAY_IN_YEAR_GET</b>

Former Member
0 Kudos
363

hi,

use FM......... FIRST_AND_LAST_DAY_IN_YEAR_GET

DATA: first LIKE sy-datum,

last LIKE sy-datum.

CALL FUNCTION 'FIRST_AND_LAST_DAY_IN_YEAR_GET'

EXPORTING

i_gjahr = '2007'

i_periv = '24'

IMPORTING

e_first_day = first

e_last_day = last.

WRITE: / 'First Date', first, ' Last Date', last.

Regards

CNU

Former Member
0 Kudos
363

Hello,

U an do it like this.

Data: lf_datum like sy-datum,

lf_datum1 like sy-datum.

TO get first date

lf_datum0(4) = sy-datum0(4).

lf_datum+4(2) = '01'.

lf_datum+6(2) = '01'.

Last date

lf_datum10(4) = sy-datum0(4).

lf_datum1+4(2) = '12'.

lf_datum1+6(2) = '31'.

If useful reward.

Vasanth

Former Member
0 Kudos
363

Hi,

use this function module <b>HR_GB_TAX_YEAR_DATES</b>

Pass these values

P08_TXYEAR = Year

P08_PAYROLL_AREA = '01'

Regards

Sudheer