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
714

If the date is 01-01-08 , i want the output as Jan 01, 2008.

How can i get this ?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
691

Hi,

MONTH_NAMES_GET

Regards

Nicole

8 REPLIES 8
Read only

peter_ruiz2
Active Contributor
0 Likes
691

hi,

retrieve the 3-char month name from table t009c and use it to concatenate with the year and date to achieve your requirement

regards,

Peter

Read only

0 Likes
691

T009c is a pooled table naaa ?

Read only

Former Member
0 Likes
692

Hi,

MONTH_NAMES_GET

Regards

Nicole

Read only

Former Member
0 Likes
691

Hi,

Try this code.

DATA: day(2) TYPE c,

month(2) TYPE c,

month_in_words(3) TYPE c,

year(4) TYPE c,

delimiter(1) TYPE c VALUE '-',

date(10) TYPE c,

altered_date(10) TYPE c.

date = '01-01-2008'.

SPLIT date AT delimiter INTO day month year.

CASE month.

WHEN '01'.

month_in_words = 'JAN'.

WHEN '02'.

month_in_words = 'FEB'.

WHEN '03'.

month_in_words = 'MAR'.

WHEN '04'.

month_in_words = 'APR'.

*< continue this till when '12' >

ENDCASE.

CONCATENATE month_in_words space day ',' year INTO altered_date.

WRITE: altered_date.

Reward if Helpful.

Read only

Former Member
0 Likes
691

Dear,

Use below code to get the monthg name and u can concatenate again what are the format u want.

concatenate date0(2) date3(2) date+6(4) to date1.

CALL FUNCTION 'ISP_GET_MONTH_NAME'

EXPORTING

DATE = DATE1

LANGUAGE = 'EN'

  • MONTH_NUMBER = '00'

IMPORTING

  • LANGU_BACK =

LONGTEXT = MONTH1

SHORTTEXT = MONTH2

  • EXCEPTIONS

  • CALENDAR_ID = 1

  • DATE_ERROR = 2

  • NOT_FOUND = 3

  • WRONG_INPUT = 4

  • OTHERS = 5

Thanks and Regards,

Edited by: chandra madapati on Jul 9, 2008 1:15 PM

Read only

Former Member
0 Likes
691

Hi,

MONTH_NAMES_GET -It returns all the month and names in repective language and

refer to the link below to have a look at the other FM

http://www.erpgenie.com/abap/functions.htm

regards

pritam.

Read only

Former Member
0 Likes
691

Hi Manjunath CN,

Here i am assuming that input date format is DD-MM-YY

If not then modify it according to ur need...

REPORT ZILESH_TEST_DATE_FORMAT.

DATA : LCDATE_IN(8),
      LCDATE_OUT(13),
      DD(2),
      MM(2),
      YY(2),
      LCDATE_IN2 LIKE SY-DATUM.


LCDATE_IN = '13-01-08'.

DD = LCDATE_IN+0(2).
MM = LCDATE_IN+3(2).
YY = LCDATE_IN+6(2).

CONCATENATE '20' YY MM  DD INTO LCDATE_IN2.


CALL FUNCTION 'CONVERSION_EXIT_IDATE_OUTPUT'
  EXPORTING
    INPUT  = LCDATE_IN2
  IMPORTING
    OUTPUT = LCDATE_OUT.

CONCATENATE  LCDATE_OUT+2(3) LCDATE_OUT(2) ',' LCDATE_OUT+5(4) INTO LCDATE_OUT SEPARATED BY SPACE.

WRITE : / LCDATE_OUT.

Hope it will solve your problem..

Thanks & Regards

ilesh 24x7

Read only

Former Member
0 Likes
691

Hi ,

you can get the month descrption in table T247 based on month number.

Regards,

kv.