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

Former Member
0 Likes
589

hi,

how to convert the date format from internal to external and external to internal.

please provide the code for this.

thanks in advance...

4 REPLIES 4
Read only

gopi_narendra
Active Contributor
0 Likes
562

use the FM : CONVERT_DATE_TO_INTERNAL or CONVERT_DATE_TO_EXTERNAL

Regards

Gopi

Read only

Former Member
0 Likes
562
chk these


CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
      EXPORTING
        date_external            = fromdate
      IMPORTING
        date_internal            = date
      EXCEPTIONS
        date_external_is_invalid = 1
        OTHERS                   = 2.
    IF sy-subrc <> 0.
      MESSAGE e050(hrtim_abs_req).
    ENDIF.


CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'
 EXPORTING
   DATE_INTERNAL                  = VLDAT
 IMPORTING
   DATE_EXTERNAL                  = DATE
 EXCEPTIONS
   DATE_INTERNAL_IS_INVALID       = 1
   OTHERS                         = 2
Read only

Former Member
0 Likes
562

CONVERSION_EXIT_PDATE_INPUT

CONVERSION_EXIT_PDATE_OUTPUT

Regds, Murugesh AS

Read only

Former Member
0 Likes
562

Hi,

Have a look at these links:

<a href="http://sap.ittoolbox.com/code/archives.asp?d=3095&a=s&i=10">convert_date_to_internal FM</a>

<a href="http://www.allsapinfo.com/alvexamples.htm">convert_date_to_external</a>

Pls reward helpful points.

Regards,

Ameet.

Message was edited by:

Ameet Jassani