Skip to Content
avatar image
Former Member

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

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..

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Mar 31, 2017 at 05:46 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

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

    Hi Christian ..

    Thanks for Reply.

    How to get the list of properties from lr_entity.

    Add comment
    10|10000 characters needed 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