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: 

How to deal with the days and the date

Former Member
0 Kudos

Hey guys,

how would we know the day (monday, tuesday, etc.) given only the date? Is there any function module which we can use?

Example: Month: November

Year: 2007

Day: 29

v_day = wednesday

1 ACCEPTED SOLUTION

pavel_parshenkov2
Participant
0 Kudos

Hi, look at FM:

DAY_IN_WEEK.

and

WEEKDAY_GET.

5 REPLIES 5

pavel_parshenkov2
Participant
0 Kudos

Hi, look at FM:

DAY_IN_WEEK.

and

WEEKDAY_GET.

Former Member
0 Kudos

Hi Mark,

Try this...

RH_GET_DATE_DAYNAME

Regards,

Kaveri

former_member386202
Active Contributor
0 Kudos

Hi,

Use FM DATE_TO_DAY

Regards,

Prashant

Former Member
0 Kudos

call this function

<b> 'RH_GET_DATE_DAYNAME'</b>

FUNCTION CALL 'RH_GET_DATE_DAYNAME'

EXPORTING

langu = sy-langu

date = sy-datum calid = 'MX'

IMPORTING daynr = v_daynr

  • DAYTXT = * DAYFREE = EXCEPTIONS no_langu = 1 no_date = 2 no_daytxt_for_langu = 3 invalid_date = 4 OTHERS = 5.

Former Member
0 Kudos

CALL FUNCTION <b>'ISP_GET_WEEKDAY_NAME'</b>

EXPORTING

DATE = '20071023'

language = 'E'

  • WEEKDAY_NUMBER = ' '

IMPORTING

  • LANGU_BACK = 'EN'

LONGTEXT = day

  • SHORTTEXT =

  • EXCEPTIONS

  • CALENDAR_ID = 1

  • DATE_ERROR = 2

  • NOT_FOUND = 3

  • WRONG_INPUT = 4

  • OTHERS = 5

.

IF sy-subrc <> 0.

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

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

ENDIF.

WRITE / day.