Convert Date into Words

by Raghavan

REPORT YTEST LINE-SIZE 350.

 TABLES : T247. 

DATA : V_DATE LIKE SY-DATUM,

V_DATE_FULL(09),

V_MONTH(25),

V_FINAL(45). 

V_DATE = SY-DATUM. 

CALL FUNCTION 'CONVERSION_EXIT_IDATE_OUTPUT'

     EXPORTING

          INPUT  = V_DATE

     IMPORTING

          OUTPUT = V_DATE_FULL. 

SELECT SINGLE LTX FROM T247 INTO V_MONTH WHERE KTX EQ V_DATE_FULL+2(3)

AND SPRAS = 'E'. 

IF V_DATE_FULL+0(2) = '01' OR V_DATE_FULL+0(2) = '31'.

  CONCATENATE V_DATE_FULL+0(2) 'ST' INTO V_FINAL.

ELSEIF V_DATE_FULL+0(2) = '02' OR V_DATE_FULL+0(2) = '22'.

  CONCATENATE V_DATE_FULL+0(2) 'ND' INTO V_FINAL.

ELSEIF V_DATE_FULL+0(2) = '03' OR V_DATE_FULL+0(2) = '23'.

  CONCATENATE V_DATE_FULL+0(2) 'RD' INTO V_FINAL.

ELSE.

  CONCATENATE V_DATE_FULL+0(2) 'TH' INTO V_FINAL.

ENDIF. 

CONCATENATE V_FINAL V_MONTH INTO V_FINAL SEPARATED BY SPACE.

CONCATENATE V_FINAL V_DATE_FULL+5(4) INTO V_FINAL SEPARATED BY ','.

  WRITE : / V_FINAL.


 

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image