Skip to Content
0

How to find the O Data Service Names and Technical Names of an Entity Set

Mar 30, 2017 at 05:23 PM

52

avatar image
Former Member

Hi Experts ,

How to Get the List of Properties of an Entity set with respective Technical Field names

using any standard method.

Eg :

i want to get the list of Property name and ABAP Field names of an Entity set

Please suggest

thank you..

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Christian Wolter Mar 31, 2017 at 05:46 AM
0

Hi,

some code example (called in a DPC_EXT-class):

DATA: lo_metadata_provider TYPE REF TO /iwbep/if_mgw_med_provider,
      lo_model             TYPE REF TO /iwbep/cl_mgw_odata_model,

lo_metadata_provider = /iwbep/cl_mgw_med_provider=>get_med_provider( ).

lo_model ?= lo_metadata_provider->get_service_model(
                      iv_svc_ext_name           = mr_service_document_name->*
                      iv_svc_namespace          = mr_service_namespace->*
                      iv_svc_version            = mr_service_version->*
                      iv_do_check_for_extension = abap_true
                    ).

DATA(lr_entity) = lo_model->get_entity( *name of your entity* )

"lr_entity->properties contains the fieldmapping

I hope this will help you.

Best regards

Christian Wolter

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Christian ..

Thanks for Reply.

How to get the list of properties from lr_entity.

0
avatar image
Former Member Mar 31, 2017 at 07:43 AM
0

Hi Christian ..

Thanks for Reply.

How to get the list of properties from lr_entity.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Anu,

you can access lr_entity->properties directly. lr_entity is TYPE REF TO /IWBEP/IF_MGW_MED_ODATA_TYPES=>TY_S_MED_ENTITY_TYPE.

Thats a reference of a structure.

Best regards

Christian Wolter

0