Application Development and Automation 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: 
Read only

DATE FORMAT

Former Member
0 Likes
815

Can anybody how to display a date in the format DD-MON-YYYY

(i.e. 18-APR-2007). Is their any functional module available?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
787

You should use this FM <b>MONTH_NAMES_GET</b> Field <b>KTX</b> got what you need -;)

Greetings,

Blag.

8 REPLIES 8
Read only

Former Member
0 Likes
788

You should use this FM <b>MONTH_NAMES_GET</b> Field <b>KTX</b> got what you need -;)

Greetings,

Blag.

Read only

Former Member
0 Likes
787

hi,

\Look at the Function modules CONVERT_DATE_TO_INTERNAL or CONVERT_DATE_TO_EXTERNAL.

like.....

data: v_date(8) type c.

call function 'CONVERT_DATE_TO_INTERNAL'

exporting

date_external = '12-12-2006'

importing

date_internal = v_date.

write:/ v_date.

If the aboe are not useful, then you need to do it manually. just take date, Month and year in 3 fields and concatenate the same into another date field with the correct format.

Mark the helpful answers

~~Guduri

Read only

Former Member
0 Likes
787
Date format definition in the user master:  DD.MM.YYYY


DATA:  INT_DATUM     LIKE SY-DATUM VALUE '19940102',
       EXT_DATUM(11) TYPE C.

     ...

CALL FUNCTION 'CONVERSION_EXIT_SDATE_OUTPUT'
     EXPORTING
         INPUT         = INT_DATUM
     IMPORTING
         OUTPUT        = EXT_DATUM.


Result:

EXT_DATUM = 02.JAN.1994
Read only

ferry_lianto
Active Contributor
0 Likes
787

Hi,

Please try this FM

CONVERSION_EXIT_SDATE_OUTPUT

CONVERSION_EXIT_IDATE_OUTPUT

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
787

Hi,

Use below logic for your requirement. let us say your input date is i_date of type D.

data : e_date_fmt type char11,

gt_247 like t247 occurs 0 with header line.

CLEAR e_date_fmt.

IF gt_247[] IS INITIAL.

SELECT * FROM t247

INTO TABLE gt_247.

SORT gt_247.

ENDIF.

READ TABLE gt_247

WITH KEY spras = sy-langu

mnr = i_date+4(2).

IF sy-subrc <> 0.

READ TABLE gt_247

WITH KEY spras = sy-langu

mnr = i_date+4(2).

ENDIF.

IF sy-subrc <> 0.

READ TABLE gt_247

WITH KEY spras = 'E'

mnr = i_date+4(2).

ENDIF.

IF sy-subrc = 0.

CONCATENATE i_date+6(2)

gt_247-ktx

i_date(4)

INTO e_date_fmt SEPARATED BY space.

ENDIF.

thanks,

sksingh

Read only

Former Member
0 Likes
787

try the fm

<b>CALL FUNCTION 'CONVERSION_EXIT_SDATE_OUTPUT'
     EXPORTING
         INPUT         = INT_DATUM
     IMPORTING
         OUTPUT        = EXT_DATUM.</b>

Read only

Former Member
0 Likes
787

Hi Rajesh..

Hi..paste this code..

data: w_dt like sy-datum.

w_dt = p_date. **given date**

w_month = w_dt+4(2).

w_year = w_dt+2(2).

case w_month.

when '01'.

w_mon = 'Jan'.

when '02'.

w_mon = 'Feb'.

when '03'.

w_mon = 'Mar'.

when '04'.

w_mon = 'Apr'.

when '05'.

w_mon = 'May'.

when '06'.

w_mon = 'Jun'.

when '07'.

w_mon = 'Jul'.

when '08'.

w_mon = 'Aug'.

when '09'.

w_mon = 'Sep'.

when '10'.

w_mon = 'Oct'.

when '11'.

w_mon = 'Nov'.

when '12'.

w_mon = 'Dec'.

endcase.

<b>concatenate w_dt6(2) '-' w_mon '-' w_dt0(4) into w_finaldate.</b>

Ram..

Read only

Former Member
0 Likes
787

hi,

if u have that in u r int table use below format.

declare variable and then send it.

concatenate itab-BUDAT6(2) Y_itab-BUDAT4(2)

itab-BUDAT+0(4) into cdate separated by '-'

Regards.

Praveen