
This section guides you to generate the Model Provider Classes Data Provider Class in the Service Builder:
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:
Open the SAP NetWeaver Gateway Service Builder using the transaction SEGW.
There are two scenarios you could encounter:
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 class.
A project might already exits.
In this case proceed as follows:
Click the icon, Edit, to switch to edit mode.
Right click the project folder and choose Generate Runtime
Alternatively, you can also select the project and click the icon,
Generate, in the menu bar.
On following any of the above steps, the Model and Service Definition dialog box displays.
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.
To change the proposed names, do the following in the .
|
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 |
Click the icon, Continue, to start the generation.
The Transport Request dialog opens.
Choose 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.
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.
You have generated code for the MPC and DPC classes.
In addition, you have registered the service for use in Gateway.
Next steps requires that you implement your own code to redefine the implementation classes for the MPC and he DPC.
To proceed to the next steps, see Redefining the MPC Implementation Class, and then Redefining the DPC Implementation Class.