SAP Function Modules

FPRL_MESSAGE_ADD SAP Function module - Add message







FPRL_MESSAGE_ADD 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 FPRL_MESSAGE_ADD into the relevant SAP transaction such as SE37 or SE80.

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


Pattern for FM FPRL_MESSAGE_ADD - FPRL MESSAGE ADD





CALL FUNCTION 'FPRL_MESSAGE_ADD' "Add message
  EXPORTING
    i_type =                    " bapireturn-type  Message type: S Success, E Error, W Warning, I Info, A Abort
    i_cl =                      " sy-msgid      Message Class
    i_number =                  " sy-msgno      Message Number
    i_par1 =                    " sy-msgv1      Message Variable
    i_par2 =                    " sy-msgv2      Message Variable
    i_par3 =                    " sy-msgv3      Message Variable
    i_par4 =                    " sy-msgv4      Message Variable
    i_parameter =               " bapiret2-parameter  Parameter Name
    i_row =                     " bapiret2-row  Lines in parameter
    i_field =                   " bapiret2-field  Field in parameter
  CHANGING
    et_messages =               " bapirettab    Table with BAPI Return Information
    .  "  FPRL_MESSAGE_ADD

ABAP code example for Function Module FPRL_MESSAGE_ADD





The ABAP code below is a full code listing to execute function module FPRL_MESSAGE_ADD 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(ld_et_messages) = 'Check type of data required'.

DATA(ld_i_type) = some text here
DATA(ld_i_cl) = 'some text here'.
DATA(ld_i_number) = 'Check type of data required'.
DATA(ld_i_par1) = 'some text here'.
DATA(ld_i_par2) = 'some text here'.
DATA(ld_i_par3) = 'some text here'.
DATA(ld_i_par4) = 'some text here'.

DATA(ld_i_parameter) = some text here

DATA(ld_i_row) = 123

DATA(ld_i_field) = some text here . CALL FUNCTION 'FPRL_MESSAGE_ADD' EXPORTING i_type = ld_i_type i_cl = ld_i_cl i_number = ld_i_number i_par1 = ld_i_par1 i_par2 = ld_i_par2 i_par3 = ld_i_par3 i_par4 = ld_i_par4 i_parameter = ld_i_parameter i_row = ld_i_row i_field = ld_i_field CHANGING et_messages = ld_et_messages . " FPRL_MESSAGE_ADD
IF SY-SUBRC EQ 0. "All OK 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_et_messages  TYPE BAPIRETTAB ,
ld_i_type  TYPE BAPIRETURN-TYPE ,
ld_i_cl  TYPE SY-MSGID ,
ld_i_number  TYPE SY-MSGNO ,
ld_i_par1  TYPE SY-MSGV1 ,
ld_i_par2  TYPE SY-MSGV2 ,
ld_i_par3  TYPE SY-MSGV3 ,
ld_i_par4  TYPE SY-MSGV4 ,
ld_i_parameter  TYPE BAPIRET2-PARAMETER ,
ld_i_row  TYPE BAPIRET2-ROW ,
ld_i_field  TYPE BAPIRET2-FIELD .

ld_et_messages = 'some text here'.

ld_i_type = some text here
ld_i_cl = 'some text here'.
ld_i_number = 'Check type of data required'.
ld_i_par1 = 'some text here'.
ld_i_par2 = 'some text here'.
ld_i_par3 = 'some text here'.
ld_i_par4 = 'some text here'.

ld_i_parameter = some text here

ld_i_row = 123

ld_i_field = 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 FPRL_MESSAGE_ADD or its description.