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 function module for certain format

Former Member
0 Likes
1,165

Hi all,

My requirement is to print thae date in following format .

Tuesday, April 15, 2008

Is there any function module for the same?

Or i ll have to write the code for the same.

Please gimme the logic for the same.

Points will be rewarded .

Thanks in advance,

Amruta.

4 REPLIES 4
Read only

Former Member
0 Likes
757

Use FM: CONVERSION_EXIT_LDATE_OUTPUT for your requirement.

Regards,

Dara.

Read only

Former Member
0 Likes
757

Hi,

Use FM CONVERSION_EXIT_LDATE_OUTPUT.

Put input date as YYYYMMDD. You shoud get the desired output.

Regards,

Lalit

Read only

Former Member
0 Likes
757

you can use two fn modules . Here I am giving some example code it may be helpful for you

data : dateout(30),

day like DTRESR-WEEKDAY .

parameters : p_date like sy-datum.

CALL FUNCTION 'CONVERSION_EXIT_LDATE_OUTPUT'

EXPORTING

INPUT = p_date

IMPORTING

OUTPUT = dateout .

CALL FUNCTION 'DATE_TO_DAY'

EXPORTING

DATE = p_date

IMPORTING

WEEKDAY = day

.

.

write : / day , dateout.

Read only

Former Member
0 Likes
757

Hi Amruta,

the below FM definitely gives you the perfect solution.

Use the FM as below..

data:

l_wa_date type casdayattr,

l_i_date type standard table of casdayattr initial size 0.

call function 'DAY_ATTRIBUTES_GET'

exporting

date_from = sy-datum

date_to = sy-datum

language = sy-langu

tables

day_attributes = i_date

exceptions

factory_calendar_not_found = 1

holiday_calendar_not_found = 2

date_has_invalid_format = 3

date_inconsistency = 4

others = 5.

after executing this code you will get the day, month and year of SY-DATUM in the table i_date. Then use below code....

read table l_i_date into l_wa_date index 1.

in the 'l_wa_date' use the 'day_string' which has string as 'Monday, July 07, 2008'.

Please rewards if it helps....