SAP Function Modules

SALRT_CREATE_API SAP Function module







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

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


Pattern for FM SALRT_CREATE_API - SALRT CREATE API





CALL FUNCTION 'SALRT_CREATE_API' "
* EXPORTING
*   ip_category =               " salrtdcat     Alert Category
*   ip_alias =                  " salertdalias
*   ip_expiration_time =        " salrtdexpt    Alerts: Expiration Time
*   ip_expiration_date =        " salrtdexpd    Alert: Expiration Date
*   ip_wait_on_commit = 'X'     " boole_d       Boolean variable
*   ip_application_guid =       " guid_32       GUID as Application Identifier
*   ip_get_sync_exceptions = SPACE  " char1
*   ii_container =              " if_swf_cnt_container
  IMPORTING
    ep_alert_id =               " salrtextid    Alert ID: Identification Number of an Alert
* TABLES
*   it_recipients =             " salrtsrcp     Alerts: Transfer Structure for Recipient with Reason
*   it_activities =             " salrtsact     Alerts: URL for Follow-On Activities in Container
*   it_container =              " swcont        Alert Container
*   it_ext_recipients =         " salrtscomm
*   it_ext_addr =               " salrtsaddr
*   it_roles =                  " str_agr2      Roles
  EXCEPTIONS
    ALERT_CATEGORY_UNKNOWN = 1  "
    ALERT_NO_RECIPIENTS = 2     "
    ALERT_ERROR_UNKNOWN = 3     "               Unknown Error
    DESTINATION_UNDEFINED = 4   "
    COMMUNICATION_FAILURE = 5   "
    SYSTEM_FAILURE = 6          "
    .  "  SALRT_CREATE_API

ABAP code example for Function Module SALRT_CREATE_API





The ABAP code below is a full code listing to execute function module SALRT_CREATE_API 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_ep_alert_id  TYPE SALRTEXTID ,
it_it_recipients  TYPE STANDARD TABLE OF SALRTSRCP,"TABLES PARAM
wa_it_recipients  LIKE LINE OF it_it_recipients ,
it_it_activities  TYPE STANDARD TABLE OF SALRTSACT,"TABLES PARAM
wa_it_activities  LIKE LINE OF it_it_activities ,
it_it_container  TYPE STANDARD TABLE OF SWCONT,"TABLES PARAM
wa_it_container  LIKE LINE OF it_it_container ,
it_it_ext_recipients  TYPE STANDARD TABLE OF SALRTSCOMM,"TABLES PARAM
wa_it_ext_recipients  LIKE LINE OF it_it_ext_recipients ,
it_it_ext_addr  TYPE STANDARD TABLE OF SALRTSADDR,"TABLES PARAM
wa_it_ext_addr  LIKE LINE OF it_it_ext_addr ,
it_it_roles  TYPE STANDARD TABLE OF STR_AGR2,"TABLES PARAM
wa_it_roles  LIKE LINE OF it_it_roles .

DATA(ld_ip_category) = 'Check type of data required'.
DATA(ld_ip_alias) = 'Check type of data required'.
DATA(ld_ip_expiration_time) = 'Check type of data required'.
DATA(ld_ip_expiration_date) = 'Check type of data required'.
DATA(ld_ip_wait_on_commit) = 'Check type of data required'.
DATA(ld_ip_application_guid) = 'Check type of data required'.
DATA(ld_ip_get_sync_exceptions) = 'Check type of data required'.
DATA(ld_ii_container) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_recipients to it_it_recipients.

"populate fields of struture and append to itab
append wa_it_activities to it_it_activities.

"populate fields of struture and append to itab
append wa_it_container to it_it_container.

"populate fields of struture and append to itab
append wa_it_ext_recipients to it_it_ext_recipients.

"populate fields of struture and append to itab
append wa_it_ext_addr to it_it_ext_addr.

"populate fields of struture and append to itab
append wa_it_roles to it_it_roles. . CALL FUNCTION 'SALRT_CREATE_API' * EXPORTING * ip_category = ld_ip_category * ip_alias = ld_ip_alias * ip_expiration_time = ld_ip_expiration_time * ip_expiration_date = ld_ip_expiration_date * ip_wait_on_commit = ld_ip_wait_on_commit * ip_application_guid = ld_ip_application_guid * ip_get_sync_exceptions = ld_ip_get_sync_exceptions * ii_container = ld_ii_container IMPORTING ep_alert_id = ld_ep_alert_id * TABLES * it_recipients = it_it_recipients * it_activities = it_it_activities * it_container = it_it_container * it_ext_recipients = it_it_ext_recipients * it_ext_addr = it_it_ext_addr * it_roles = it_it_roles EXCEPTIONS ALERT_CATEGORY_UNKNOWN = 1 ALERT_NO_RECIPIENTS = 2 ALERT_ERROR_UNKNOWN = 3 DESTINATION_UNDEFINED = 4 COMMUNICATION_FAILURE = 5 SYSTEM_FAILURE = 6 . " SALRT_CREATE_API
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 ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 4. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 5. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 6. "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_ep_alert_id  TYPE SALRTEXTID ,
ld_ip_category  TYPE SALRTDCAT ,
it_it_recipients  TYPE STANDARD TABLE OF SALRTSRCP ,
wa_it_recipients  LIKE LINE OF it_it_recipients,
ld_ip_alias  TYPE SALERTDALIAS ,
it_it_activities  TYPE STANDARD TABLE OF SALRTSACT ,
wa_it_activities  LIKE LINE OF it_it_activities,
ld_ip_expiration_time  TYPE SALRTDEXPT ,
it_it_container  TYPE STANDARD TABLE OF SWCONT ,
wa_it_container  LIKE LINE OF it_it_container,
ld_ip_expiration_date  TYPE SALRTDEXPD ,
it_it_ext_recipients  TYPE STANDARD TABLE OF SALRTSCOMM ,
wa_it_ext_recipients  LIKE LINE OF it_it_ext_recipients,
ld_ip_wait_on_commit  TYPE BOOLE_D ,
it_it_ext_addr  TYPE STANDARD TABLE OF SALRTSADDR ,
wa_it_ext_addr  LIKE LINE OF it_it_ext_addr,
ld_ip_application_guid  TYPE GUID_32 ,
it_it_roles  TYPE STANDARD TABLE OF STR_AGR2 ,
wa_it_roles  LIKE LINE OF it_it_roles,
ld_ip_get_sync_exceptions  TYPE CHAR1 ,
ld_ii_container  TYPE IF_SWF_CNT_CONTAINER .

ld_ip_category = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_recipients to it_it_recipients.
ld_ip_alias = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_activities to it_it_activities.
ld_ip_expiration_time = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_container to it_it_container.
ld_ip_expiration_date = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_ext_recipients to it_it_ext_recipients.
ld_ip_wait_on_commit = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_ext_addr to it_it_ext_addr.
ld_ip_application_guid = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_roles to it_it_roles.
ld_ip_get_sync_exceptions = 'Check type of data required'.
ld_ii_container = 'Check type of data required'.

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 SALRT_CREATE_API or its description.