Application Development 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: 

Smartform date format

Former Member
0 Kudos

I need to output  the system date to SmartForm in format Day, Month DD, YYYY (like Monday, March 11, 2015). Can any one give me a sample code on how to convert the date format


Thank you in advance.


Blue


2 REPLIES 2

deepan_v_s
Active Participant
0 Kudos

Hello,

There are two standard FM which can be used to achieve this.

FM - DATE_TO_DAY (Will give the name of the day based on date)

FM - MONTH_NAMES_GET (Will give name of month)

You can use string operations on date to get ,

1. Which day it is

2. Which Month

3. Which Year

For eg, 02.09.2015 - day - 02, month - 09, year - 2015.

Even the below link can help you,

Please use string operations to segregate the current date and send it to these FM's.

Hope it helps..

Regards,

Deepan Swaminathan.

former_member809980
Participant
0 Kudos

hi,

you can split the SY-DATUM variable into month day and year.

and pass the month number in SAP standard table t247 which gives you MONTH name.

arrange this variable as per your requirement on your smart form  layout.

for better understanding refer the logic

DATA : v_mon(2) TYPE n,

              v_date(10) VALUE '04.09.2007',

       v_ltx LIKE t247-ltx,

       v_ktx LIKE t247-ktx.

SELECT SINGLE ktx

              ltx

              INTO (v_ktx , v_ltx)

              FROM t247

              WHERE spras = sy-langu AND

                    mnr EQ v_date+3(2).

for this you need to define some global variable

Hope it helps