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: 

SET DATE

Former Member
0 Kudos
215

Hi,

I would like to set date on selection screen in my code and not trough variants.

eg.:

AT SELECTION-SCREEN.

INITIALIZATION.

berdatum = sy-datum.

so, what should i do instead of current sy-datum <b>to get the last day of current year?</b>

thank you in advance,

Maja

1 ACCEPTED SOLUTION

JozsefSzikszai
Active Contributor
0 Kudos
152

hi Maja,

you can code a bit:

lv_year type gjahr.

lv_year = sy-datum(4).

concatenate lv_year '1231' into berdatum.

hope this helps

ec

8 REPLIES 8

JozsefSzikszai
Active Contributor
0 Kudos
153

hi Maja,

you can code a bit:

lv_year type gjahr.

lv_year = sy-datum(4).

concatenate lv_year '1231' into berdatum.

hope this helps

ec

former_member386202
Active Contributor
0 Kudos
152

Hi,

Use FM LAST_DAY_IN_YEAR_GET and LAST_DAY_OF_MONTHS

Regards,

Prashant

Former Member
0 Kudos
152

call this

AT SELECTION-SCREEN.

INITIALIZATION.

CALL FUNCTION 'FIRST_AND_LAST_DAY_IN_YEAR_GET'

EXPORTING

I_GJAHR = YEAR

I_PERIV = FISC_VAR

IMPORTING

E_FIRST_DAY = BEG_DATE

E_LAST_DAY = END_DATE

EXCEPTIONS

INPUT_FALSE = 1

T009_NOTFOUND = 2

T009B_NOTFOUND = 3.

WRITE: / BEG_DATE, END_DATE.

berdatum = END_DATE.

JozsefSzikszai
Active Contributor
0 Kudos
152

sorry, if the calendar year is not the same like the fiscal year, than you ca use the following FMs:

FIRST_AND_LAST_DAY_IN_YEAR_GET

LAST_DAY_IN_YEAR_GET

Former Member
0 Kudos
152
REPORT ychatest2.

PARAMETERS : p_date LIKE sy-datum.

INITIALIZATION.

  CONCATENATE sy-datum+0(4) '1231' INTO p_date.

Former Member
0 Kudos
152

Hi,

try this FM

FIRST_AND_LAST_DAY_IN_YEAR_GET

OR

data: last type sy-datum.

last = sy-datum.

last+4(4) = '1231'.

write:/ last.

Regards,

Omkar.

Former Member
0 Kudos
152

Thank u all!