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

SET DATE

Former Member
0 Likes
1,057

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
Read only

JozsefSzikszai
Active Contributor
0 Likes
994

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
Read only

JozsefSzikszai
Active Contributor
0 Likes
995

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

Read only

former_member386202
Active Contributor
0 Likes
994

Hi,

Use FM LAST_DAY_IN_YEAR_GET and LAST_DAY_OF_MONTHS

Regards,

Prashant

Read only

Former Member
0 Likes
994

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.

Read only

JozsefSzikszai
Active Contributor
0 Likes
994

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

Read only

Former Member
0 Likes
994
REPORT ychatest2.

PARAMETERS : p_date LIKE sy-datum.

INITIALIZATION.

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

Former Member
0 Likes
994

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.

Read only

Former Member
0 Likes
994

Thank u all!