on 07-08-2022 11:21 AM
Hello,
I am trying to use the busines partner api to read the supplier company of a business partner.
I created the service consumption model with the metadata.xml from the $metadata call of the service in the backend system and selected entities business partner, supplier & supplier company.
Reading the BP works fine, but as soon as I add "->navigate_to_single( '_Supplier' )" and exception(/IWBEP/CX_V4_MED) is raised with text "Eigenschaft '_Supplier' nicht gefunden"
Any ideas?
data ls_entity_key TYPE ZA_BUSINESSPARTNER5CABDC63FB.
data ls_business_data TYPE za_businesspartner5cabdc63fb.
DATA(lo_http_destination) = cl_http_destination_provider=>create_by_cloud_destination( i_name = 'XXX' ).
DATA(lo_web_http_client) = cl_web_http_client_manager=>create_by_http_destination( lo_http_destination ) .
DATA(lo_client_proxy) = cl_web_odata_client_factory=>create_v2_remote_proxy(
EXPORTING
iv_service_definition_name = 'ZS4_API_BUSINESS_PARTNER'
io_http_client = lo_web_http_client
iv_relative_service_root = '/sap/opu/odata/sap/API_BUSINESS_PARTNER/' ).
" Set entity key
ls_entity_key-businesspartner = '300000050'.
" Navigate to the resource
DATA(lo_resource) = lo_client_proxy->create_resource_for_entity_set( 'A_BUSINESSPARTNER' )->navigate_with_key( ls_entity_key )->navigate_to_single( '_Supplier' ).
DATA(lo_response) = lo_resource->create_request_for_read( )->execute( ).
DATA(lo_response)->get_business_data( IMPORTING es_business_data = ls_business_data ).
CATCH cx_root INTO DATA(e).
DATA(text) = e->get_text( ).
ENDTRY.
Can you try uppercase letter: "_SUPPLIER"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.