cancel
Showing results for 
Search instead for 
Did you mean: 

smartforms

Former Member
0 Kudos

how to convert date format,

from DD.MM.YYYY i.e. (07.08.2008)

to DD-MMM-YYYY i.e. (07-AUG-2008) , in smartforms.

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

select single fkdat from

vbrk into INVOICE_DATE

where vbeln = invoice_no.

case invoice_date+4(2).

WHEN '01'.

month = 'January'.

WHEN '02'.

month = 'February'.

WHEN '03'.

month = 'March'.

WHEN '04'.

month = 'April'.

WHEN '05'.

month = 'May'.

WHEN '06'.

month = 'June'.

WHEN '07'.

month = 'July'.

WHEN '08'.

month = 'August'.

WHEN '09'.

month = 'September'.

WHEN '10'.

month = 'October'.

WHEN '11'.

month = 'November'.

WHEN '12'.

month = 'December'.

WHEN OTHERS.

ENDCASE.

CONCATENATE month invoice_date6(2) ',' invoice_date0(4)

INTO datum_text SEPARATED BY space.

Former Member
0 Kudos

hi

DATA: ZTEMP(9),ZMONTH(15), ZDD(2), ZMMM(15),ZYYYY(4),

INPUTDATE TYPE SY-DATUM VALUE '20080101'.

DATA field(8) TYPE c.

CLEAR: ZTEMP, ZDD, ZMMM, ZYYYY.

CALL FUNCTION 'CONVERSION_EXIT_IDATE_OUTPUT'

EXPORTING

INPUT = sy-datum

IMPORTING

OUTPUT = ZTEMP.

ZDD = ZTEMP+3(2).

ZMMM = ZTEMP+0(3).

ZYYYY = ZTEMP+5(4).

CASE ZMMM.

WHEN 'JAN'.

ZMONTH = 'JAN'.

WHEN 'FEB'.

ZMONTH = 'FEB'.

WHEN 'MAR'.

ZMONTH = 'MAR'.

WHEN 'APR'.

ZMONTH = 'APR'.

WHEN 'MAY'.

ZMONTH = 'MAY'.

WHEN 'JUN'.

ZMONTH = 'JUN'.

WHEN 'JUL'.

ZMONTH = 'JUL'.

WHEN 'AUG'.

ZMONTH = 'AUG'.

WHEN 'SEP'.

ZMONTH = 'SEP'.

WHEN 'OCT'.

ZMONTH = 'OCT'.

WHEN 'NOV'.

ZMONTH = 'NOV'.

WHEN 'DEC'

ZMONTH = 'DEC'.

ENDCASE.

concatenate ZDD ' - ' ZMONTH ' - ' ZYYYY into ZDATE.

Regards

vachana

former_member196280
Active Contributor
0 Kudos

Try either one of this two.

/: SET DATE MASK = 'MMMM DD, YYYY'

OR

USe FM CONVERT_DATE_TO_EXTERNAL

Rgds,

SaiRam

Former Member
0 Kudos

Hi,

To covert the month to its name please use program lines to get the name of the month in a variable of type FCLTX declared in the global definitions.

in the program lines write...

SELECT SINGLE ltx FROM t247

INTO invoice_month_long

WHERE spras = nast-spras

AND mnr = date+4(2).

then in the text node

print with offset

&invoice_month_long+0(3)&

Regards,

Ram

Former Member
0 Kudos

Hi,

Use offsets like below.

&date6(2)& - &date4(2)& - &date+0(4)&

Regards,

Ram

Former Member
0 Kudos

Thanks for this coding