SAP DATUMSAUFBEREITUNG Function Module for Country-specific date formatting
DATUMSAUFBEREITUNG is a standard datumsaufbereitung SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Country-specific date formatting processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.
See here to view full function module documentation and code listing for datumsaufbereitung FM, simply by entering the name DATUMSAUFBEREITUNG into the relevant SAP transaction such as SE37 or SE38.
Function Group: DATD
Program Name: SAPLDATD
Main Program: SAPLDATD
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function DATUMSAUFBEREITUNG pattern details
In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.CALL FUNCTION 'DATUMSAUFBEREITUNG'"Country-specific date formatting.
EXPORTING
* FLAGM = ' ' "Indicator whether the month of dat
* FLAGW = ' ' "Indicator whether the week of date
* IDATE = SY-DATUM "Date in the form YYYYMMDD
* IMONT = ' ' "Date in the form YYYYMM
* IWEEK = ' ' "Date in the form YYYYWW
IMPORTING
MDAT4 = "
MDAT6 = "
TDAT4 = "
TDAT6 = "
TDAT8 = "
WDAT4 = "
WDAT6 = "
EXCEPTIONS
DATFM_UNGUELTIG = 1 DATUM_UNGUELTIG = 2
IMPORTING Parameters details for DATUMSAUFBEREITUNG
FLAGM - Indicator whether the month of dat
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
FLAGW - Indicator whether the week of date
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
IDATE - Date in the form YYYYMMDD
Data type: CALE-YYYYMMDDDefault: SY-DATUM
Optional: Yes
Call by Reference: No ( called with pass by value option)
IMONT - Date in the form YYYYMM
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
IWEEK - Date in the form YYYYWW
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for DATUMSAUFBEREITUNG
MDAT4 -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
MDAT6 -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
TDAT4 -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
TDAT6 -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
TDAT8 -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WDAT4 -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WDAT6 -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
DATFM_UNGUELTIG - Date format is invalid
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
DATUM_UNGUELTIG - Date is invalid
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for DATUMSAUFBEREITUNG Function Module
The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.| DATA: | ||||
| lv_flagm | TYPE STRING, " SPACE | |||
| lv_mdat4 | TYPE STRING, " | |||
| lv_datfm_ungueltig | TYPE STRING, " | |||
| lv_flagw | TYPE STRING, " SPACE | |||
| lv_mdat6 | TYPE STRING, " | |||
| lv_datum_ungueltig | TYPE STRING, " | |||
| lv_idate | TYPE CALE-YYYYMMDD, " SY-DATUM | |||
| lv_tdat4 | TYPE CALE, " | |||
| lv_imont | TYPE CALE, " SPACE | |||
| lv_tdat6 | TYPE CALE, " | |||
| lv_iweek | TYPE CALE, " SPACE | |||
| lv_tdat8 | TYPE CALE, " | |||
| lv_wdat4 | TYPE CALE, " | |||
| lv_wdat6 | TYPE CALE. " |
|   CALL FUNCTION 'DATUMSAUFBEREITUNG' "Country-specific date formatting |
| EXPORTING | ||
| FLAGM | = lv_flagm | |
| FLAGW | = lv_flagw | |
| IDATE | = lv_idate | |
| IMONT | = lv_imont | |
| IWEEK | = lv_iweek | |
| IMPORTING | ||
| MDAT4 | = lv_mdat4 | |
| MDAT6 | = lv_mdat6 | |
| TDAT4 | = lv_tdat4 | |
| TDAT6 | = lv_tdat6 | |
| TDAT8 | = lv_tdat8 | |
| WDAT4 | = lv_wdat4 | |
| WDAT6 | = lv_wdat6 | |
| EXCEPTIONS | ||
| DATFM_UNGUELTIG = 1 | ||
| DATUM_UNGUELTIG = 2 | ||
| . " DATUMSAUFBEREITUNG | ||
ABAP code using 7.40 inline data declarations to call FM DATUMSAUFBEREITUNG
The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.| DATA(ld_flagm) | = ' '. | |||
| DATA(ld_flagw) | = ' '. | |||
| "SELECT single YYYYMMDD FROM CALE INTO @DATA(ld_idate). | ||||
| DATA(ld_idate) | = SY-DATUM. | |||
| DATA(ld_imont) | = ' '. | |||
| DATA(ld_iweek) | = ' '. | |||
Search for further information about these or an SAP related objects