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

function module for date processing

Former Member
0 Likes
828

hi all,

can anybody tell me function module do below things....

Pick up the month and the respective week from the value of ERSDA.

Message was edited by:

PARESH PATEL

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
799

Hi Paresh,

Could you elaborate on your requirement?

Regards,

5 REPLIES 5
Read only

Former Member
0 Likes
800

Hi Paresh,

Could you elaborate on your requirement?

Regards,

Read only

0 Likes
799

my requrement is,

Pick up the month and the respective week from the value of ERSDA.

Read only

0 Likes
799

Check these FM's

DATE_GET_WEEK

CACS_DATE_GET_YEAR_MONTH

Read only

0 Likes
799

Hi,

Use the FM:DATE_GET_WEEK .

Import : YYYYMMDD; Export : YYYYNN, where NN is # of week and YYYY is year.

ashish

Read only

Former Member
0 Likes
799

Hi Paresh,

Use the below code.

DATA: v_ersda TYPE sy-datum VALUE '20071001'.

DATA: v_month(2) TYPE c,

v_week(2) TYPE c,

v_full_week LIKE scal-week.

MOVE v_ersda+4(2) TO v_month.

CALL FUNCTION 'DATE_GET_WEEK'

EXPORTING

date = v_ersda

IMPORTING

week = v_full_week

EXCEPTIONS

date_invalid = 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.

MOVE v_full_week+4(2) TO v_week.

WRITE:/5 'Month = ', v_month.

WRITE:/5 'Week = ', v_week.