Show TOC

Generating the ServiceLocate this document in the navigation structure

Use

This section guides you to generate the Model and Data 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. Follow the instructions given in section Creating a Project and Using File Importer

      and then follow the steps provided in this section to generate the MPC, DPC and APC. class.

      Note

      APC classes can be generated only for the projects of type Annotation Model for Referenced Service.

    2. A project might already exits.

      In this case proceed as follows:

  2. Click 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 Generate Runtime Projects in the tool bar.

    On following any of the above steps, the Model and Service Definition dialog box displays for 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

    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 respective 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 Continue to start the generation.

    The Transport Request dialog opens.

  8. 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.

More Information

Next steps requires that you implement your own code to redefine the implementation classes for the MPC, DPC and APC.