‎2007 Apr 27 6:56 AM
Hi ,
I want date format as below.
if date is 05/04/2007 then my requirement is as 05-APR-2007
Is there any function module to get directly in the format of 05-APR-2007.
I know function module MONTH_NAMES_GET.
But with this we can get month name and then we have to concatenate.
If there is any funciton module then let me know.
Thanks and regards,
shyla
‎2007 Apr 27 7:07 AM
hi,
chk this.
DATA: DATE_CHAR(20).
DATA: DATE TYPE SY-DATUM.
DATA: MONTH_NAME LIKE T247-LTX.
DATE = SY-DATUM.
SELECT SINGLE LTX FROM T247
INTO MONTH_NAME
WHERE SPRAS = SY-LANGU
AND MNR = SY-DATUM+4(2).
CONCATENATE SY-DATUM+6(2) MONTH_NAME SY-DATUM(4)
INTO DATE_CHAR SEPARATED BY SPACE.
WRITE: / DATE_CHAR.or use this FM
CACS_DATE_GET_YEAR_MONTH : To get the number of the month
MONTH_NAMES_GET: To get month description
Regards
Reshma
‎2007 Apr 27 6:57 AM
Hi Shyla,
I think you have to write some logic to solve this problem.
Best way is use CONCATENATE option to get this format.OK
Using EDIT MASK option it is not possible
<b>
Reward all helpful answers</b>
Regards,
V.Raghavender.
‎2007 Apr 27 7:04 AM
Hi,
Here i am writing this code in smartform and here i have to take languate consideration.
i.e. i have to print month in the customer language.
Thanks,
shyla
‎2007 Apr 27 7:04 AM
Hi Shyla,
I dont think so there is a direct function module avialable to this.
Your approach is perfectly correct.
Thanks,
Vinay
‎2007 Apr 27 7:06 AM
try the following FMs
CONVERSION_EXIT_SDATE_INPUT
CONVERSION_EXIT_SDATE_OUTPUT
CONVERSION_EXIT_IDATE_INPUT
CONVERSION_EXIT_IDATE_OUTPUT
CONVERSION_EXIT_LDATE_OUTPUT
i think CONVERSION_EXIT_SDATE_OUTPUT might solve your problem.
regards,
Priyank
Message was edited by:
Priyank Jain
‎2007 May 05 4:51 PM
Hey guys iam wokring on this assignment and i'm stuck! I am trying to format the time into 12 hr clock with AM&PM. ex: 23:52:45, i want to display it as 11: 52 PM.
Appreciate your help.
Cheers!!
‎2007 Apr 27 7:07 AM
hi,
chk this.
DATA: DATE_CHAR(20).
DATA: DATE TYPE SY-DATUM.
DATA: MONTH_NAME LIKE T247-LTX.
DATE = SY-DATUM.
SELECT SINGLE LTX FROM T247
INTO MONTH_NAME
WHERE SPRAS = SY-LANGU
AND MNR = SY-DATUM+4(2).
CONCATENATE SY-DATUM+6(2) MONTH_NAME SY-DATUM(4)
INTO DATE_CHAR SEPARATED BY SPACE.
WRITE: / DATE_CHAR.or use this FM
CACS_DATE_GET_YEAR_MONTH : To get the number of the month
MONTH_NAMES_GET: To get month description
Regards
Reshma
‎2007 Apr 27 7:09 AM
Hi,
Befor Printing the Date write a perform and add the below code with appropriate values.
FORM CHANGE_DATE_FORMAT USING P_I_FINAL_EFDAT
CHANGING P_DATE.
DATA: L_YEAR(4),
L_MONTH(2),
L_DAY(2),
LD_MONTH(3).
L_YEAR = P_I_FINAL_EFDAT+0(4).
L_MONTH = P_I_FINAL_EFDAT+4(2).
L_DAY = P_I_FINAL_EFDAT+6(2).
SELECT SINGLE KTX INTO LD_MONTH FROM T247
WHERE SPRAS = SY-LANGU AND
MNR = L_MONTH.
IF SY-SUBRC = 0.
CONCATENATE L_DAY LD_MONTH L_YEAR+0(4) INTO P_DATE
SEPARATED BY '-'.
ENDIF.
ENDFORM. " change_date_format
Regards
Bala
‎2007 Apr 27 7:10 AM
Hi shyla,
1. <b>05-APR-2007</b>
2. use this FM <b>CONVERSION_EXIT_SDATE_OUTPUT</b>
regards,
amit m.
‎2007 Apr 27 7:19 AM
DEAR USE FM <b>CONVERSION_EXIT_SDATE_OUTPUT</b> and replaced there seperator (.) from '-'