Entering content frameProcedure documentation Sending a Message Locate the document in its SAP Library structure

Use

To send a message using the Exchange Infrastructure, call the corresponding outbound proxy.

Procedure

  1. Declare variables for error handling, the outbound message, and (in the synchronous case) the inbound message:
  2. Data: l_sys_exception  type ref to cx_ai_system_fault,
          l_output     type
    <Output Messagetype>,
          l_input      type
    <Input Messagetype>.

  3. Complete structure 1_output for the output message.
  4. Call your outbound proxy and catch at least the exception cx_ai_system_fault. This is sensible in both synchronous and asynchronous cases:
  5. try.
     call method
    <Generated Outbound Class> => EXECUTE_SYNCHRONOUS
       exporting
         output     = l_output
       importing
         input      = l_input.


    catch cx_ai_system_fault into l_sys_exception.
      write: 'System fault: '.
      write: l_sys_exception->errortext.
      exit.

    endtry.

    Note Also see: Error Handling.

  6. In the asynchronous case, a message is first sent with the statement COMMIT WORK:

    commit work.

Note

In the synchronous case, the call is executed immediately. To avoid inconsistencies, use asynchronous communication for updates.

 

 

 

 

 

Leaving content frame