‎2006 Jan 24 6:58 AM
Hi all,
I need a FM , where i can give input as Date and in outupt it should give me two things.
1) Month of the Date
2) all Weeks of the month (starting date and Ending Date)
Thanks in advance.
Message was edited by: Vipin Nagpal
‎2006 Jan 24 7:01 AM
WEEK_GET_FIRST_DAY - returns first day of week
You can calculate the month using.
DATA month(2) TYPE c.
month0(2) = mydate4(2).
‎2006 Jan 24 7:02 AM
Hi Vipin,
1. MONTH_NAMES_GET
This is the FM
2. try this code ( just copy paste)
REPORT abc.
DATA : mname(10) TYPE c.
PARAMETER : d TYPE sy-datum.
PERFORM getmonth USING d mname.
WRITE 😕 mname.
&----
*& Form getmonth
&----
text
----
-->M text
-->MNAME text
----
FORM getmonth USING d mname.
DATA : month_names LIKE t247 OCCURS 0 WITH HEADER LINE.
DATA : m(2) TYPE c.
m = d+4(2).
CALL FUNCTION 'MONTH_NAMES_GET'
EXPORTING
LANGUAGE = SY-LANGU
IMPORTING
RETURN_CODE =
TABLES
month_names = month_names
EXCEPTIONS
month_names_not_found = 1
OTHERS = 2
.
READ TABLE month_names INDEX m.
IF sy-subrc = 0.
mname = month_names-ltx.
ENDIF.
ENDFORM. "getmonth
regards
amit m.
‎2006 Jan 24 7:14 AM
GET_WEEK_INFO_BASED_ON_DATE will give the week info.
and FM month_names_get will give the month name.
regards
vijay
‎2006 Jan 24 7:09 AM
Hi again,
1. GET_WEEK_INFO_BASED_ON_DATE
This will give the startdate and enddate
of the week (for a particular date)
2. This will not fully solve your problem,
but just a hint !
regards,
amit m.