cancel
Showing results for 
Search instead for 
Did you mean: 

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

0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

flotxi
Participant

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.