02-08-2024 8:49 AM - edited 02-08-2024 8:50 AM
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.
Does anyone know where the error is or how I can read the child data?
Thanks and regards, Sebastian
User | Count |
---|---|
78 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.