Show TOC

Creating the ABAP ClassesLocate this document in the navigation structure

Activities

You automatically generate code for the runtime functionality of your data model. The Service Builder generates the classes with the generated code, and handles the service registration process for IW_BEP based services for you.

The generated classes are listed in the Runtime Artifacts folder.

To create the classes and register the service, proceed as follows:

  1. In the SAP Gateway Service Builder, right click the created project and select Generate Runtime Objects.

    Alternatively, select the project, and click the Generate icon, or from Project in the menu, select Generate.

    The Model and Service Definition window displays. All the fields in this window are editable.

  2. Enter a name for the implementation class in the Class Name field. Proposed naming is, CL_<PROJECT NAME>_MPC_EXT.

  3. Enter the name for the base class in the Base Class Name field. Proposed naming is, CL_<PROJECT NAME>_MPC

    Note
    • The MPC names cannot be changed after generation.

    • If you do not want to generate the DPC, deselect Generate Classes.

    • Class names are mandatory.

  4. Select Generate DPC to generate the classes for the Data Provider Class (DPC).

    If you deselect Generate DPC, classes do not generate for the DPC, and Service Registration is not available.

  5. In Backend Operation Proxy (BOP) Prefix, specify a prefix. The specified prefix is used as part of the BOP interface name. The default prefix is ZIF_.

    By default, the BOP prefix name is: <namespace of the project> and the <IF_>.

    When you generate the project, Service Builder checks if the BOP prefix is aligned with the chosen package (derived from the transport request).

    If not aligned, the appropriate error message displays.

    In addition, Service Builder creates the BOP interface name for each function module that has been mapped in the specific project. The BOP interface name is created as follows: <BOP prefix> and the function module name.

    The generated BOP interface is available in the Runtime Artifacts folder under the project and it is listed as Backend Operation Proxy.

  6. Under Service Registration, you can do the following:

    • Technical Model Name

      Specify the Technical Model Name. This references the Model Provider Class which provides the metadata for the model.

    • Model Version

      Specify the version number for the model.

    • Technical Service Name

      Specify the Technical Service Name. This is a key to assign the models to a Service.

    • Service Version

      Specify the version number for the service.

    Note

    Make a note of the Technical Service Name. You use this name to register and to activate the specific service in the SAP Gateway system.

    See the SAP NetWeaver documentation about Adding the Service to register and activate the service in the SAP Gateway system.

    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.

    The BEP registry stores the values of Technical Service Name and Service Version while generating the runtime objects.

    You can edit the Technical Model Name. The Technical Service Name cannot be edited.

    An error displays if you do not specify the technical names.

  7. Click Continue. The Transport Request dialog box opens.

  8. Click Local, or assign the objects to the appropriate package.

    You can assign the generated classes to a transport request. The Service Builder checks if the MPC classes are already assigned to a transport request package, and if they are, the DPC classes are automatically assigned to that same transport request.

The Service Builder saves the content of the project, checks the project, and saves it again. It then creates the classes, lists them in the Generated Objects folder of the project, and registers the service in the back-end system.

Double-click any of the content in the Runtime Artifacts folder, on the right.

In the Runtime Artifacts screen, you can view the properties of the classes.