SAP Function Modules

MESSAGE_ADD_TO_PROTOCOL SAP Function module







MESSAGE_ADD_TO_PROTOCOL is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name MESSAGE_ADD_TO_PROTOCOL into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: SLOG
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM MESSAGE_ADD_TO_PROTOCOL - MESSAGE ADD TO PROTOCOL





CALL FUNCTION 'MESSAGE_ADD_TO_PROTOCOL' "
  EXPORTING
*   close_file = SPACE          " sprot_i-xfeld  Flag: close file at end (X)
*   condense = 'X'              " sprot_i-xfeld
    file =                      " sprot_i-prot  complete file name (incl. director
*   master_langu = 'E'          " t100-sprsl    Replacement language
*   open_file = SPACE           " sprot_i-xfeld  Flag: open file at the start (X)
  TABLES
    xmsg =                      " sprot_u       Table of messages
  EXCEPTIONS
    FILE_NOT_FOUND = 1          "               Access to the file was not possibl
    WRONG_CALL = 2              "               incorrect call
    .  "  MESSAGE_ADD_TO_PROTOCOL

ABAP code example for Function Module MESSAGE_ADD_TO_PROTOCOL





The ABAP code below is a full code listing to execute function module MESSAGE_ADD_TO_PROTOCOL including all data declarations. The code uses 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 original method of declaring data variables up front. 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).

DATA:
it_xmsg  TYPE STANDARD TABLE OF SPROT_U,"TABLES PARAM
wa_xmsg  LIKE LINE OF it_xmsg .


DATA(ld_close_file) = some text here

DATA(ld_condense) = some text here

DATA(ld_file) = some text here

SELECT single SPRSL
FROM T100
INTO @DATA(ld_master_langu).


DATA(ld_open_file) = some text here

"populate fields of struture and append to itab
append wa_xmsg to it_xmsg. . CALL FUNCTION 'MESSAGE_ADD_TO_PROTOCOL' EXPORTING * close_file = ld_close_file * condense = ld_condense file = ld_file * master_langu = ld_master_langu * open_file = ld_open_file TABLES xmsg = it_xmsg EXCEPTIONS FILE_NOT_FOUND = 1 WRONG_CALL = 2 . " MESSAGE_ADD_TO_PROTOCOL
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_close_file  TYPE SPROT_I-XFELD ,
it_xmsg  TYPE STANDARD TABLE OF SPROT_U ,
wa_xmsg  LIKE LINE OF it_xmsg,
ld_condense  TYPE SPROT_I-XFELD ,
ld_file  TYPE SPROT_I-PROT ,
ld_master_langu  TYPE T100-SPRSL ,
ld_open_file  TYPE SPROT_I-XFELD .


ld_close_file = some text here

"populate fields of struture and append to itab
append wa_xmsg to it_xmsg.

ld_condense = some text here

ld_file = some text here

SELECT single SPRSL
FROM T100
INTO ld_master_langu.


ld_open_file = some text here

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name MESSAGE_ADD_TO_PROTOCOL or its description.