‎2007 Feb 20 10:05 AM
Hi Experts,
I want to convert the date which is in the form of ' 01/02/2007' in to 'February,01th 2007' formate.
If any program you have please send it.
Kindly help me.
Thanks & Regard.
Ankur Garg.
Message was edited by:
Ankur Garg
‎2007 Feb 20 10:10 AM
‎2007 Feb 20 10:10 AM
‎2007 Feb 20 10:12 AM
check this
CONVERSION_EXIT_IDATE_OUTPUT
Test for Function Group SCA1
Function Module CONVERSION_EXIT_IDATE_OUTPUT
Import Parameters Value
INPUT 20061231
Export Parameters Value
OUTPUT 31DEC2006
Regards
Prabhu
‎2007 Feb 20 10:13 AM
Hi Ankur ,
Try this code,
<b>DATA: ZTEMP(9),ZDD(2),ZMMM(3),ZYYYY(4).
CLEAR: ZTEMP, ZDD, ZMMM, ZYYYY.
CALL FUNCTION 'CONVERSION_EXIT_IDATE_OUTPUT'
EXPORTING
INPUT = SY-DATUM
IMPORTING
OUTPUT = ZTEMP.
ZDD = ZTEMP+3(2).
ZMMM = ZTEMP+0(3).
ZYYYY = ZTEMP+5(4).
WRITE:/ ZTEMP</b>.
reward if useful.
‎2007 Feb 20 10:14 AM
‎2007 Feb 20 10:17 AM
Hi,
REPORT ZTEST_DATE.
DATA: gd_datetext TYPE string.
CASE sy-datum+4(2).
WHEN '01'.
gd_datetext = 'January'.
WHEN '02'.
gd_datetext = 'February'.
WHEN '03'.
gd_datetext = 'March'.
WHEN '04'.
gd_datetext = 'April'.
WHEN '05'.
gd_datetext = 'May'.
WHEN '06'.
gd_datetext = 'June'.
WHEN '07'.
gd_datetext = 'July'.
WHEN '08'.
gd_datetext = 'August'.
WHEN '09'.
gd_datetext = 'September'.
WHEN '10'.
gd_datetext = 'October'.
WHEN '11'.
gd_datetext = 'November'.
WHEN '12'.
gd_datetext = 'December'.
ENDCASE.
concatenate gd_datetext ',' sy-datum(2)'th' sy-datum(4) into
gd_datetext
separated by space.
write:/ gd_datetext.
Regards,
Sruthi
‎2007 Feb 20 10:18 AM
Run the below code to convert 01/02/2007 to
Febuary,01st 2007
REPORT zex36 .
*parameter : p_date like sy-datum.
parameter : p_date(10).
DATA: month(9),
year(4),
date(2),
ch(2).
data : return_date(20).
CASE p_date+3(2).
WHEN '01'.
month = 'January'.
WHEN '02'.
month = 'February'.
WHEN '03'.
month = 'March'.
WHEN '04'.
month = 'April'.
WHEN '05'.
month = 'May'.
WHEN '06'.
month = 'June'.
WHEN '07'.
month = 'July'.
WHEN '08'.
month = 'August'.
WHEN '09'.
month = 'September'.
WHEN '10'.
month = 'October'.
WHEN '11'.
month = 'November'.
WHEN '12'.
month = 'December'.
WHEN OTHERS.
ENDCASE.
WRITE p_date+6(4) TO year.
WRITE p_date+0(2) TO date.
case date.
when '01'. ch = 'st'.
when '21'. ch = 'st'.
when '31'. ch = 'st'.
when '02'. ch = 'nd'.
when '22'. ch = 'nd'.
when '03'. ch = 'rd'.
when '23'. ch = 'rd'.
when others. ch = 'th'.
endcase.
CONCATENATE month ',' date ch year INTO return_date.
SEPARATED BY space.
CONDENSE return_date.
write : / return_date.
‎2007 Feb 20 10:23 AM
Execute teh code with ur input.
report Zex13.
parameters : p_datum like sy-datum.
data : v_datum(24) type c ,
v_month(2) type c,
v_day(2) type c,
v_day1(4) type c,
v_year(4) type c.
data : mn(2) type c,
mtext(10) type c ,
tx(2) type c .
mn = p_datum+4(2).
select single ltx into mtext from t247 where mnr = mn and spras = 'E'.
write p_datum+0(4) to v_year.
write p_datum+4(2) to v_month.
write p_datum+6(2) to v_day.
case v_day.
when '01' or '31' or '21'.
tx = 'st'.
when '2' or '22' .
tx = 'nd'.
when '3' or '23' .
tx = 'rd'.
when others .
tx = 'th'.
endcase.
concatenate v_day tx into v_day1.
concatenate mtext ',' v_day1 v_year into v_datum separated by space.
write:/ v_datum.regards,
vijay
‎2007 Feb 20 10:37 AM