Show TOC

Redefining Service - Project with ModelLocate this document in the navigation structure

When you select redefine option for a project with an existing model created by methods other than redefine, for example, by importing a data model, importing a data source or hand craft a model in the Service Builder, you will be provided with the option to overwrite the existing model. On choosing to overwrite, the existing model and the generated classes will be overwritten.

  1. Log onto the SAP Gateway system.

  2. Open transaction SEGW.

    The SAP Gateway Service Builder opens.

  3. Open an existing project you want to redefine.

  4. Click Display/Change to switch to editing mode.

  5. Right-click on the Data Model folder and in the resulting submenu, select Start of the navigation path Redefine  Next navigation step OData Service (SAP GW) End of the navigation path.


    A message box is displayed in which you are prompted to confirm whether you want to overwrite an existing model

  6. Choose Yes to overwrite the existing model.

    The Wizard Step 1 of 2: Redefine Service is displayed.

  7. Enter the technical name of the service you wish to redefine in the Technical Service Name. Alternatively, you can also use the input help available for this field.

  8. On selecting the service from the input help window, the version of the service is automatically populated.


    If you enter the technical service name manually, you must specify the version.

  9. If the metadata of the selected service resides in another system, select Metadata to be fetched from an external system. in the Target System for Metadata.

  10. On the selection of the Metadata to be fetched from an external system the RFC Destination field becomes editable to select the RFC destination of the external system using the input help.

  11. Click Next to continue.


    If the RFC destination is incorrect, an error message is displayed.

  12. On successful validation of the RFC destination, the Wizard Step 2 of 2: Redefine Service opens.

  13. Select the required artifacts.

    There is a selection logic in the backend, which automatically includes all the entity types that are end types/return type of chosen association/function import. The reverse is not selected. For example, consider the following model:



    • complex_type_1

    • complex_type_2


    • entity_type_1

    • entity_type_2

    • entity_type_3


    • association_1 (between Entity_type_1 & Entity_type_2)

    • association_2 (between Entity_type_1 & Entity_type_3)


    • function_import_1

    Case1: User selects Entity_Type_1, Entity_Type_2 and Association_1. All these entities are selected and used in the new model. If Entity_Type_1 & Entity_Type_2 uses Complex_Type_1 & Complex_Type_2, they are automatically selected.

    Case2: User selects Entity_Type_1, Association_2. Since Entity_Type_3 is part of the Association_2, Entity_Type_3 is selected automatically along with Entity_Type_1 and Association_2.

  14. Choose Finish after you have made the relevant selections.

  15. The Service Builder performs the consistency check of the imported model and a message is displayed. The selected artifacts are then transferred to the respective folders in the tree view of the Service Builder. Also, an entry with the name and the version of the service selected for redefinition is created under the Model Reference folder in the Service Builder.

  16. Double-click the referenced model and the mass maintenance view displays Model Reference Type as Extend to indicate that this model can be extended.


    If the model has been referenced as an Include, the model reference type displayed is Include instead of Extend.

  17. You can perform the following redefinitions for the model imported:

    • Delete the artifacts.

    • Change the Node Names and Labels.

      1. Switch to edit mode.

      2. Choose the Redefine Attribute button.

        The Node Name and the Label fields can be edited.

      3. Choose the Undo Redefinition button to revert the redefined value to the original value.

      4. Choose the Undo Identical Redefinition button to view the fields which have been reverted to their original values in the course of editing.


    During redefinition of a service, changes to the external name and labels are allowed, but deleting a label is not supported. In case if you delete a label, the following will be the impact.

    • Metadata will not reflect the deletion and will still show the label.

    • There will be issues in the assignment of text keys to labels in the generated MPC, which will lead to incorrect label settings for other artifacts.

  18. After you have completed the redefinition process, you can generate runtime objects.


    Generation of MPC and DPC:

    Case1: Overwrite Base/Extended Service - If you have redefined an existing service, an additional section Service Extension will appear in this wizard. Select Overwrite Base/Extended Service, to overwrite the contents of the referenced service class. This option allows you to access the redefined (new) service using the redefining (base) service URL. You can no longer access the redefining service using the same URL.

    Case2: Create a new service — A new service and a new model will be created and registered during the generation process.

    A new set of DPC classes will be generated.

    See Generating the Service for more information.

  19. After the service has been generated, the MPC and DPC classes are stored in the Runtime Artifacts folder.