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 in smartform

Former Member
0 Likes
3,261

hello guys,

in a smartform i want to have a date ina format <date nameof the month and year>

for example:

25 august 2008

how can i do that...plz help me

regds

hello guys,

in a smartform i want to have a date ina format <date nameof the month and year>

for example:

25 august 2008

how can i do that...plz help me

regds

11 REPLIES 11
Read only

Former Member
0 Likes
1,928

Below info is from "SAP Smart Forms (BC-SRV-SCR) material"

"&SFSY-DATE& Displays the date. You determine the display format in the user master record."

Read only

0 Likes
1,928

when u say &sfsy-datum& it displays in 24.08.2007....but i need that month saying <august> instead of number...

Any helps plz......

rgds

Read only

0 Likes
1,928

If your problem is getting the names of the months you can use MONTH_NAMES_GET (or CASE statement)

Read only

Former Member
0 Likes
1,928

Hi,

do this...

in the text element give.

set date mask '__/___/____'

v_date

Read only

0 Likes
1,928

Hey use this it is working for me..

/: SET DATE MASK = 'DD.MMM.YYYY'

&SY-DATUM&

<a href="http://www.howforge.com/date-mask-template-in-command-set-date-mask-for-sapscript">Date Mask</a>

Read only

0 Likes
1,928

its not working.....:(

Read only

Former Member
0 Likes
1,928

Hi Sudheer,

You can write this in code, where ever you want just write the code in that window,

use FM MONTH_NAMES_GET to get the month name,just write the simple code, you will get the Date format as you want

Regards,

KK

Read only

Former Member
0 Likes
1,928

Hi,

In your smart form, before you display date, create Program Lines & write following code in it. I hope it will solve your problem. For e.g. lets consider v_datum contains the date before conversion and v_date contains the date after conversion.


DATA : x_t247  TYPE t247,
       v_datum TYPE sy-datum VALUE '20070823',
       v_date  TYPE string,
       v_month TYPE fcktx.
 
SELECT SINGLE ktx
  FROM t247
  INTO v_month
  WHERE spras = sy-langu
    AND mnr   = v_datum+4(2).
 
CONCATENATE sy-datum+6(2) v_month sy-datum+0(4) INTO v_date.

Here, if v_datum has a value '20070823', v_date will contain '23 Aug 2007'.

Reward points if the answer is helpful.

Regards,

Mukul

Read only

0 Likes
1,928

hI mk,

its giving the error saying V_date is not defined and V_date is not declared in data statement

Read only

former_member188827
Active Contributor
0 Likes
1,928

declare v_date in global data tab of smartform

and in import and export parameters also use v_date

reward points if it helps

Message was edited by:

abapuser

Read only

0 Likes
1,928

now it says v_date has no defined value