SAP DD_MESSAGE_LOG Function Module for Log writer for Data Dictionary
DD_MESSAGE_LOG is a standard dd message log SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Log writer for Data Dictionary 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 dd message log FM, simply by entering the name DD_MESSAGE_LOG into the relevant SAP transaction such as SE37 or SE38.
Function Group: SDP1
Program Name: SAPLSDP1
Main Program:
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function DD_MESSAGE_LOG 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 'DD_MESSAGE_LOG'"Log writer for Data Dictionary.
EXPORTING
ERRLIST = "Bit string for different error cat
PAR2 = "Variable 2 for message to be writt
PAR3 = "Variable 3 for message to be writt
PAR4 = "Variable 4 for message to be writt
* PROTMODUS = 'A' "Mode of log writer (OPEN, close...
PROTOCOL = "Name of log
* PRTTYPE = 'D' "Category of log (D=DB, F=File)
SEVERITY = "Weighting of message to be written
ERRNUM = "Error category
LANGU = "Language of message to be written
LEVEL = "Log level
MESSID = "Application area of message to be
MESSNR = "Number of message to be written
MSTR_LANGU = "Substitute language
NEWOBJ = "New object to be logged
PAR1 = "Variable 1 for message to be writt
IMPORTING
LCOUNT = "Current line number within the log
MESSFLAG = "Flag whether the error itself is d
TABLES
MESS_TAB = "Table with all written messages
EXCEPTIONS
FILE_NOT_FOUND = 1 WRONG_ERRNUM = 2 WRONG_PROTMODUS = 3 WRONG_PROTTYPE = 4
IMPORTING Parameters details for DD_MESSAGE_LOG
ERRLIST - Bit string for different error cat
Data type: DDPRT-ERRLISTOptional: No
Call by Reference: No ( called with pass by value option)
PAR2 - Variable 2 for message to be writt
Data type: DDPRT-PAR2Optional: No
Call by Reference: No ( called with pass by value option)
PAR3 - Variable 3 for message to be writt
Data type: DDPRT-PAR3Optional: No
Call by Reference: No ( called with pass by value option)
PAR4 - Variable 4 for message to be writt
Data type: DDPRT-PAR4Optional: No
Call by Reference: No ( called with pass by value option)
PROTMODUS - Mode of log writer (OPEN, close...
Data type: DDPRT_I-PROTMODUSDefault: 'A'
Optional: Yes
Call by Reference: No ( called with pass by value option)
PROTOCOL - Name of log
Data type: DDPRT_I-PROTOCOLOptional: No
Call by Reference: No ( called with pass by value option)
PRTTYPE - Category of log (D=DB, F=File)
Data type: DDPRT_I-PRTTYPEDefault: 'D'
Optional: Yes
Call by Reference: No ( called with pass by value option)
SEVERITY - Weighting of message to be written
Data type: DDPRT-SEVERITYOptional: No
Call by Reference: No ( called with pass by value option)
ERRNUM - Error category
Data type: DDPRT-ERRNUMOptional: No
Call by Reference: No ( called with pass by value option)
LANGU - Language of message to be written
Data type: DDPRT-LANGUOptional: No
Call by Reference: No ( called with pass by value option)
LEVEL - Log level
Data type: DDPRT-LEVELOptional: No
Call by Reference: No ( called with pass by value option)
MESSID - Application area of message to be
Data type: DDPRT-MESSIDOptional: No
Call by Reference: No ( called with pass by value option)
MESSNR - Number of message to be written
Data type: DDPRT-MESSNROptional: No
Call by Reference: No ( called with pass by value option)
MSTR_LANGU - Substitute language
Data type: DDPRT_I-MSTR_LANGUOptional: No
Call by Reference: No ( called with pass by value option)
NEWOBJ - New object to be logged
Data type: DDPRT-NEWOBJOptional: No
Call by Reference: No ( called with pass by value option)
PAR1 - Variable 1 for message to be writt
Data type: DDPRT-PAR1Optional: No
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for DD_MESSAGE_LOG
LCOUNT - Current line number within the log
Data type: DDPRT_I-LCOUNTOptional: No
Call by Reference: No ( called with pass by value option)
MESSFLAG - Flag whether the error itself is d
Data type: DDPRT_I-MESSFLAGOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for DD_MESSAGE_LOG
MESS_TAB - Table with all written messages
Data type: DDPRTOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
FILE_NOT_FOUND - File could not be opened
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_ERRNUM - Error category not allowed
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_PROTMODUS - Mode for log writer, not allowed
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_PROTTYPE - Log category not allowed
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for DD_MESSAGE_LOG 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_lcount | TYPE DDPRT_I-LCOUNT, " | |||
| lv_errlist | TYPE DDPRT-ERRLIST, " | |||
| lt_mess_tab | TYPE STANDARD TABLE OF DDPRT, " | |||
| lv_file_not_found | TYPE DDPRT, " | |||
| lv_par2 | TYPE DDPRT-PAR2, " | |||
| lv_par3 | TYPE DDPRT-PAR3, " | |||
| lv_par4 | TYPE DDPRT-PAR4, " | |||
| lv_protmodus | TYPE DDPRT_I-PROTMODUS, " 'A' | |||
| lv_protocol | TYPE DDPRT_I-PROTOCOL, " | |||
| lv_prttype | TYPE DDPRT_I-PRTTYPE, " 'D' | |||
| lv_severity | TYPE DDPRT-SEVERITY, " | |||
| lv_errnum | TYPE DDPRT-ERRNUM, " | |||
| lv_messflag | TYPE DDPRT_I-MESSFLAG, " | |||
| lv_wrong_errnum | TYPE DDPRT_I, " | |||
| lv_langu | TYPE DDPRT-LANGU, " | |||
| lv_wrong_protmodus | TYPE DDPRT, " | |||
| lv_level | TYPE DDPRT-LEVEL, " | |||
| lv_wrong_prottype | TYPE DDPRT, " | |||
| lv_messid | TYPE DDPRT-MESSID, " | |||
| lv_messnr | TYPE DDPRT-MESSNR, " | |||
| lv_mstr_langu | TYPE DDPRT_I-MSTR_LANGU, " | |||
| lv_newobj | TYPE DDPRT-NEWOBJ, " | |||
| lv_par1 | TYPE DDPRT-PAR1. " |
|   CALL FUNCTION 'DD_MESSAGE_LOG' "Log writer for Data Dictionary |
| EXPORTING | ||
| ERRLIST | = lv_errlist | |
| PAR2 | = lv_par2 | |
| PAR3 | = lv_par3 | |
| PAR4 | = lv_par4 | |
| PROTMODUS | = lv_protmodus | |
| PROTOCOL | = lv_protocol | |
| PRTTYPE | = lv_prttype | |
| SEVERITY | = lv_severity | |
| ERRNUM | = lv_errnum | |
| LANGU | = lv_langu | |
| LEVEL | = lv_level | |
| MESSID | = lv_messid | |
| MESSNR | = lv_messnr | |
| MSTR_LANGU | = lv_mstr_langu | |
| NEWOBJ | = lv_newobj | |
| PAR1 | = lv_par1 | |
| IMPORTING | ||
| LCOUNT | = lv_lcount | |
| MESSFLAG | = lv_messflag | |
| TABLES | ||
| MESS_TAB | = lt_mess_tab | |
| EXCEPTIONS | ||
| FILE_NOT_FOUND = 1 | ||
| WRONG_ERRNUM = 2 | ||
| WRONG_PROTMODUS = 3 | ||
| WRONG_PROTTYPE = 4 | ||
| . " DD_MESSAGE_LOG | ||
ABAP code using 7.40 inline data declarations to call FM DD_MESSAGE_LOG
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.| "SELECT single LCOUNT FROM DDPRT_I INTO @DATA(ld_lcount). | ||||
| "SELECT single ERRLIST FROM DDPRT INTO @DATA(ld_errlist). | ||||
| "SELECT single PAR2 FROM DDPRT INTO @DATA(ld_par2). | ||||
| "SELECT single PAR3 FROM DDPRT INTO @DATA(ld_par3). | ||||
| "SELECT single PAR4 FROM DDPRT INTO @DATA(ld_par4). | ||||
| "SELECT single PROTMODUS FROM DDPRT_I INTO @DATA(ld_protmodus). | ||||
| DATA(ld_protmodus) | = 'A'. | |||
| "SELECT single PROTOCOL FROM DDPRT_I INTO @DATA(ld_protocol). | ||||
| "SELECT single PRTTYPE FROM DDPRT_I INTO @DATA(ld_prttype). | ||||
| DATA(ld_prttype) | = 'D'. | |||
| "SELECT single SEVERITY FROM DDPRT INTO @DATA(ld_severity). | ||||
| "SELECT single ERRNUM FROM DDPRT INTO @DATA(ld_errnum). | ||||
| "SELECT single MESSFLAG FROM DDPRT_I INTO @DATA(ld_messflag). | ||||
| "SELECT single LANGU FROM DDPRT INTO @DATA(ld_langu). | ||||
| "SELECT single LEVEL FROM DDPRT INTO @DATA(ld_level). | ||||
| "SELECT single MESSID FROM DDPRT INTO @DATA(ld_messid). | ||||
| "SELECT single MESSNR FROM DDPRT INTO @DATA(ld_messnr). | ||||
| "SELECT single MSTR_LANGU FROM DDPRT_I INTO @DATA(ld_mstr_langu). | ||||
| "SELECT single NEWOBJ FROM DDPRT INTO @DATA(ld_newobj). | ||||
| "SELECT single PAR1 FROM DDPRT INTO @DATA(ld_par1). | ||||
Search for further information about these or an SAP related objects