Skip to content

Instantly share code, notes, and snippets.

@svict4
Created January 17, 2018 08:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save svict4/f09e13b02e71c4f81a4e6e5c5c73adfe to your computer and use it in GitHub Desktop.
Save svict4/f09e13b02e71c4f81a4e6e5c5c73adfe to your computer and use it in GitHub Desktop.
ABAP SAP CRM - Consume WS
*-- This code is calling the exposed Function Module in the snippet of 'BT Creation'.
*-- Found here: https://gist.github.com/svict4/d64fa12613415ab94afd1ee98a82c881
DATA: lo_proxy TYPE REF TO zsapco_zsrv_XXXXXX,
ls_service_output TYPE zsapzfm_XXXXXX_servresponse,
ls_service_input TYPE zsapzfm_XXXXXX_serv.
TRY.
*-- Create an instance of the ABAP Proxy class
CREATE OBJECT lo_proxy.
*-- In this case, the WS takes the process type of a transaction to be
* created as well as the description. The WS then creates a transaction
* appropriate and returns the objectid in the response.
ls_service_input-iv_process_type = 'SRVR'.
ls_service_input-iv_description = 'Test'.
CALL METHOD lo_proxy->zfm_tbo475_serv
EXPORTING
input = ls_service_input
IMPORTING
output = ls_service_output.
CATCH cx_ai_system_fault.
" This must be caught when using ABAP Proxies.
ENDTRY.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment