External API Call with POST Method and File Upload - with ABAP [english]

Поділитися
Вставка
  • Опубліковано 13 тра 2023
  • In today's video I will show you how to call an external API from SAP.
    I use a POST Call and pass a file to this API. To test this, I looked for a free service on the website rapidapi.com/ which can receive a file via POST Call.
    #sap #apicall #fileupload #abap
    ▬▬ My Hardware ▬▬▬▬▬▬▬▬▬▬▬▬▬
    Microphone: amzn.to/3zj2UIz
    Headphone: amzn.to/3GUBRFg
    *The links are affiliate links. There are no additional costs.
    ▬▬ 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

КОМЕНТАРІ • 48

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

    This video helped me solve the problem I was facing! Thank you!

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

      Awesome to hear. And thank you for watching! 🤗

  • @ashutoshkanaujia1827
    @ashutoshkanaujia1827 11 місяців тому

    This is a great video and very detailed explanation.. Thanks a lot

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

      Thank you very much for your feedback and thanks for watching 🤗😀

  • @ceyhunsimsek5686
    @ceyhunsimsek5686 9 місяців тому

    You are an absolute life saver

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

      hehe, nice to hear that! Thanks for your comment 🤗

  • @davialves6021
    @davialves6021 Рік тому +1

    Hi,
    I know the video is not about that but would you know how I can disable fields in the tcode BP (business partner)? I'm trying for BUPT but I'm not succeeding.

    • @CustAndCode
      @CustAndCode  Рік тому +2

      Unfortunately, I can't tell you anything about this yet, because we haven't changed over yet ourselves. That will still take a few months. 🤗

    • @davialves6021
      @davialves6021 Рік тому

      @@CustAndCode I managed to do my enhancement, but I thank you all the same. I'm starting now as an ABAP developer and your videos help a lot.

    • @CustAndCode
      @CustAndCode  Рік тому

      @@davialves6021 Thank you for your feedback! 🤗 ABAP is nice, you will see 🤗😀

  • @jona156
    @jona156 Рік тому

    Hi! please, could you explain in a video how to configure ADS to show Adobe Forms ? thanks!!

    • @CustAndCode
      @CustAndCode  Рік тому

      Unfortunately, I have very rarely used ADS myself. 🙄

  • @ekekakos
    @ekekakos 9 місяців тому

    Hello and thanks. I need desperately to understand how I respond to an external rest api by sending a csv file in multipart as it would be huge. So my response must return a multipart file besides some other information data. I will be much obliged if you can help me. Thanks Elias

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

      Unfortunately, I don't have any special experience with that either. 🙄

  • @Parida902
    @Parida902 Місяць тому

    Hi
    Can I get some sample program
    In which we can post the pdf file and meta data in JSOn format in one request in rest spi using multipart form object in sap abap

    • @CustAndCode
      @CustAndCode  Місяць тому

      Maybe you can find an API on rapidapi.com or additional sites where you can test your call.

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

    Your code works, but I'm getting SSL handshake error. Did you have to upload a certificate using SAP tcode STRUST ? This is the error I got: SSL handshake failed: SSSLERR_PEER_CERT_UNTRUSTED (-102). Peer's X.509 Certificate (chain) is untrusted

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

      Exactly! You have to upload a certificate using T-Code STRUST. Have a look at this video here: ua-cam.com/video/SXFXWKlIpdE/v-deo.html

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

    How about doing vice versa? File is coming from external server and downloading it to SAP? I have a requirement wherein the file is uploaded in POSTMAN and it will be stored in SAP Application Server. Hope you can help on this. Thanks!

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

      Yes, I made a few videos about that, this is the first one, a simple GET request. ua-cam.com/video/2-32Ru7hnhE/v-deo.html
      There are some other too like POST Call or transfere File and so on. hth 🤗

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

      @@CustAndCode a pdf file is uploaded in POSTMAN. I need to convert the json string of the PDF file into BASE64 so I can upload the file in AL11

    • @CustAndCode
      @CustAndCode  Місяць тому

      check the class cl_http_utility 🤗

  • @nitin11meena
    @nitin11meena 8 місяців тому

    I need similar kind of requirement where output type document needs to be posted to content server.

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

      This should work or? 🤔

    • @nitin11meena
      @nitin11meena 7 місяців тому

      @@CustAndCode I didnot try yet due to environment setup,will find first the plug in point where I can write rest API code. If you have any idea then let me know.

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

      @@nitin11meena Unfortunately, I've never had a requirement like this before. 🤔

  • @coolashmak1
    @coolashmak1 Рік тому

    Can I use the same program for POST request body for JSON?

    • @CustAndCode
      @CustAndCode  Рік тому

      Yes you can! 🤗

    • @ardydk9944
      @ardydk9944 Рік тому

      @@CustAndCode sir can you explain what line of code that i must change if i want to use json post method (only send json format ). sorry im just learn API and still confused step by step to use this api to post json data
      thanks

    • @CustAndCode
      @CustAndCode  Рік тому

      @@ardydk9944 Which API do you use? Is this a public API? Can I try it? Or is it private? 🤔

    • @ardydk9944
      @ardydk9944 Рік тому

      @@CustAndCode its private API sir, i just receive the url of the API with localhost****, no uname & pass, its possible to send API with this url?

    • @CustAndCode
      @CustAndCode  Рік тому +1

      @@ardydk9944 Ok, I will check if i find an public API where I can post a JSON snippet. Then I can provide a sample code. 🤔

  • @coolashmak1
    @coolashmak1 Рік тому

    Awesome....the POST method for API REST is great...but you could have used JSON format itself.

    • @CustAndCode
      @CustAndCode  Рік тому

      Thank you! Yes, thats right, ou can use JSON as payload as well. 🤗😀

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

    Can you share the code ?

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

      I already did 😉 Unfortunately I do not provide a blog 🙄

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

      @@CustAndCode You don't use github ?

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

      @@FunHappyAngryBirds Just for backup 🤗

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

      @@CustAndCodeI've implemented your program, but I'm getting certificate error. Did you have to load any certificate in SAP using tcode STRUST ? This is the error I got: SSL handshake with qr-code-and-barcode-scanner.p.rapidapi.com:443 failed: SSSLERR_PEER_CERT_UNTRUSTED (-102)
      Peer's X.509 Certificate (chain) is untrusted

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

      @@CustAndCode Your code works, but I'm getting SSL handshake error. Did you have to upload a certificate using SAP tcode STRUST ? This is the error I got: SSL handshake with qr-code-and-barcode-scanner.p.rapidapi:443 failed: SSSLERR_PEER_CERT_UNTRUSTED (-102)
      Peer's X.509 Certificate (chain) is untrusted