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 Format in Smartform

Former Member
0 Likes
1,071

Hi experts,

I want the date should be in the format 08-Jan-09.

Can u plz help me in this issue...

Regards

Ganesh Reddy

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
922

Hi Ganesh,

Try it this way, in the PROGRAM LINES of your SMARTFORMS do the below coding before you display the date:

data:
  g_date(12) type c.

call function 'CONVERSION_EXIT_SDATE_OUTPUT'
exporting
input  = sy-datum
importing
output = g_date.

replace all occurrences of '.' in g_date with '-'.

replace g_date+7(2) in g_date with space.

translate g_date+4(2) to lower case.

write:/
  g_date.

With luck,

Pritam.

Edited by: Pritam Ghosh on Jan 23, 2009 12:09 PM

5 REPLIES 5
Read only

Former Member
0 Likes
922

Use FM IDWT_READ_MONTH_TEXT to get Month text and concatenate date month text & year into a variable for display

Hope this helps...

Read only

former_member632458
Participant
0 Likes
922

hi,

try this code , in the concatenate give symbol '-' as well.

data : lv_mtext(10) type c.

data : lv_day(2) type c,

lv_mon(2) type c,

lv_year(4) type c.

lv_year = sy-datum+0(4).

lv_mon = sy-datum+4(2).

lv_day = sy-datum+6(2).

select single ltx into lv_mtext

from t247

where SPRAS = sy-langu

and mnr = lv_mon.

data : l_var1(15) type c,

l_var2(15) type c.

concatenate lv_mtext lv_day into l_var1 SEPARATED BY space.

concatenate ',' lv_year into l_var2 SEPARATED BY space.

concatenate l_var1 l_var2 into lv_date.

clear: lv_year,

lv_mon,

lv_day,

l_var1,

l_var2,

lv_mtext.

regards,

Rajesh S.

Read only

MarcinPciak
Active Contributor
0 Likes
922

Hi,

You can display it according by changing user display settings in SU01, or if you want it be always the same, use FM CONVERSION_EXIT_SDATE_OUTPUT Eg: input = 20070201 and output = 01.FEB.2007

Regards

Marcin

Read only

Former Member
0 Likes
922

use table T247 to get description of month...

use concatenate 'date' ' - ' 'month description' ' - ' 'year' into result.

Read only

Former Member
0 Likes
923

Hi Ganesh,

Try it this way, in the PROGRAM LINES of your SMARTFORMS do the below coding before you display the date:

data:
  g_date(12) type c.

call function 'CONVERSION_EXIT_SDATE_OUTPUT'
exporting
input  = sy-datum
importing
output = g_date.

replace all occurrences of '.' in g_date with '-'.

replace g_date+7(2) in g_date with space.

translate g_date+4(2) to lower case.

write:/
  g_date.

With luck,

Pritam.

Edited by: Pritam Ghosh on Jan 23, 2009 12:09 PM