Kommentar verfassen
Das Schreiben von Kommentaren ist nur registrierten Benutzern erlaubt, die Registrierung ist kostenlos und erfordert keine E-Mail Adresse und kann schnell hier durchgeführt werden.
Das Schreiben von Kommentaren ist nur registrierten Benutzern erlaubt, die Registrierung ist kostenlos und erfordert keine E-Mail Adresse und kann schnell hier durchgeführt werden.
Hey,
great overview, as usual! Will try to use the more up-to-date classes nowadays, instead of the good old (do it all by hand) CL_HTTP_CLIENT classes.
Q: when it comes to On-Premise (& Private Cloud), you mention the class CL_WEB_HTTP_CLIENT_PROVIDER and that it is currently not available and that instead we can use CL_OUTBOUND_PROVIDER_HTTP. The former got me 'confused' when it comes to this article, as there is no mention of it within the Steampunk/Public Cloud section. There is the CL_HTTP_DESTINATION_PROVIDER and CL_WEB_HTTP_CLIENT_MANAGER but no use or example of the CL_WEB_HTTP_CLIENT_PROVIDER.
Not having used it, based on the description here (https://help.sap.com/docs/abap-cloud/abap-integration-connectivity/apis-for-integration-and-connectivity) it seems like a convenience wrapper/factory. But as it isn't mentioned, it got me a tad confused when first reading. Maybe I'm thinking too much, but it might help adding some context to it here. :)
Thank you for the hint, could be a mistake in the class naming and there should be the class CL_HTTP_DESTINATION_PROVIDER. Will check this and correct it, If it is wrong.
URL Length for S4/HANA and Private Cloud
Hey! Really useful article here, thanks a lot for this work.
Q: While calling the class+method cl_outbound_provider_http=>create_by_url through a wrapper in On-Premise & Private Cloud use cases, you use c_destination as the parameter for the method. c_destination is defined as an empty string constant, and I understand it is mainly for example purposes, but the thing is I_NAME from cl_outbound_provider_http=>create_by_url has "RFCDEST" as a type, which is a CHAR 32.
The url you use for the Public Cloud example is https://software-heroes.com/api/v1/rest-test/partner and it is over 32 characters long.
Is there any way of using this solution for URLs that are longer than 32 characters? For example, I need to call the Attachments OData V2 API listed on https://api.sap.com/api/OP_API_CV_ATTACHMENT_SRV_0001/overview Problem is, /sap/opu/odata/sap/API_CV_ATTACHMENT_SRV is also longer than 32 characters.
Do you know of any workarounds for these cases? Thank you in advance
Hi julchat,
when the type is RFCDEST, you should provide a SM59 destination. There you can configure your full URL to the API and also an authentication, if needed.
In my example I have used the class CL_HTTP_DESTINATION_PROVIDER that provides a method to create via URL. On-Premise you use the class CL_OUTBOUND_PROVIDER_HTTP that do not have this method. There you can only create the object via "CREATE_BY_DESTINATION" and there you need a pre-defined destination. The destination in SM59 should be type "G", Host is for example "api.sap.com" and Path Prefix "/sap/opu/odata/sap/API_CV_ATTACHMENT_SRV".
The downside for On-Prem is, that you need the destination and could not create the client via URL (at the moment).
Hope this helps you.