Skip to content

Instantly share code, notes, and snippets.

@quxiaowei
Last active March 3, 2021 16:51
Show Gist options
  • Save quxiaowei/d8beb6c96fe3400d2a32e04f7f59e1b0 to your computer and use it in GitHub Desktop.
Save quxiaowei/d8beb6c96fe3400d2a32e04f7f59e1b0 to your computer and use it in GitHub Desktop.
[IF_REST_APPLICATION~GET_ROOT_HANDLER] #ABAP
METHOD if_rest_application~get_root_handler.
*CALL METHOD SUPER->IF_REST_APPLICATION~GET_ROOT_HANDLER
* RECEIVING
* RO_ROOT_HANDLER =
* .
DATA: lo_router TYPE REF TO cl_rest_router.
IF mo_server IS BOUND.
CREATE OBJECT lo_router.
lo_router->attach( iv_template = '/GetTest' iv_handler_class = 'ZCL_REST_WS_TEST' ).
lo_router->attach( iv_template = '/GetTest/{name}' iv_handler_class = 'ZCL_REST_WS_TEST' ).
lo_router->attach( iv_template = '/GetTest/{name}/' iv_handler_class = 'ZCL_REST_WS_TEST' ).
ro_root_handler = lo_router.
ENDIF.
ENDMETHOD.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment