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

Поділитися
Вставка
  • Опубліковано 21 лип 2024
  • 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 amzn.to/45CLTqk
    ▶ Complete ABAP 2023 amzn.to/45D5UNM
    ▶ ABAP to the Future 2022 amzn.to/42cgWGs
    ▶ Clean ABAP 2022 amzn.to/3KAqmow
    ▬▬ My Hardware 💻 ▬▬▬▬▬▬▬▬▬▬▬▬▬
    ▶ Microphone: amzn.to/3zj2UIz
    ▶ Headphone: amzn.to/3GUBRFg
    ▬▬ My Software (free) 💾 ▬▬▬▬▬▬▬▬▬▬▬
    ▶ Video Recorder: bit.ly/678fgh6
    ▶ Video Editor: bit.ly/38Rj9lb
    ▶ Thumbnail: bit.ly/CustAndCodeThumbnail
    ▶ Gamma AI: bit.ly/3nsdvgr
    ▬▬ Further Links 🔗 ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
    ⭐Become my subscriber: bit.ly/CustAndCodeSub
    🎬All videos in English: bit.ly/CustAndCodeENG
    ☕Buy me a Coffee 😀: bit.ly/3dih2cl
    *The links are affiliate links. There are no additional costs.
    📍Attribution:
    UA-cam Subscribe Animations: pixabay.com/videos/search/sub...

КОМЕНТАРІ • 24

  • @VijayaLaxmi-xk3ds
    @VijayaLaxmi-xk3ds 7 годин тому

    How we convert deep table data or deep internal data from abap to json ...i have seen deep structure video what about deep internal data conversions ?

  • @davutkesmuk1093
    @davutkesmuk1093 5 місяців тому +1

    Süper video thx bro🎉🎉

    • @CustAndCode
      @CustAndCode  5 місяців тому

      Thank you for your feedback 🤗

  • @nCem18
    @nCem18 2 місяці тому

    Thanks for shareing

    • @CustAndCode
      @CustAndCode  2 місяці тому

      I'm glad you liked it. And thank you for watching! 🤗

  • @user-ep9fc8ck6v
    @user-ep9fc8ck6v 5 місяців тому

    I like your youtube But is there any abap program like using sap standard program?? Forexample , I want to create a program that uses fv50 to generate large amounts of document. Could you help me??

    • @CustAndCode
      @CustAndCode  5 місяців тому

      Unfortunately I'm not an FI expert. I know that module from the view of a programmer but not from the view of a key user. 🙄

  • @N-007a
    @N-007a 25 днів тому

    Thanks for sharing!
    Could you suggest solution in case of following error message when trying to Test the service in SICF: "Hmmm… can't reach this page server" and "IP address could not be found"?

    • @CustAndCode
      @CustAndCode  24 дні тому

      I'm glad that you liked it. 🤗 Which SAP system do you use? is it a trial system? 🤔

    • @N-007a
      @N-007a 21 день тому

      It's the 'sandbox' system within our company, not a trial one.

  • @Aravindinduchudan
    @Aravindinduchudan 5 місяців тому +1

    good one. But will it be useful in any scenarios?

    • @CustAndCode
      @CustAndCode  5 місяців тому +1

      One of my clients use rest apis to create SAP accounts from an external identity provider. You can use it to fetch some SAP data with external programs too. 🤗

  • @lahirumadhumadha
    @lahirumadhumadha 4 місяці тому

    i have also used this method to a client who didn't have SAP PI/PO

    • @CustAndCode
      @CustAndCode  4 місяці тому

      Thanks for your feedback! 🤗

  • @sandeep-4433
    @sandeep-4433 4 місяці тому

    Is it necessary yo enter username and password.. if we dnt have production server credentials.. what should we do? Kindly suggest and make video

    • @CustAndCode
      @CustAndCode  4 місяці тому

      I am not sure If I understand the question right, but you need an authorization? 🤔

    • @sandeep-4433
      @sandeep-4433 4 місяці тому

      I want to ask.. lets suppose i created the same in developer server and moves the Transport request to quality server and then to production server. Do i need to pass username and password in popup to access the api...??

    • @CustAndCode
      @CustAndCode  3 місяці тому

      ​@@sandeep-4433 yes you can provide a username and a password on the production system as well because I think you don't have the same password on your development system and production system. But I think there is another option where you not need to pass a username and a password but I have to check this first. 🤗

  • @edonovanto
    @edonovanto 4 місяці тому

    Which REST implementation is recommended for enterprise scale? using OData or implementation in the video is good enough?
    anyway the video is great, thanks bro

    • @CustAndCode
      @CustAndCode  4 місяці тому

      Depends on your special need. I can't judge that exactly. Maybe I should implement one service with ODATA first. 😉🤗

    • @edonovanto
      @edonovanto 4 місяці тому

      @@CustAndCode Thank you for your response😀

    • @CustAndCode
      @CustAndCode  4 місяці тому

      @@edonovanto 🤗🤗🤗

    • @edonovanto
      @edonovanto 4 місяці тому

      @@CustAndCode May i know the reason why you choose to implement service with ODATA first rather than using SICF?

    • @CustAndCode
      @CustAndCode  4 місяці тому

      @@edonovanto I meant that I want to create a video of how to use a REST Call with ODATA 🤗