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: 

what to convert date format into April 16,2007. in smatform

Former Member
0 Kudos

wantto convert date format into April 16,2007. from the system date in smartforms , can any one write code for the above quration

example system date is 05/05/2007(any format) into April 16,2007.

2 REPLIES 2

Former Member
0 Kudos

Hi,

Check out this code ... might be of some help


DATA: V_INPUT(8) VALUE '20112006'.

DATA: V_CHAR(25).

data: date type sydatum.
DATA: MONTH_NAMES LIKE T247.

SELECT SINGLE * FROM T247
INTO MONTH_NAMES
WHERE SPRAS = SY-LANGU
AND MNR = V_INPUT+2(2).


CONCATENATE V_INPUT(2) MONTH_NAMES-KTX V_INPUT+4(4)
INTO V_CHAR SEPARATED BY SPACE.

write: / V_CHAR.

Regards,

Santosh

ferry_lianto
Active Contributor
0 Kudos

Hi,

Please check Rich's sample code.


report zrich_0001.

data: it247 type table of t247 with header line.
data: output type string.
 
parameters: p_datum type sy-datum.
 
call function 'MONTH_NAMES_GET'
     tables
          month_names = it247.
 
read table it247 with key mnr = sy-datum+4(2).
 
 
concatenate it247-ltx 'X' sy-datum+6(2) ',' 'X' sy-datum+0(4)
     into output.
translate output using 'X '.
 
write:/ output.

Regards,

Ferry Lianto