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

Function module

Former Member
0 Likes
696

Hi Experts ,

which FM can convert the date 12/12/2007 into 12-dec-07?

regs

Murthy

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
655

Hi Narayana,

Convert the date into INternal format by using Exit_internal

Use this Fm

CONVERSION_EXIT_SDATE_OUTPUT

and pass the below values

Import parameters Value

INPUT 20070704

Export parameters Value

OUTPUT 04.JUL.2007

(or)

EPORT ychatest.

DATA: int_datum LIKE sy-datum VALUE '20070705',

ext_datum(11) TYPE c.

CALL FUNCTION 'CONVERSION_EXIT_SDATE_OUTPUT'

EXPORTING

input = int_datum

IMPORTING

output = ext_datum.

TRANSLATE ext_datum USING '.-'.

WRITE : ext_datum.

Reward if helpful.

Regards,

Harini.S

5 REPLIES 5
Read only

Former Member
0 Likes
655

Hi,

Take the help from this code :

data : date(10),

text1(26),

num1(10),

test_day(15),

o_date(20),

idate type sy-datum.

data : Day(2), month(2), Year(4).

data : ODay(2), Omonth(2), OYear(4).

data : Ltext Type T247-LTX.

date = '12/12/2007'.

day = date+0(2).

month = date+3(2) + 1.

year = date+6(4).

concatenate year month day into idate.

CALL FUNCTION 'HR_IN_GET_DATE_COMPONENTS'

EXPORTING

idate = idate

IMPORTING

DAY = oday

MONTH = omonth

YEAR = oyear

LTEXT = ltext.

concatenate oday ltext oyear into o_date separated by SPACE.

write : O_date.

Regards,

Sandeep Kaushik

Read only

Former Member
0 Likes
655

hi

u can use edit mask in write statement, by using

write:/ var using '==IDATE' OR 'SDATE'

SURE U LL GET

Read only

Former Member
0 Likes
656

Hi Narayana,

Convert the date into INternal format by using Exit_internal

Use this Fm

CONVERSION_EXIT_SDATE_OUTPUT

and pass the below values

Import parameters Value

INPUT 20070704

Export parameters Value

OUTPUT 04.JUL.2007

(or)

EPORT ychatest.

DATA: int_datum LIKE sy-datum VALUE '20070705',

ext_datum(11) TYPE c.

CALL FUNCTION 'CONVERSION_EXIT_SDATE_OUTPUT'

EXPORTING

input = int_datum

IMPORTING

output = ext_datum.

TRANSLATE ext_datum USING '.-'.

WRITE : ext_datum.

Reward if helpful.

Regards,

Harini.S

Read only

Former Member
0 Likes
655

data : date like sy-datum.

data : odate(10) type c.

date = sy-datum. " in format YYYYMMDD

CALL FUNCTION 'CONVERSION_EXIT_PDATE_OUTPUT'

EXPORTING

input = date

IMPORTING

OUTPUT = odate .

write:/ odate. "in ur format '.

1.

In ur itab make a field for date as 10 characters and use this Fm to store the date .

2. Pass the date as the charcter field to the screen and now check .

Please give me reward points

Thanks

Murali Poli

Read only

Former Member
0 Likes
655

HI,

You can directly use <b>SET DATE MASK DD MMM YYYY</b>

Regards

Sudheer