SAP Function Modules

WTAD_APPEND_MESSAGE SAP Function module







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

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


Pattern for FM WTAD_APPEND_MESSAGE - WTAD APPEND MESSAGE





CALL FUNCTION 'WTAD_APPEND_MESSAGE' "
  EXPORTING
    fi_addibelnr =              " wtadab-addibelnr
    fi_addiposnr =              " wtadab-addiposnr
    fi_addistunr =              " wtadab-addistunr
    fi_lfdnr =                  " wtadab-lfdnr
    fi_msgid =                  " sy-msgid
    fi_msgty =                  " sy-msgty
    fi_msgno =                  " sy-msgno
*   fi_msgv1 =                  " sy-msgv1
*   fi_msgv2 =                  " sy-msgv2
*   fi_msgv3 =                  " sy-msgv3
*   fi_msgv4 =                  " sy-msgv4
  TABLES
    fxt_messages =              " wtad_message
  EXCEPTIONS
    MESSAGE_NOT_FOUND = 1       "
    .  "  WTAD_APPEND_MESSAGE

ABAP code example for Function Module WTAD_APPEND_MESSAGE





The ABAP code below is a full code listing to execute function module WTAD_APPEND_MESSAGE 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_fxt_messages  TYPE STANDARD TABLE OF WTAD_MESSAGE,"TABLES PARAM
wa_fxt_messages  LIKE LINE OF it_fxt_messages .


SELECT single ADDIBELNR
FROM WTADAB
INTO @DATA(ld_fi_addibelnr).


SELECT single ADDIPOSNR
FROM WTADAB
INTO @DATA(ld_fi_addiposnr).


SELECT single ADDISTUNR
FROM WTADAB
INTO @DATA(ld_fi_addistunr).


SELECT single LFDNR
FROM WTADAB
INTO @DATA(ld_fi_lfdnr).

DATA(ld_fi_msgid) = 'some text here'.
DATA(ld_fi_msgty) = 'some text here'.
DATA(ld_fi_msgno) = 'Check type of data required'.
DATA(ld_fi_msgv1) = 'some text here'.
DATA(ld_fi_msgv2) = 'some text here'.
DATA(ld_fi_msgv3) = 'some text here'.
DATA(ld_fi_msgv4) = 'some text here'.

"populate fields of struture and append to itab
append wa_fxt_messages to it_fxt_messages. . CALL FUNCTION 'WTAD_APPEND_MESSAGE' EXPORTING fi_addibelnr = ld_fi_addibelnr fi_addiposnr = ld_fi_addiposnr fi_addistunr = ld_fi_addistunr fi_lfdnr = ld_fi_lfdnr fi_msgid = ld_fi_msgid fi_msgty = ld_fi_msgty fi_msgno = ld_fi_msgno * fi_msgv1 = ld_fi_msgv1 * fi_msgv2 = ld_fi_msgv2 * fi_msgv3 = ld_fi_msgv3 * fi_msgv4 = ld_fi_msgv4 TABLES fxt_messages = it_fxt_messages EXCEPTIONS MESSAGE_NOT_FOUND = 1 . " WTAD_APPEND_MESSAGE
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "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_fi_addibelnr  TYPE WTADAB-ADDIBELNR ,
it_fxt_messages  TYPE STANDARD TABLE OF WTAD_MESSAGE ,
wa_fxt_messages  LIKE LINE OF it_fxt_messages,
ld_fi_addiposnr  TYPE WTADAB-ADDIPOSNR ,
ld_fi_addistunr  TYPE WTADAB-ADDISTUNR ,
ld_fi_lfdnr  TYPE WTADAB-LFDNR ,
ld_fi_msgid  TYPE SY-MSGID ,
ld_fi_msgty  TYPE SY-MSGTY ,
ld_fi_msgno  TYPE SY-MSGNO ,
ld_fi_msgv1  TYPE SY-MSGV1 ,
ld_fi_msgv2  TYPE SY-MSGV2 ,
ld_fi_msgv3  TYPE SY-MSGV3 ,
ld_fi_msgv4  TYPE SY-MSGV4 .


SELECT single ADDIBELNR
FROM WTADAB
INTO ld_fi_addibelnr.


"populate fields of struture and append to itab
append wa_fxt_messages to it_fxt_messages.

SELECT single ADDIPOSNR
FROM WTADAB
INTO ld_fi_addiposnr.


SELECT single ADDISTUNR
FROM WTADAB
INTO ld_fi_addistunr.


SELECT single LFDNR
FROM WTADAB
INTO ld_fi_lfdnr.

ld_fi_msgid = 'some text here'.
ld_fi_msgty = 'some text here'.
ld_fi_msgno = 'Check type of data required'.
ld_fi_msgv1 = 'some text here'.
ld_fi_msgv2 = 'some text here'.
ld_fi_msgv3 = 'some text here'.
ld_fi_msgv4 = '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 WTAD_APPEND_MESSAGE or its description.