Skip to Content
author's profile photo Former Member
Former Member

s4 hana cloud api authorization error

Dear Experts,

when we use the App delpoyed on S/4 HANA cloud to retrieve data from api API_MATERIAL_DOCUMENT,

( SAP_COM_0108 https://api.sap.com/api/API_MATERIAL_DOCUMENT_SRV/resource)

we got en error with"No authorization to access Service".

but there is no problem when we deploy App on sap cloud platform and retrieve data from api by communication user,

we find " Only authorized roles can be used to retrieve, create, and cancel material documents via API calls." in api help document,

https://help.sap.com/viewer/7760de6f44074d4994c4da9832f7bfca/1908.500/en-US/d4c919581bc30a02e10000000a44147b.html

but whitch role should we assign to user to solve this problem?

Thanks!

32146-image.png (101.6 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    Posted on Oct 18, 2019 at 01:58 AM

    Hi

    The error looks like an auth. problem and therefore the request is redirected to the IDP. Please verify the password for the CC-User: try to call that service from a browser in incognito mode or using a POSTMAN to check if you can access it with the Communication user you have already set up. This way you can isolate if this is the problem with your Comm. user.

    If the above looks good, then probably we need to check how the authorization is set up in the SAP Cloud Platform. Please review the KB article: https://launchpad.support.sap.com/#/notes/2831186 for further reference. These are the preliminary steps to look out for. Thank you!

    Amith Nair

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Amith,

      other Apps that we deployed in S4 HANA Cloud works well, only the App whitch use API_MATERIAL_DOCUMENT have problem.

      i have another question , if we deploye App in SAP Cloud Platform, we use Communication user whitch we configured in destination to access api , but when the App is deployed in S4 HANA Cloud , whether we use current log in user to access api?(since i think we don't use destination in S4C and when there are multiple Communication users system can't consider whitch to use)

  • Posted on Oct 17, 2019 at 08:25 AM

    Hi,

    Can you provide information about the App which is deployed in S4 Hana Cloud, How did you develop and deploy this app.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 22, 2019 at 07:59 AM

    Hello

    When you say you use the app deployed on S/4HANA Cloud can you be more specific? Is this a custom app you built on SAP CP and deployed to S/4HC?

    You are correct in that only the communication user has access to this API via communication arrangement and you are getting the error because your CB* user is being used. There are no roles to give to your CB* user to solve this problem.

    If you are consuming an API on SAP CP, then via the destination you are using the comm user. Can you provide more details on your app and how this URL plays into the sequence?

    Thanks,

    Marty

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Marty.

      here are details:

      1. i develop custom App by web ide on SAP CP.

      in code , i create en odata model like this

      var oModel = new ODataModel("/s4cloudPrd/sap/opu/odata/sap/API_MATERIAL_DOCUMENT_SRV/", true);

      the "s4cloudPrd" is the destination i configured in SAP CP whitch connected to S/4 HANA Cloud.

      2.then i deployed the App to SAP CP

      3.i access App from SAP CP portal, and it works fine.

      4.then i migrate the App project to another webide on SAP CP whitch configured with Single Sign-On to S/4HANA CP(deploy to S/4 HANA CP need sso ,i refer to this document https://help.sap.com/viewer/841f379acd104dbf8685b3ad26e66af3/SHIP/en-US/be48b30a67ab48429ed5ead7913c82a2.html)

      5.i change the code and delete the destination in path of creating model(i only do this change),the new code is like this:

      var oModel = new ODataModel("/sap/opu/odata/sap/API_MATERIAL_DOCUMENT_SRV/", true);

      6.i access App from S/4 HANA CP.

      i have developed many APPs and deployed them on SAP CP and S/4 HANA CP. all APPS works fine but the APP use API_MATERIAL_DOCUMENT_SRV, it occurs en authourity error only on S/4 HANA CP.users want to use the APP in S/4 HANA CP.

      Thanks for your kindly help

  • author's profile photo Former Member
    Former Member
    Posted on Oct 23, 2019 at 06:31 AM

    #


    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.