on 03-18-2015 9:03 AM
Hi Experts,
I need to convert one date format into another.
example like followings.
Date format required: day,month date,yyyy (Monday,February 16,2015).
Is there any Function module for that,or please tell me another way.
Regards,
Satheeshkumar.M
Hello
Is this issue resolved ?
Also mark this Discussion with a Correct Answer and Helpful Answer where appropriate.
See http://scn.sap.com/community/support/blog/2013/04/03/how-to-close-a-discussion-and-why
Even if you discovered the solution without any outside contributions, it helps others to understand what the solution turned out to be
Regards
Sandy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Satheesh
You will have to read the Day Text and Month text and then create a variables of type character by concatenation
Read Day for given date use FM
DATE_TO_DAY | Get the day of the date (Ex Mon.Tue etc) |
Read the month for given date
IDWT_READ_MONTH_TEXT | Read the month Text |
Refer to code below
DATA: LONG_DATE(20).
PERFORM GET_LONG_DATE USING LONG_DATE.
WRITE: LONG_DATE.
FORM GET_LONG_DATE USING DATE.
DATA: T_MONTH_NAMES LIKE TABLE OF T247 WITH HEADER LINE.
CALL FUNCTION 'MONTH_NAMES_GET'
EXPORTING
LANGUAGE = SY-LANGU
TABLES
MONTH_NAMES = T_MONTH_NAMES
.
DATA: YEAR(4) TYPE C,
MONTH(2) TYPE C,
DAY(2) TYPE C.
YEAR = SY-DATUM+(4).
MONTH = SY-DATUM+4(2).
DAY = SY-DATUM+6(2).
READ TABLE T_MONTH_NAMES INDEX ( MONTH ).
CONCATENATE T_MONTH_NAMES-LTX ' ' DAY INTO DATE SEPARATED BY SPACE.
CONCATENATE DATE ',' INTO DATE.
CONCATENATE DATE YEAR INTO DATE SEPARATED BY SPACE.
WRITE / DATE.
ENDFORM.
Regards
sandy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.