Call External API in SAP ABAP - API Key - REST API [english]

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ก.ย. 2024
  • In this video I will show you how to call an external API from SAP. An API is a Application Programming Interface that provides functions or commands to communicate with an external system.
    Many free APIs are available on the site rapidapi.com/.
    I have found here for example the API "Airport Info". With this API you can search for airport information like name, address, phone number, website and much more by using the airport code IATA or ICAO. To use the API an API Key is generated and passed as header field in ABAP.
    #sap #apicall #restapi
    ✅ Book, I am currently reading: amzn.to/43Zat2C
    ▬▬ 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/CustAnd...
    ▶ Gamma AI: bit.ly/3nsdvgr
    ▬▬ Further Links 🔗 ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
    ⭐Become my subscriber: bit.ly/CustAnd...
    🎬All videos in English: bit.ly/CustAnd...
    ☕Buy me a Coffee 😀: bit.ly/3dih2cl
    *The links are affiliate links. There are no additional costs.

ความคิดเห็น • 73

  • @sankeshankar
    @sankeshankar ปีที่แล้ว

    Very easy to undersand explaination !! Thank you !

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      Thank you for your kind feedback! 🤗😃

  • @ayhobbyist
    @ayhobbyist 3 หลายเดือนก่อน

    this is clear and clean coding 🤩

    • @CustAndCode
      @CustAndCode  3 หลายเดือนก่อน

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

    • @ayhobbyist
      @ayhobbyist 3 หลายเดือนก่อน

      @@CustAndCode
      how would you configure SM59 in that case ?

  • @Tutorials4Work
    @Tutorials4Work 2 ปีที่แล้ว +3

    Great Explaination - Thanks for this Tutorial!
    Will you also start making SAP Videos for RAP and Cloud-Ready based programming?

  • @maxxcurrey7547
    @maxxcurrey7547 2 ปีที่แล้ว

    Nice job!

  • @manu7623
    @manu7623 ปีที่แล้ว

    Hi, thx for the great video! Do you maybe also know where i can find an example with a POST request with (with body)?

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว +1

      Sure 🤗
      On Codeline 31 set the method to post like:
      o_client->request->set_method( if_http_request=>co_request_method_post ).
      Set the data (json?) in a string variable like lv_data.
      Then call the "set_form_field" Method like:
      o_client->request->set_form_field( name = 'data' value = lv_data ).
      If you need more form fields set them with the method above. 🤗
      If I have time I make a video about that. 😀

  • @davutkesmuk1093
    @davutkesmuk1093 ปีที่แล้ว

    Hello, when I try the example found here, I get an SSL certificate error. how can i fix this error

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      Have a look at this video: th-cam.com/video/SXFXWKlIpdE/w-d-xo.html
      🤗

    • @davutkesmuk1093
      @davutkesmuk1093 ปีที่แล้ว

      @@CustAndCode thank you😊

  • @CustAndCode
    @CustAndCode  2 ปีที่แล้ว +2

    With pleasure! 😀 RAP and Cloud? maybe at a later time. Currently I try to make short videos that involve a specific task or problem. I am also just BEFORE a S4/HANA conversion 🤔🙄😄

  • @jorgeayala8268
    @jorgeayala8268 2 ปีที่แล้ว +4

    Hi, excelent explaination, i'm trying to do the same example in my SAP, I copied exctly as you did. When I ran the Report I get an error "HTTP_COMMUNICATION_FAILURE", do you have any idea, I would really appreciate it if you can help me. Thank you in advance.

    • @CustAndCode
      @CustAndCode  2 ปีที่แล้ว +3

      Sounds like a certificate error.
      Have a look at this video: th-cam.com/video/SXFXWKlIpdE/w-d-xo.html

    • @jorgeayala8268
      @jorgeayala8268 2 ปีที่แล้ว

      @@CustAndCode Thank you very much

    • @jorgeayala8268
      @jorgeayala8268 2 ปีที่แล้ว +1

      Thank you. You were right, was the certificate. I put the certificate in SAP (Strust) and the report ran perfectly

    • @CustAndCode
      @CustAndCode  2 ปีที่แล้ว

      @@jorgeayala8268 congrats! 🤗

    • @devinchen3030
      @devinchen3030 2 ปีที่แล้ว

      I had the same error, did you solve the issue?

  • @pawanrai7142
    @pawanrai7142 4 หลายเดือนก่อน

    Any Idea about Microsoft SharePoint API , Need an Integration of DMS in SAP and Microsoft SharePoint

    • @CustAndCode
      @CustAndCode  4 หลายเดือนก่อน

      Sorry I have no experience with SharePoint the API. But your task sounds challenging. 🤔

    • @pawanrai7142
      @pawanrai7142 4 หลายเดือนก่อน

      Yes , it is very challenging, jst thought if u can guide me. I have the online SharePoint URL , I have passed it as u have done, but the confusion is how do I call the folder and sub folder created inside the URL library? Any idea would help

    • @CustAndCode
      @CustAndCode  4 หลายเดือนก่อน

      I am not sure if sharepoint provide here APIs to do that. 🤔

  • @latinbishop1722
    @latinbishop1722 หลายเดือนก่อน

    Thanks

    • @CustAndCode
      @CustAndCode  หลายเดือนก่อน

      You are very welcome! 🤗😃

  • @tjk9830
    @tjk9830 2 ปีที่แล้ว +1

    Many thanks, very nice. It is concise and to the point.

    • @CustAndCode
      @CustAndCode  2 ปีที่แล้ว +1

      Thank you! Great to hear that! 😃🤗

  • @BharathiR-z2k
    @BharathiR-z2k ปีที่แล้ว

    pls tell me how to find x-rapid in postman apllication, we are getting short dump like | Exception condition "HTTP_COMMUNICATION_FAILURE" triggered |, please resolve this

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      Postman is just another client. Be sure that post man can reach the endpoint of your service. Could be a certificate problem? 🤔

  • @manasvicollections642
    @manasvicollections642 ปีที่แล้ว

    I have a requirement:
    Whenever OBD is getting PGI ed then one output type will trigger which is of transmission medium 8- special function then my report should call in which I need to consume external API and send status of PGI via API
    How can I code here??

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      Unfortunately, I do not fully understand the problem. But I also think that I can not help here. 🤔

    • @manasvicollections642
      @manasvicollections642 ปีที่แล้ว

      @@CustAndCode ok… can you show me one example of consuming api with PUT operation

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      @@manasvicollections642 I have never used a PUT call. I have always gotten along with GET and POST. 🤗

  • @FrancescoCorasaniti
    @FrancescoCorasaniti ปีที่แล้ว

    Thanks for the detailed informations shared. Very clear! I've only struggled a bit with the certificate but after some attempts I've successfully called the API!

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      You are very welcome, and thank you for watching and commenting! Glad that it worked with the certificate! 🤗😀

  • @AjaypalSingh-oc7os
    @AjaypalSingh-oc7os ปีที่แล้ว

    why am i getting syntax error with same code??

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      I suspect that you are not using the exact same syntax... Maybe there is a Typo in your Code. What is the error message? 🤗

  • @ParvezKhan-dl1tb
    @ParvezKhan-dl1tb ปีที่แล้ว

    Pls provide some solution for developer ease in POST scenario where request payload is complex deep structures

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      Did you mean how to send send a complex JSON Payload to a API or how to receive a complex JSON from a API? 🤔

    • @ParvezKhan-dl1tb
      @ParvezKhan-dl1tb ปีที่แล้ว

      @@CustAndCode yes its hectic to create TYPES for request payload based complex structure

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      @@ParvezKhan-dl1tb In one of my former videos I showed how to create a type to consume a JSON from an API. Is that what you were looking for? 🤗
      th-cam.com/video/Ej-M5yLbzZs/w-d-xo.html

  • @laxer94
    @laxer94 ปีที่แล้ว

    Hello. Could you please share how to get the response headers? Thank!

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว +1

      Hi,
      DATA(lv_result1) = o_client->response->get_header_field( name = 'content-type' ).
      🤗

    • @laxer94
      @laxer94 ปีที่แล้ว

      @@CustAndCode Thank you! :)

  • @houdaaggoun3795
    @houdaaggoun3795 10 หลายเดือนก่อน

    What about url without key ?

    • @CustAndCode
      @CustAndCode  10 หลายเดือนก่อน

      The key ist just an API key. If you don't have or need one you dont't have to pass one. Just call the API URL with your parameters. 🤗

  • @amitkshukla6084
    @amitkshukla6084 ปีที่แล้ว

    Thanks for the clean and minimalistic guide.

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      Thank you for your kind feedback! 😀

  • @doan_luc207
    @doan_luc207 9 หลายเดือนก่อน

    Do you know how to send data out of the SAP system using REST API(SICF)?

    • @CustAndCode
      @CustAndCode  9 หลายเดือนก่อน +1

      You mean to create an API in SAP and call it from outside to receive data from SAP? 🤔

    • @doan_luc207
      @doan_luc207 9 หลายเดือนก่อน

      @@CustAndCode yes, I've only just received data, I want to learn more about sending data.

    • @CustAndCode
      @CustAndCode  9 หลายเดือนก่อน

      @@doan_luc207 Ahhh ok that is a good topic! I will have a look about this. 🤗

    • @doan_luc207
      @doan_luc207 9 หลายเดือนก่อน

      I hope you will soon release a video on this topic so I can learn@@CustAndCode

    • @CustAndCode
      @CustAndCode  7 หลายเดือนก่อน

      I have release a video now and I will extended the video with more features in the future 🤗

  • @SatidSeenun
    @SatidSeenun ปีที่แล้ว

    thank you very much

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว +1

      You are welcome 🤗 thank you for your feedback! 😀

  • @mariavirginialeon4887
    @mariavirginialeon4887 ปีที่แล้ว

    Very Good . Thank you!

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      Thanks for your kind feedback! 😃🤗

  • @vipinnagpal
    @vipinnagpal ปีที่แล้ว

    pls share code

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว +1

      I already do! But I do not run a website because I unfortunately do not have the necessary time. The self-writing also helps in understanding the logic and the code. 🤗

  • @mmb1821
    @mmb1821 ปีที่แล้ว

    Hallo,
    Kannst du vielleicht posten, wie ein Post Request an einer REST API mit einer CSV-Datei geht.
    Vielen Dank.

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      Diese Anforderung hatte ich selbst noch nie, wäre eine gute Idee für ein Video 😉 Vielleicht hilft dir in der Zwischenzeit dieser Post hier weiter:
      answers.sap.com/questions/7174658/abap-send-file-with-http-post-multipartform-data.html
      🤗

    • @mmb1821
      @mmb1821 ปีที่แล้ว

      Vielen Dank, ich wäre sehr dankbar, wenn du mich informierst, sobald es verfügbar ist.

    • @mmb1821
      @mmb1821 ปีที่แล้ว

      @@CustAndCode vielen Dank.
      Ich bin seit einer Woche am Rumwühlen im Netz, bis jetzt keine Gebrauchbare Hilfe gefunden.
      Auf diesen Link war ich schon, aber ist keine richtige Hilfe.
      Deine Videos sind sehr gut und sehr strukturiert. Danke

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      @@mmb1821 vielen Dank für das positive Feedback! 😀🤗. Deine Anforderung ist auch sehr speziell. Ich verwende meist JSON als Payload. Eine Datei ist doch etwas ungewöhnlich. 🤔

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      @@mmb1821 Besser wäre es natürlich du abonnierst meinen Kanal und aktivierst die Benahcrichtigung 😜

  • @awesomeshree
    @awesomeshree ปีที่แล้ว

    Brilliant video ..Thanks a lot

    • @CustAndCode
      @CustAndCode  ปีที่แล้ว

      Thank you very much for your feedback! 🤗😀