Show TOC

Generating the ServiceLocate this document in the navigation structure

Use
This section guides you to generate the Model Provider Classes, Data Provider Class and Annotation Provider Classes in the Service Builder:
Procedure
You can generate the service after importing the properly defined data model into the Service Builder project you have created. In addition, you should regenerate the service whenever you modify the properties of the data model. To generate Model Provider Class and Data Provider Class proceed as follows:
  1. Open the SAP Gateway Service Builder using the transaction SEGW. There are two scenarios you could encounter:
    1. You have to create a new project. In this case, first create a project. For more information, see Creating a Project and Importing Data Model and then follow the steps provided in this section to generate the MPC, DPC and APC classes.
    2. A project might already exits.In this case proceed as follows:
  2. Click the icon Display-->Change (Display-->Change) to switch to edit mode.
  3. Right click the project folder and click Generate Runtime. Alternatively, you can also select the project and click the icon Generate Runtime Objects (Generate Runtime Objects) in the tool bar.
    On following any of the above steps, the Model and Service Definition dialog box displays for the projects of type Service with SAP Annotations and Service with Vocabulary-Based Annotations. For project of type Annotation Model for Referenced Service dialogue box Annotation Model Definition appears
    Note Incase if you do not want to generate the DPC, you have an option to deselect the Generate Classes check box. By doing so, this dialog displays during regenerations till the DPC is generated. But the Model Provider Class names can be specified only once during generation. The Service Builder automatically populates the names values for the fields in the Model and Service Definition dialog box. Optionally you can also change the proposed names for the classes to be created.
  4. To change the proposed names for MPC and DPC, do the following:

    Fields

    Proposed Naming Convention

    Class Name - Implementation Class

    CL_<Project Name>_MPC_EXT

    Project Name is the actual name of project in the Service Builder.

    Base Class Name

    CL_<Project Name>_MPC

    Project Name is the actual name of project in the Service Builder.

    Class Name - Implementation Class

    CL_<PROJECT NAME>_DPC_EXT

    Base Class Name

    CL_<PROJECT NAME>_DPC_EXT

    Technical Model Name

    <PROJECT NAME>_MDL. For example, SALESORDER_MDL

    Technical Service Name

    <PROJECT NAME>_SRV. For example, SALESORDER_SRV

  5. If the project is of type Annotation Model for Referenced Service:
    • Class Name — Implementation Class: CL_<Project Name>_APC_EXT. Project Name is the actual name of project in the Service Builder.
    • Base Class Name: CL_<Project Name>_APC. Project Name is the actual name of project in the Service Builder.
    • Technical Model Name: ZTESTAPC_ANNO_MDL
  6. If you have redefined an existing service, an additional section Service Extension will be available in this wizard. In this section, select Overwrite Extended Service to overwrite the contents of the referenced service class. By doing this, the BEP registry stores the values of Technical Service Name and Service Version while generating the runtime objects.
  7. Click the icon, Continue, Continue (Continue) to start the generation. The Transport Request dialog opens. Click Local or assign the objects to the appropriate package.
The Service Builder creates the classes, lists them in the Generated Objects folder of the project and registers the service.
Result
On successful generation, the generated objects are stored under the Generated Objects folder in the tree view. Also the message displaying the results of the generation are displayed in the mass edit view. In addition, you have registered the service for use in SAP Gateway.