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: 

date format

Former Member
0 Kudos

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

gopi_narendra
Active Contributor
0 Kudos

use the FM : CONVERT_DATE_TO_INTERNAL or CONVERT_DATE_TO_EXTERNAL

Regards

Gopi

Former Member
0 Kudos
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

former_member214131
Active Contributor
0 Kudos

CONVERSION_EXIT_PDATE_INPUT

CONVERSION_EXIT_PDATE_OUTPUT

Regds, Murugesh AS

former_member235056
Active Contributor
0 Kudos

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