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

Date Input

Former Member
0 Likes
764

Hi,

I am taking date filed as input from user and after that want to display last date of that month on the screen.

Can anyone help me out with this?

Mahesh

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
741

hi,

chk this simple Function Module.

data:f_date type sy-datum,
l_date type sydatum.

CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
EXPORTING
iv_date = sy-datum
IMPORTING
EV_MONTH_BEGIN_DATE = f_date "first date
EV_MONTH_END_DATE = l_date. "last date of month 

Regards

Reshma

7 REPLIES 7
Read only

Former Member
0 Likes
741

Try these FM :

FKK_LAST_DAY_OF_MONTH

It takes a date and give back last date of that month

Read only

amit_khare
Active Contributor
0 Likes
741

Use this FM -

'HR_JP_MONTH_BEGIN_END_DATE'

Regards,

Amit

Read only

Former Member
0 Likes
741

hi

if the date is stored in s_date-low, then get the last date of that month like this

CALL FUNCTION 'LAST_DAY_OF_MONTHS'

EXPORTING

DAY_IN = S_DATE-low

IMPORTING

LAST_DAY_OF_MONTH = EN1_DATE

EXCEPTIONS

DAY_IN_NO_DATE = 1

OTHERS = 2.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

en1_date will hold the last date of that month

if helpful, reward

Sathish. R

Read only

Former Member
0 Likes
742

hi,

chk this simple Function Module.

data:f_date type sy-datum,
l_date type sydatum.

CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
EXPORTING
iv_date = sy-datum
IMPORTING
EV_MONTH_BEGIN_DATE = f_date "first date
EV_MONTH_END_DATE = l_date. "last date of month 

Regards

Reshma

Read only

Former Member
0 Likes
741

Hi,

Use this function module enter a date u will get last date of the month

LAST_DAY_OF_MONTHS.

If it is solve ur problem please reward me points.

Read only

Former Member
0 Likes
741

Hi

Use this FM.............

SG_PS_GET_LAST_DAY_OF_MONTH

Reward all the helpfull answers......

Read only

Former Member
0 Likes
741

Hi,

You can use Function Module :

SG_PS_GET_LAST_DAY_OF_MONTH

or

HR_JP_MONTH_BEGIN_END_DATE

or

RP_LAST_DAY_OF_MONTH

Regards,

Sandeep Kaushik