cancel
Showing results for 
Search instead for 
Did you mean: 

odata deep read entity ($expand) in RAP BTP Scenario

sebastian_wilhelm1
Participant
0 Kudos

Hi experts! 

I'm trying to deep read product data from an on-premise system via OData in the BTP ABAP Environment with the help of https://help.sap.com/docs/btp/sap-business-technology-platform/expand-option.

Unfortunately, I can't get the child-data 'Plant Texts' for the parent entity 'Product Plant'.

 

TYPES: BEGIN OF ty_business_data,
             product       TYPE c LENGTH 40,
             plant         TYPE c LENGTH 4,
             profit_center TYPE c LENGTH 10,
             to_plant_text TYPE zcm_material2_odata=>tyt_a_product_plant_text_type,
           END OF ty_business_data.
    DATA:
      lt_business_data TYPE TABLE OF ty_business_data.
...
DATA(lo_resource) = lo_proxy->create_resource_for_entity_set( |A_PRODUCT_PLANT| )->create_request_for_read( ).
        lo_resource->set_top( 50 )->set_skip( 0 ).
        lo_resource->set_select_properties( VALUE #( ( CONV #( 'PRODUCT' ) ) ( CONV #( 'PLANT' ) ) ( CONV #( 'PROFIT_CENTER' ) ) ) ).

        DATA(lo_expand_node_root) = lo_resource->create_expand_node(  ).
        DATA(lo_expand_node) = lo_expand_node_root->add_expand( 'TO_PLANT_TEXT' ).
lo_expand_node->set_select_properties( VALUE #( ( CONV #( 'PRODUCT' ) ) ( CONV #( 'PLANT' ) ) ) ).

        DATA(lo_response) = lo_resource->execute( ).

        lo_response->get_business_data( IMPORTING et_business_data = lt_business_data ).

 

the child-table remains empty.

sebastian_wilhelm1_0-1707382003341.png

Does anyone know where the error is or how I can read the child data?

Thanks and regards, Sebastian

Accepted Solutions (0)

Answers (0)