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 Conversion ?

Former Member
0 Likes
860

hi All,

I want to convert date from this format 01/2007 to January 2007. Is there any FM for performing this operation.

regards,

Navneeth.K

9 REPLIES 9
Read only

Former Member
0 Likes
829

Hi,

u can use FM : <b>'CONVERSION_EXIT_PDATE_INPUT'</b>

<b>plz reward points if helpful or if it solves ur query.</b>

Thanks

Chinmay

Read only

Former Member
0 Likes
829

hi

Check this info.

Use function module CONVERT_DATE_TO_EXTERNAL. This will convert the date to the user specific format. So if your user specific format is MMM YYYY, then this is all you need.

Look at the function moduel MONTH_NAMES_GET It returns all the month and names in repective language

Hope this resolves your query.

Reward all the helpful answers.

Regards

Nilesh

Read only

Former Member
0 Likes
829
hi Naveen,

  Try this

REPORT ychatest1.

TABLES : t247.

DATA : v_date(7) VALUE '01/2007',
       v_ltx LIKE t247-ltx,
       v_date1(25).

SELECT SINGLE ltx FROM t247 INTO v_ltx WHERE mnr EQ v_date+0(2) AND spras EQ sy-langu.

CONCATENATE v_ltx v_date+3(4) INTO v_date1 SEPARATED BY space.

WRITE : / v_date1.
Read only

Former Member
0 Likes
829

hi,

try these fm's

CONVERSION_EXIT_LDATE_OUTPUT,

CONVERSION_EXIT_SDATE_OUTPUT,

CONV_EXIT_LDATE_OUTPUT_LANGU.

Read only

PS_1978
Active Participant
0 Likes
829

Hi Navneeth,

you can simply make use of offsets...

Example: v_date(7) type c,

v_year(4) type c.

v_year = v_date+3(4).

Regards,

Phani

Read only

Former Member
0 Likes
829

Hi navneeth,

1. using some logic and the FM MONTH_NAMES_GET

(for month names in full),

2. we can write some small program for same.

regards,

amit m.

Read only

Former Member
0 Likes
829

hi,

chk this.

DATA: DATE_CHAR(20).
DATA: DATE TYPE SY-DATUM.
DATA: MONTH_NAME LIKE T247-LTX.
DATE = SY-DATUM.

SELECT SINGLE LTX FROM T247
INTO MONTH_NAME
WHERE SPRAS = SY-LANGU
AND MNR = SY-DATUM+4(2).

CONCATENATE SY-DATUM+6(2) MONTH_NAME SY-DATUM(4)
INTO DATE_CHAR SEPARATED BY SPACE.

WRITE: / DATE_CHAR.


or use this FM

CACS_DATE_GET_YEAR_MONTH : To get the number of the month
MONTH_NAMES_GET: To get month description

Regards

Reshma

Read only

Former Member
0 Likes
829

REPORT test.

TABLES : t247.

DATA : v_date(7) VALUE '01/2007',

v_ltx LIKE t247-ltx,

v_date_final(30).

SELECT SINGLE ltx

FROM t247

INTO v_ltx

WHERE mnr EQ v_date+0(2)

AND spras EQ sy-langu.

CONCATENATE v_ltx v_date+3(4) INTO v_date1 SEPARATED BY space.

WRITE : / v_date_final.

Read only

Former Member
0 Likes
829

hi navneeth,

just copy and paste below code.

report zmahi9.

tables : t247.

data : itab like t247 occurs 0 with header line.

data : date like sy-datum,

vdate(15) type c.

parameter : v_date type t247-ltx default '01/2007'.

date = sy-datum+0(4).

select single * from t247

into itab.

concatenate itab-ltx date into vdate separated by space.

write : vdate.

thanks,

maheedhar.t