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 for date

Former Member
0 Likes
877

hi all,

plz tell me the function module to get the date field in below format 'mmm-dd-yyyy' ?

thank u

1 ACCEPTED SOLUTION
Read only

naimesh_patel
Active Contributor
0 Likes
811

Check this FM: CONVERSION_EXIT_IDATE_OUTPUT

It will return you a date in 'MMMDDYYYY' format.

Regards,

Naimesh Patel

7 REPLIES 7
Read only

naimesh_patel
Active Contributor
0 Likes
812

Check this FM: CONVERSION_EXIT_IDATE_OUTPUT

It will return you a date in 'MMMDDYYYY' format.

Regards,

Naimesh Patel

Read only

0 Likes
811

then how to get that out put into this format MMM-DD-YYYY?

Read only

0 Likes
811

Try like this:


REPORT  ZTEST_NP.

DATA : I_DATE(09) ,
       L_DATE(12).

CALL FUNCTION 'CONVERSION_EXIT_IDATE_OUTPUT'
  EXPORTING
    INPUT  = SY-DATUM
  IMPORTING
    OUTPUT = I_DATE.
CONCATENATE I_DATE+0(3) I_DATE+3(2) I_DATE+5(4) INTO L_DATE
SEPARATED BY '-'.

WRITE : L_DATE.

Regards,

Naimesh Patel

Read only

Former Member
0 Likes
811

Hi,

You can use the FM CONVERSION_EXIT_PDATE_OUTPUT

Thanks,

Sriram Ponna.

Read only

Former Member
0 Likes
811

Hi Sunil,

Use FM CONVERSION_EXIT_SDATE_OUTPUT to convert date to dd.mmm.yyyy (date_out) format.

Pass date in yyyymmdd format.

concatenate date_out3(3) '-' date_out0(2) '-' date_out+7(4) into date_output.

Lokesh

Read only

Former Member
0 Likes
811

try this...

DATA : DATE TYPE char20.

CALL FUNCTION 'CONVERSION_EXIT_IDATE_OUTPUT'

EXPORTING

input = sy-datum

IMPORTING

OUTPUT = date

.

CONCATENATE DATE2(3) DATE0(2) DATE+5(4) INTO DATE

SEPARATED BY '-'.

WRITE : DATE.

Read only

Former Member
0 Likes
811

Hi,

Try this code.

DATA: DATE_CHAR(20).

DATA: DATE TYPE SY-DATUM.

DATA: MONTH_NAME LIKE T247-KTX.

DATE = SY-DATUM.

SELECT SINGLE KTX 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.

Reward if helpful.

Regards,

Harini.S