June 28, 2009

CONVERT_DATE_TO_EXTERNAL sap function module

The below code shows how function module CONVERT_DATE_TO_EXTERNAL is used to convert a date field from is internal storage format to the users specific display format i.e. from YYYYMMDD to DD/MM/YYYY.
Convert date to users prefered output 

data: ld_date_int type datum,
ld_date_ext type datum.

CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'
EXPORTING
date_internal = ld_date_int
IMPORTING
date_external = ld_date_ext
EXCEPTIONS
date_internal_is_invalid = 1
OTHERS = 2.

One of a function module is 'CONVERT_DATE_TO_INTERNAL'

2 comments:

  1. Thank you for the information. You have a very good article. I found it informative and useful. Keep up the good work and God bless!

    Caren
    www.gofastek.com

    ReplyDelete
  2. where did u specify the external format as DD/MM/YYYY?

    ReplyDelete