cancel
Showing results for 
Search instead for 
Did you mean: 

conversion of date format

Former Member
0 Kudos

Hi Experts,

I need to convert 10/10/2007 to 10-october-2007 in my smart forms please advice

Accepted Solutions (0)

Answers (5)

Answers (5)

0 Kudos

hi,

take the month value as month = date+3(2)

Call FM IDWT_READ_MONTH_TEXT.

Pass two parameters.one language and other month value . Here it is month.

take t247-lxt as month text. concatenate day and year with t247-lxt separated by '-'. Pass this value to smartforms.

Thanks,

Sanjukta

Former Member
0 Kudos

Use MONTH_NAMES_GET to get name in var suppose mon_name.

Concatenate sy-datum4(2) '-' mon_name '-' sy-datum0(4).

Regards,

Reward all helpful queries

Former Member
0 Kudos

use Function Module MONTH_NAMES_GET to get the month in char format

harimanjesh_an
Active Participant
0 Kudos

hi karthick,

Formatting of the date field can be defined with SAPscripts SET DATE MASK command.

Synatx :

<b>/: SET DATE MASK = 'date_mask'.</b>

DD : day

DDD : name of the day(wed)

DDDD : name of the day written in full (wednesday)

MM : month

MMM : name of the month(JUN)

MMMM : Name of the month (JUNE)

YY : year

YYYY : year

So, for ur requirement......

<b>/: SET DATE MASK = 'DD-MMMM-YYYY'.</b>

<b>&DATE&</b> -


> 10-october-2007. " date will be according to sy-datum

Reward me if useful,

Harimanjesh AN

Former Member
0 Kudos

you can use this

1. 01-08-2007 -


> 01.AUG.2007

2. use the FM - CONVERSION_EXIT_SDATE_OUTPUT

or

take help from this code :

data : date(10),

text1(26),

num1(10),

test_day(15),

o_date(20),

idate type sy-datum.

data : Day(2), month(2), Year(4).

data : ODay(2), Omonth(2), OYear(4).

data : Ltext Type T247-LTX.

date = '01-08-2007'.

day = date+0(2).

month = date+3(2).

year = date+6(4).

concatenate year month day into idate.

CALL FUNCTION 'HR_IN_GET_DATE_COMPONENTS'

EXPORTING

idate = idate

IMPORTING

DAY = oday

MONTH = omonth

YEAR = oyear

LTEXT = ltext.

concatenate oday '-' ltext '-' oyear into o_date.

write : O_date.

Reward points, if helpful,