SAP Function RP_FORMATING_DATE - Edit and text date

Parameter Reference Type Length Default Optional Text
BIRTH_DATE 0 'X' X Indicator Whether Date Is Birth Date
DATE_I 0 Date for Formatting

Parameter Reference Type Length Text
DATE_O 0 Formatted Date (YYYYMMDD)

Exception Text
DATE_INVALID Entered Date Is Incorrect

Functionality
A date can be entered in several meaningful formats (for example,dd.mm.yyyy, d.m.yy, ddmmyyyy, yy/mm/dd, mm-dd-yyyy)
The function module recognizes the different formats and outputs thedate in the format yyyymmdd.
If two numbers exist for the year, and the indicator BIRTH_DATEis set to 'X' (default), either 20YY or 19YY is output dependingon the system date (no conversion in the future). It the indicatorBIRTH_DATE is set to SPACE, the year is converted according tothe ususal method (YY < 50 -> 20YY, YY >= 50 -> 19YY).
If an incorrect entry is made, the exception DATE_INVALID istriggered.
Important: This module does not catch all possible incorrectentries. In addition, use the function module RP_CHECK_DATE.

Example
10021983 --> 19830210
2.12.1994 --> 19941202
23.031965 --> 19650323
1967/06/4 --> 19670604
12A051996 --> DATE_INVALID
234-1-87 --> DATE_INVALID
17.04.05 --> 19050417 if SY-DATE < 17.04.2005 (BIRTH_DATE = 'X')
--> 20050417 if SY-DATE >= 17.04.2005 (BIRTH_DATE = 'X')
--> 20050417 if BIRTH_DATE is set to SPACE.

Notes