on 04-22-2015 9:25 AM
hello.
i want to access the MPC from the DPC methods, i.e. ..._GET_ENTITYSET(). How to retrieve the instance of te MPC connected to the current DPC?
background info:
i want to use the labels assigned to ABAP structure components of an entity type without hard.coding them...
cheers
--MIKE
here comes the solution:
* determine name of OData property assigned to ABAP field VBELN
data:
facade type ref to /iwbep/cl_mgw_dp_facade,
model type ref to /iwbep/if_mgw_odata_re_model,
entity_type type ref to /iwbep/if_mgw_odata_re_etype,
properties type /iwbep/if_mgw_odata_re_prop=>ty_t_mgw_odata_properties,
name type string.
field-symbols:
<property> type line of /iwbep/if_mgw_odata_re_prop=>ty_t_mgw_odata_properties.
facade ?= me->/iwbep/if_mgw_conv_srv_runtime~get_dp_facade( ).
model = facade->/iwbep/if_mgw_dp_int_facade~get_model( ).
entity_type = model->get_entity_type( |{ iv_entity_name }| ).
properties = entity_type->get_properties( ).
read table properties
assigning <property>
with table key technical_name = 'VBELN'.
if sy-subrc eq 0.
name = <property>-property->get_name( ).
endif.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
has anybody ever tried to retrieve the model instance /iwbep/if_mgw_odata_re_model while instantiation of the DPV? in my case it seems to create a dump....
i would like to retrieve the model in CONSTRUCTOR and store its reference in an instance attribute, so that all other methods can access it easily...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.