Ansicht
Dokumentation

CRM_WR_BRF_RAISE_EVENT_ONLINE - Call BRF Event Online from Web Request

CRM_WR_BRF_RAISE_EVENT_ONLINE - Call BRF Event Online from Web Request

TXBHW - Original Tax Base Amount in Local Currency   rdisp/max_wprun_time - Maximum work process run time  
This documentation is copyright by SAP AG.
SAP E-Book

Functionality

This module is designed to call Web requests CRM_SERVICE_WEBREQ from the BAdI. The interface consists of

  • the BRF event
  • the BRF application class
  • and the XML file.

After the processing of rules, the XML file can be changed by adding messages or changing field entries.

Messages are created in table ET_MESSAGE, which specifically deal with the Business Rule Framework (BRF). If you want to display the errors whilst processing the request, these must be transferred to the table ET_MESSAGE of the BAdI.

Table ET_WEBREQ_MESSAGE contains messages that were from the BRF and added to the XML file. To avoid duplicating these messages, you should not transfer them to the BAdI table ET_MESSAGE.

Parameterization of BRF events

BRF events can be parameterized. If you have parameterized an event, you can restrict the selection of rules that are to be used with the appropriate parameters. You can transfer a parameter key with the relevant value to a special event. This all happens using the IS_BRF_PARAMS structure.

You can define the parameter keys in the IMG activity Define Parameter Keys. For more information about the parameterization of BRF events, see the relevant IMG documentation.

The example below illustrates how you provide the parameter key 'Z_WEBREQ' with the request category as a value when calling an event.

Additional event context

You can provide additional data for an event context by placing it in the IT_APPL_CONTEXT table. As is the case with parameterization, references to objects or data are possible. You call the data with a key in the BRF.

Example

DATA: lt_message   type uxb_t_message.
      lv_req_type  TYPE REF TO CRMT_REQT_S,
      ls_req_type  TYPE crmt_reqt_s,
      ls_brf_param  type CRMT_BRF_EVENT_PARAMS.
      lt_wr_message type uxb_t_message.

ls_req_type-req_type = id_service_id.
    FIELD-SYMBOLS: <fs> TYPE ANY.
    CREATE DATA lv_req_type. "TYPE ('CRMT_REQT_S').
    ASSIGN lv_req_type->* TO <fs>.
    <fs> = ls_req_type.
    ls_brf_param-param_key        = 'Z_WEBREQ'.
    ls_brf_param-param_values_ref = lv_req_type.

if cd_event eq 'CHECK'.

  CALL FUNCTION 'CRM_WR_BRF_RAISE_EVENT_ONLINE'
    EXPORTING
      IV_EVENT              = 'CHECK'
      IV_APPLCLASS          = 'Z_WR'
      ID_SERVICE_ID         = id_service_id
      iR_FORM_DATA_ENVELOPE = ir_form_data_envelope
      is_brf_params         = ls_brf_param
    IMPORTING
      ET_MESSAGE            = lt_message
      ET_WEBREQ_MESSAGE     = lt_wr_message
    EXCEPTIONS
      ERROR_OCCURRED        = 1
      OTHERS                = 2.
  IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
endif.

Notes

Further information





Parameters

ET_MESSAGE
ET_WEBREQ_MESSAGE
ID_SERVICE_ID
IR_FORM_DATA_ENVELOPE
IS_BRF_PARAMS
IT_APPL_CONTEXT
IV_APPLCLASS
IV_EVENT
IV_TRACE_ON

Exceptions

ERROR_OCCURRED

Function Group

CRM_WR_BRF_EVENT

Fill RESBD Structure from EBP Component Structure   ABAP Short Reference  
This documentation is copyright by SAP AG.

Length: 5254 Date: 20240523 Time: 095732     sap01-206 ( 62 ms )