Adding SAP service data objects
You must configure the SAP JCo adapter in Rational Developer before using these instructions. If you see the following error message when you try to use the SAP wizards:
your adapter may be missing or not configured correctly.For more information, refer to Setting up SAP development environments.
These instructions will guide you through the process of connecting to an SAP source and specifying either a BAPI or RFM data object for use in your application. To build a command that invokes BAPI, know the name of the business object and the name of the method within that object.
- Open a Faces JSP file.
- From the Data palette, click on either SAP BAPI or SAP RFM and drag it to the JSP file. The Create EIS SDO Object wizard will open.
- In the Name field, type the name of your SDO.
- If you are reusing information from a previously created object, check the box labeled "Reuse metadata definition from an existing record or record list." Note: you will need to have imported the existing metadata file into the workspace before you can select it via the wizard.
- Click Next.
- In the Select server connection page, choose a connection from the drop-down menu. If you do not have an existing connection, do the following:
- Click Browse.
- In the Browse Connections dialogue box, click Add.
- In the Create or Edit a Connection dialogue box, enter the values necessary to make a connection to your SAP database server. To enter the SAP host information necessary for the Details field, click Assemble.
- Click OK.
- In the Browse Connections dialogue box, make sure that your new connection is highlighted; then click OK to return to the Select Server Connection page.
- After establishing the server connection, select the main function:
- If using the BAPI interface, you start with searching the target business object.
- If using the RFM interface, you can search by the method name or a method group name,
Enter the necessary information and click Search. A list of search results will appear in the window below. Navigate in the window to reveal the target SAP function.
- To set a function as the main function, click the
button located next to this window.
- If the main function needs to work in coordination with a pre or post function, check the box labeled "Configure Pre and Post functions". Otherwise, proceed to step 11. (For example, when using BAPI_ADDRESSEMP_CREATE to create an address record for an employee, you will need to acquire a lock on the Employee record before the create. Then, drop the lock. In this scenario, the BAPI_EMPLOYEE_ENQUEUE is the pre-function and BAPI_EMPLOYEE_DEQUEUE is the post-function.)
- (Optional) Search for the pre or post functions in the same manner that you searched for main functions (described in step 6). The tree will come up with business objects and methods.
- (Optional) To set the pre and post-functions, click the appropriate button:
- Pre-function -
![]()
- Post-function -
![]()
- Click Next. If you did not choose to set Pre and Post Functions in the optional steps, the wizard will skip the "Configure Mappings" page (step 13).
- In the Select Functions dialogue box, accept the default functions by clicking All; otherwise check the functions that you want to set. Click Next. Required functions appear greyed-out.
- In the Configure Mappings page, map the parameter field that uniquely identifies the main function's target record to the parameter field that uniquely identifies the pre or post function's target record. To set the proper mapping to the main function, click the corresponding table cells of the pre or post-function columns; then click Next.
- In the Configure Help Values page, the wizard automatically finds out which of the main function's parameter fields need help values and lists them in this table. Each row in the table corresponds to one help values mediator. Use this page to configure the filter criteria of each help value mediator. The options are as follows:
If you skip the configuration in this page, ALL the help values defined for a particular field will be retrieved.
Mediator Description Selection Field Click this to choose the parameter field on the help values data object that will be used to configure the filter criteria External Name This is an alias that you set for the internal field corresponding to the one selected in the "Selection Field" cell. It is used in the help values SDO object to identify this column. Sign Choose either Inclusive (I) or Exclusive (E) from the drop-down menu. Inclusive (I) - the matched help values will be included in the retrieval result. Exclusive (E) - the matched help values will be excluded in the retrieval result. Operator Click this field to select an operator for comparison from the drop-down menu. - Click Finish. The metadata will be saved to be used at runtime. The SDO data object(s) will be created for the JSP page.
The SDO objects will show up in the "Page Data" view to use with JSF UI creation and configuration.
Related concepts
SAP data access
Related tasks
Setting up SAP development environments
Creating controls and binding with SAP SDOs