Create REST API in SAP - without ODATA - REST Service in ABAP [english]

Published: 18 February 2024
on channel: Cust&Code in SAP ABAP
3,974
116

In today's video, I will show you how you can create a simple REST API in SAP. To do this, we use the transaction SE24 to create two new classes that inherit from the CL_REST_HTTP_HANDLER and CL_REST_RESOURCE classes. We redefine two methods of these newly created classes and write some code. Then we create a service via the transaction SCIF and test it with Postman.

CL_REST_HTTP_HANDLER
This is the basic handler class for ABAP REST applications, i.e. every REST application must derive its handler class from this class.

IF_REST_APPLICATION
Declares the GET_ROOT_HANDLER method, which must be implemented by every ABAP REST application.


CL_REST_RESOURCE
This class is the base class for all REST resources. The interface
IF_REST_RESOURCE defines the methods GET, POST, PUT, DELETE, HEAD and OPTIONS. In our example, we redefine the GET method here.
Each REST application resource class inherits from this class and overwrites its methods.

CL_REST_ROUTER
This class is used to resolve REST resource handler classes from the URIs (Uniform Resource Identifier) used during REST request processing.
The handler class is assigned to the URI template by calling the ATTACH method.


#sap #abap #rest #api #service

▬▬ Literature 📚 ▬▬▬▬▬▬▬▬▬▬▬▬▬
▶ ABAP: An Introduction 2020 https://amzn.to/45CLTqk
▶ Complete ABAP 2023 https://amzn.to/45D5UNM
▶ ABAP to the Future 2022 https://amzn.to/42cgWGs
▶ Clean ABAP 2022 https://amzn.to/3KAqmow


▬▬ My Hardware 💻 ▬▬▬▬▬▬▬▬▬▬▬▬▬
▶ Microphone: https://amzn.to/3zj2UIz
▶ Headphone: https://amzn.to/3GUBRFg


▬▬ My Software (free) 💾 ▬▬▬▬▬▬▬▬▬▬▬
▶ Video Recorder: https://bit.ly/678fgh6
▶ Video Editor: https://bit.ly/38Rj9lb
▶ Thumbnail: https://bit.ly/CustAndCodeThumbnail
▶ Gamma AI: http://bit.ly/3nsdvgr


▬▬ Further Links 🔗 ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
⭐Become my subscriber: https://bit.ly/CustAndCodeSub
🎬All videos in English: https://bit.ly/CustAndCodeENG
☕Buy me a Coffee 😀: https://bit.ly/3dih2cl

*The links are affiliate links. There are no additional costs.

📍Attribution:
YouTube Subscribe Animations: https://pixabay.com/videos/search/sub...


Watch video Create REST API in SAP - without ODATA - REST Service in ABAP [english] online without registration, duration hours minute second in high quality. This video was added by user Cust&Code in SAP ABAP 18 February 2024, don't forget to share it with your friends and acquaintances, it has been viewed on our site 3,974 once and liked it 116 people.