You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Passing along this info that was a little hard to come by on including keys/ids in the URI template. Figured it might be nice to make a PR to improve the overall example and save people time trying to find it elsewhere.
I recently discovered you can process keys passed in the URI (ex: SalesOrder/40001 reading the the SO with ID 40001. This can be done while attaching the root handler
Passing along this info that was a little hard to come by on including keys/ids in the URI template. Figured it might be nice to make a PR to improve the overall example and save people time trying to find it elsewhere.
I recently discovered you can process keys passed in the URI (ex: SalesOrder/40001 reading the the SO with ID 40001. This can be done while attaching the root handler
lo_router->attach( iv_template = '/SalesOrder/{ID}' iv_handler_class = 'ZCL_SALESORDERHANDLER' ).
In the handler class itself you would read the ID as follows
DATA(lt_uriattributes) = mo_request->get_uri_attributes( ).
READ TABLE lt_uriattributes WITH KEY name = 'ID' ASSIGNING FIELD-SYMBOL(<fs_salesorderid>).
In this example <fs_salesorderid>-value would then contain the passed ID value.
You can include regex in iv_template as well to enforce some character restrictions/validations.
The text was updated successfully, but these errors were encountered: