Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to display date in DD-MMM-YYYY format (31 AUG 2007)

Former Member
0 Kudos

Hi Experts,

How to display date in DD-MMM-YYYY format .

ex todays date 31/08/2007 in 31 AUG 2007

Regards,

Kali Pramod

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi kali,

1. simple

2. use the FM - CONVERSION_EXIT_SDATE_OUTPUT

regards,

amit m.

6 REPLIES 6

Former Member
0 Kudos

Hi kali,

1. simple

2. use the FM - CONVERSION_EXIT_SDATE_OUTPUT

regards,

amit m.

0 Kudos

thanks amit my problem is solved.. i have rewarded u full points

Former Member
0 Kudos

hi,

u have to select ktx from t247 (DDIC Table) .

SELECT SINGLE ktx INTO mon FROM t247 WHERE mnr = date+4(2) AND spras = 'E'.

and concatenate this mon to new dfate field.

former_member188827
Active Contributor
0 Kudos

data zdate type sy-datum.

data dat(2) type c.

data: zmn(2) type c, zmonth(15) type c, zyear(4) type c.

data zstring(25) type c.

dat = sy-datum+6(2).

zmn = sy-datum+4(2).

zyear = sy-datum+0(4).

data zmonth_int type table of t247 with header line.

CALL FUNCTION 'MONTH_NAMES_GET'

  • EXPORTING

  • LANGUAGE = SY-LANGU

  • IMPORTING

  • RETURN_CODE =

TABLES

MONTH_NAMES = zmonth_int

  • EXCEPTIONS

  • MONTH_NAMES_NOT_FOUND = 1

  • OTHERS = 2

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

loop at zmonth_int.

if zmonth_int-mnr = zmn.

zmonth = zmonth_int-ktx.

endif.

endloop.

concatenate dat zmnth zyear into zstring.

plz reward if it helps

Former Member
0 Kudos

Hi,

Its simple

use the FM - CONVERSION_EXIT_SDATE_OUTPUT .

Ok,

reward if useful.

Former Member
0 Kudos

Hi,

To my knowledge, we can't directly display the value as 31 AUG 2007. One way is to extract month value alone in your case '08'. Use case statement, in that assign if 08 = 'AUG'. Then display in write statement.

Also, try in ABAPHELP tcode, for the date formats using the following steps.

ABAP - The SAP Programming Language

ABAP - By Theme

User Dialogs

Lists

Create Lists

WRITE - int_format_options

Try and reward points if found useful.