Skip to Content
0

Extend oData Services - Issue with new created Entity not appearing in the DPC_EXT

Feb 28, 2017 at 02:45 PM

45

avatar image
Former Member

1) Created a Custom project in SEGW tcode :ZMDG_SUPPLIER_EXTENSION

2)Right click on Data Model->Re-define->oData Service

3)Entered the Technical Service Name:MDG_SUPPLIER_SRV(Request Supplier OData Service) and click Next

4)Selected all the entities and click Next

5)Now add new Entity and but i am not able to find any methods of that entity in DPC_EXT class

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

1 Answer

Florian Dornauer Jul 04 at 07:36 AM
0

The Service Builder doesn't support the generation of added Entities to an extended OData Serivce.

You have to implement the generic interface methods like e.g. GET_ENTITY (same for the other CRUD+Q operations).

CLASS ... DEFINITION
  ...
  PUBLIC SECTION.
    METHODS: /iwbep/if_mgw_appl_srv_runtime~get_entity REDEFINITION.

ENDCLASS.

CLASS .... IMPLEMENTATION.
METHOD /iwbep/if_mgw_appl_srv_runtime~get_entity.

    CASE io_tech_request_context->get_entity_set_name( ).
      WHEN 'YOUR-NEW-ENTITY-NAME'.
        " your READ Method
        
      WHEN OTHERS.
        super->/iwbep/if_mgw_appl_srv_runtime~get_entity(
          EXPORTING
            iv_entity_name               = iv_entity_name
            iv_entity_set_name           = iv_entity_set_name
            iv_source_name               = iv_source_name
            it_key_tab                   = it_key_tab
            it_navigation_path           = it_navigation_path
            io_tech_request_context      = io_tech_request_context
          IMPORTING
            er_entity                    = er_entity
            es_response_context          = es_response_context ).

    ENDCASE.
  ENDMETHOD.
Share
10 |10000 characters needed characters left characters exceeded