Skip to Content

Mapping not allowed. The model in project ZGW_HCM_MYTIMESHEET_X is redefining another mode

Hi Folks,

we are trying to extend the HCM_TIMESHEET_MAN, for same we followed below steps

Steps

1. Created custom project

2. Right click on data model->redefine->OData Service(SAP GW)

3. provided the service name: HCM_TIMESHEET_MAN and version: 001

4. Selected all the and clicked on Finished button

5. Saved and Clicked on generate runtime artifacts

6. Created new entity type and entity set to full fill our requirement

7. trying to service implementation for new entityset but it ended with error

Error is 'Mapping not allowed. The model in project ZGW_HCM_MYTIMESHEET_X is redefining another mode'

Back-End

BASIS 740 SP10

ABAP 740 SP10

GWFND 740 SP11

GBX01HR 600 SP07

Please do the needful, thanks in advance

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Mar 22 at 02:46 PM

    Hi Kiran,

    the reason for this behavior is that the Service Builder does not generate entity set specific methods if you add entity sets to a service that has been generated via redefinition.

    You have thus to redefine the generic methods of the framework (e.g. /iwbep/if_mgw_appl_srv_runtime~get_entityset to handle GET_ENTITYSET calls for your newly created entity set).

    And you have to develop your own entity set specific methods.

    method /iwbep/if_mgw_appl_srv_runtime~get_entityset.
    
        data lv_entityset_name type string.
        data lr_entity type ref to data.
    
    
    lv_entityset_name = io_tech_request_context->get_entity_set_name( ).     
    
    case lv_entityset_name.
          when '<your new entity set>'
    
    "your code to retrieve your data .... 
    
    when others.         
    
    super->/iwbep/if_mgw_appl_srv_runtime~get_entityset(...
    
    endcase.
    
    
    endmethod.

    Regards,

    Andre

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 22 at 01:56 PM

    continuing with the querry, PFB the image which shows the error message while trying to perform: Service Implementation -> Map to Data Source

    Your help is appreciated. Thanks :)

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 22 at 03:32 PM

    Hi Andre Fischer,

    Thank you very much for your prompt and correct response. I did exactly the same way you'd explained and it worked. :)

    Add comment
    10|10000 characters needed characters exceeded

    • Thank you Andre Fischer

      But I remember that when we extended the V1 My Timesheet it was allowed us to implement the service implementation for newly created entityset in extended OData service.