SAP /AIF/CREATE_ALERT Function Module for Create Alert for AIF Messages









/AIF/CREATE_ALERT is a standard /aif/create alert SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Create Alert for AIF Messages 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 /aif/create alert FM, simply by entering the name /AIF/CREATE_ALERT into the relevant SAP transaction such as SE37 or SE38.

Function Group: /AIF/ALERT_FG
Program Name: /AIF/SAPLALERT_FG
Main Program: /AIF/SAPLALERT_FG
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function /AIF/CREATE_ALERT 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 '/AIF/CREATE_ALERT'"Create Alert for AIF Messages
EXPORTING
NS = "Namespace
* FINAL_STATUS = 'X' "Boolean Variable (X=True, -=False, Space=Unknown)
IFNAME = "Interface Name
IFVERSION = "Interface Version
* DATA = "
* RAW_STRUCT = "
* LOG_HANDLE = "Application Log: Log Handle
* BAL_CONTEXT = "Context for Application Log
* MSGGUID = "GUID for Integration Engine Objects
* IS_SINGLE_MSG_DATA = "

IMPORTING
EXTERNAL_ALERT_ID = "External ID for an Alert
RECIPIENTS = "Category information table type
HASHKEY = "Hask key for alerts lock

TABLES
RETURN_TAB = "Return Parameter
.



IMPORTING Parameters details for /AIF/CREATE_ALERT

NS - Namespace

Data type: /AIF/NS
Optional: No
Call by Reference: Yes

FINAL_STATUS - Boolean Variable (X=True, -=False, Space=Unknown)

Data type: BOOLEAN
Default: 'X'
Optional: Yes
Call by Reference: Yes

IFNAME - Interface Name

Data type: /AIF/IFNAME
Optional: No
Call by Reference: Yes

IFVERSION - Interface Version

Data type: /AIF/IFVERSION
Optional: No
Call by Reference: Yes

DATA -

Data type:
Optional: Yes
Call by Reference: Yes

RAW_STRUCT -

Data type:
Optional: Yes
Call by Reference: Yes

LOG_HANDLE - Application Log: Log Handle

Data type: BALLOGHNDL
Optional: Yes
Call by Reference: Yes

BAL_CONTEXT - Context for Application Log

Data type: /AIF/BAL_CONTEXT
Optional: Yes
Call by Reference: Yes

MSGGUID - GUID for Integration Engine Objects

Data type: SXMSGUID
Optional: Yes
Call by Reference: Yes

IS_SINGLE_MSG_DATA -

Data type:
Optional: Yes
Call by Reference: Yes

EXPORTING Parameters details for /AIF/CREATE_ALERT

EXTERNAL_ALERT_ID - External ID for an Alert

Data type: SALRTEXTID
Optional: No
Call by Reference: Yes

RECIPIENTS - Category information table type

Data type: /AIF/ALRT_CAT_STR_T
Optional: No
Call by Reference: Yes

HASHKEY - Hask key for alerts lock

Data type: /AIF/HASHKEY
Optional: No
Call by Reference: Yes

TABLES Parameters details for /AIF/CREATE_ALERT

RETURN_TAB - Return Parameter

Data type: BAPIRET2
Optional: No
Call by Reference: Yes

Copy and paste ABAP code example for /AIF/CREATE_ALERT 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_ns  TYPE /AIF/NS, "   
lt_return_tab  TYPE STANDARD TABLE OF BAPIRET2, "   
lv_external_alert_id  TYPE SALRTEXTID, "   
lv_final_status  TYPE BOOLEAN, "   'X'
lv_ifname  TYPE /AIF/IFNAME, "   
lv_recipients  TYPE /AIF/ALRT_CAT_STR_T, "   
lv_hashkey  TYPE /AIF/HASHKEY, "   
lv_ifversion  TYPE /AIF/IFVERSION, "   
lv_data  TYPE /AIF/IFVERSION, "   
lv_raw_struct  TYPE /AIF/IFVERSION, "   
lv_log_handle  TYPE BALLOGHNDL, "   
lv_bal_context  TYPE /AIF/BAL_CONTEXT, "   
lv_msgguid  TYPE SXMSGUID, "   
lv_is_single_msg_data  TYPE SXMSGUID. "   

  CALL FUNCTION '/AIF/CREATE_ALERT'  "Create Alert for AIF Messages
    EXPORTING
         NS = lv_ns
         FINAL_STATUS = lv_final_status
         IFNAME = lv_ifname
         IFVERSION = lv_ifversion
         DATA = lv_data
         RAW_STRUCT = lv_raw_struct
         LOG_HANDLE = lv_log_handle
         BAL_CONTEXT = lv_bal_context
         MSGGUID = lv_msgguid
         IS_SINGLE_MSG_DATA = lv_is_single_msg_data
    IMPORTING
         EXTERNAL_ALERT_ID = lv_external_alert_id
         RECIPIENTS = lv_recipients
         HASHKEY = lv_hashkey
    TABLES
         RETURN_TAB = lt_return_tab
. " /AIF/CREATE_ALERT




ABAP code using 7.40 inline data declarations to call FM /AIF/CREATE_ALERT

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_final_status) = 'X'.
 
 
 
 
 
 
 
 
 
 
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!