You can enable IBM App Connect to pass key information between a SAP OData system and your apps – automatically, in real time. For example, the billing status of a customer changes in SAP so App Connect automatically creates or updates a matching customer record held in Salesforce. As part of the general requirements for SAP OData, you need a well-defined SAP Gateway OData service.

For general information about connecting SAP OData to App Connect, see How to use IBM App Connect with SAP. For more information about the SAP Gateway and OData, see the SAP Help Portal (some links provided at the bottom of this page).

Requirements

As part of the general requirements for connecting SAP OData to App Connect, the SAP Gateway OData service must conform to the following requirements:

  • Define your SAP objects without relationships. The SAP OData connector in App Connect does not support object relationships.

    If your SAP service is defined with object relationships, then App Connect lists your SAP objects for CRUD operations, but ignores the relationship information.

  • Ensure that your SAP Gateway OData service is enabled with sap:creatable:true flag.

    If sap:creatable:false is used, then App Connect ignores the objects identified from your SAP service for CREATE operations; however your objects will be available for RETRIEVE, UPDATE, and DELETE operations.

  • Ensure that the operations are implemented for the service.

    App Connect uses a SERVICE_URL/metadata call to obtain a list of operations to display. But it does not verify if the obtained operations are implemented.

  • Ensure that an object property that you want to use does not have sap:filterable="false".

    If all the fields of an object have sap:filterable=”false” then App Connect won’t support the RETRIEVE operation.

  • Ensure that your SAP objects do not have composite keys. (Composite keys are currently not supported by App Connect.)

    Example of a Customer object with composite key

             <EntityType Name="Customer" sap:content-version="1">
                <Key>
                   <PropertyRef Name="Customerno" />
                   <PropertyRef Name="PiSalesorg" />
                </Key>
                <Property ...

Process

To configure a well-defined SAP Gateway OData service, complete the following steps in your SAP system. These steps cover the general procedure, but need some consideration for your own SAP OData system and your preferred techniques for configuring SAP.

  1. Display the SAP Gateway Service Builder (transaction SEGW)
  2. Create a project
    Select Create Project
    Select Create Project
  3. Chose a project name, give your project a description, select Standard generation strategy, and specify the package. The project will be saved as a local object (Package: $TMP, or click Local Object.)
    Create Project, specify details
    Create Project, specify details
  4. Create the Entity type by importing a pre-defined DDIC Structure for the Order header. Right-click Data Model, and then select Import > DDIC Structure.
    Data Model, Import > DDIC Structure
    Data Model, Import > DDIC Structure
  5. Choose the required structure. If the Sales order structure is not available in your SAP system, select the ABAP structure ZST_VBAK. Click Next.
    Import from DDIC Structure, step 1 of 3
    Import from DDIC Structure, step 1 of 3
  6. Choose the required fields, and then click Next.
    Import from DDIC Structure, step 2 of 3
    Import from DDIC Structure, step 2 of 3
  7. Select the key field, VBELN, and then click Finish.
    Import from DDIC Structure, step 3 of 3
    Import from DDIC Structure, step 3 of 3

    Result: You should now see the new Entity that has been created.

  8. Repeat the same sequence of steps from 4 to 7 to import the next structure, OrderStatus. This may be an Item structure. The following example shows the import of another custom structure called ZST_SO_STATUS.
    1. Second Import from DDIC Structure, step 1 of 3
      Second Import from DDIC Structure, step 1 of 3
    2. Second Import from DDIC Structure, step 2 of 3
      Second Import from DDIC Structure, step 2 of 3
    3. Second Import from DDIC Structure, step 3 of 3
      Second Import from DDIC Structure, step 3 of 3

    Result: When you have completed the preceding steps, you should see the two newly-created Entity Types: OrderStatus and SalesOrder:

    Result of Import from DDIC Structures – The two newly-created Entity Types: OrderStatus and SalesOrder
  9. Create the Entity Sets for the entity types that you have just created.
    1. Right-click the folder Entity Sets, and then select Create.
      Create Entity Sets
    2. Create an Entity Set SalesOrderSet for the entity type SalesOrder. (A naming convention is to make the Entity Set name by appending “_Set” to the Entity Type name. ):
      Create Entity Set SalesOrderSet for the entity type SalesOrder
      Create Entity Set SalesOrderSet for the entity type SalesOrder
    3. Create an Entity Set OrderStatusSet for the entity type OrderStatus:
      Create Entity Set OrderStatusSet for the entity type OrderStatus
      Create Entity Set OrderStatusSet for the entity type OrderStatus

    Result: You should now see the newly-created entity sets:

    The newly-created Entity Sets
    The newly-created Entity Sets
  10. Create the Associations which sets the cardinal rules, and then click Next.
    Create the Associations which sets the cardinal rules
    Create Association, step 1 of 3
  11. Set the Dependent Property, Vbeln, and then click Next.
    Set the Dependent Property, Vbeln
    Create Association, step 2 of 3
  12. Click Finish.
    Click Finish
    Create Association, step 3 of 3
  13. Click Save.
    Save the changes made
    Save the changes made
  14. Check Consistency. Right-click ZORDER_MAINTAIN and then select Check Consistency:
    Check Consistency
  15. Generate runtime objects

    To use the service with the changes that you have made, you need to generate the runtime objects. This creates the underlying ABAP classes that contain all the information that you’ve specified in the service builder.

    Click the Generate Runtime Objects icon or right-click ZORDER_MAINTAIN and then select Generate Runtime:

    Generate Runtime Objects
  16. While generating the runtime objects, the class and service details are generated as shown below.
    Generate Runtime Objects - Model and Service Definition
    Generate Runtime Objects – Model and Service Definition
  17. Choose the package for the objects.
    Generate Runtime Objects - Create Object Directory Entry
    Generate Runtime Objects – Create Object Directory Entry

    Result: Now, you should see that the runtime objects were created successfully:

    Messages confirming that the runtime objects were created
    Messages confirming that the runtime objects were created

    This completes the design stage. Next, you need to develop the code as part of the implementation.

  18. Expand the Runtime Artifacts folder.
    Expand the Runtime Artifacts folder
    Expand the Runtime Artifacts folder
  19. Double-click the Data Provider Class Extension (DPC_EXT)
    Double-click the Data Provider Class Extension (DPC_EXT)
    Double-click the Data Provider Class Extension (DPC_EXT)
  20. Because more than one structure or table is involved, you need to implement the method ‘/IWBEP/IF_MGW_APPL_SRV_RUNTIME~CREATE_DEEP_ENTITY’ for implementing CREATE (POST) functionality for deep insert. However, for single insert, you can use the CREATE_ENTITY method.
    1. To implement the method, click the Change Mode icon:
      Click the Change Mode icon
      Click the Change Mode icon
    2. Select the method:
      • Deep Insert (Nested)
        Select the Deep Insert method
        Select the Deep Insert method
      • Independent Insert Implement separate CREATE ENTITY methods as shown below:
        Select the Independent Insert method
        Select the Independent Insert method
    3. After selecting the method, click the Redefine icon.
      Click the Redefine icon to redefine and edit the method
      Click the Redefine icon to redefine and edit the method
    4. Now the method has been redefined and is available to code the business logic, add the business logic for your requirements.
      Add business logic to the method
      Add business logic to the method

    Result: After completing the logic development, the CREATE functionality is complete.

  21. Register the service

    Use Service Registration: Transaction: /IWFND/MAINT_SERVICE

    1. In the Activate and Maintain Service window, click Add Service
      Activate and Maintain Service window - Add Service
      Activate and Maintain Service window – Add Service
    2. Get the Technical service name from the transaction SEGW. The Runtime artifact which ends with ‘SRV’ in SEGW refers to the Technical Service; for example:
      Example runtime artifact in SEGW that refers to the Technical Service
      Example runtime artifact in SEGW that refers to the Technical Service
    3. In the next screen, specify the System Alias (created by Basis) and the new service which has been created. After that, click the Get Services icon.

      The result is displayed:

      Result: New service has been added
      Result: New service has been added
    4. Click Add Selected Services. This adds the service so that it can be used by App Connect.

Result: A well-defined SAP Gateway OData service has been created so that it can be used by App Connect.

For more information about the SAP Gateway and OData, see the SAP Help Portal; for example:

Join The Discussion

Your email address will not be published. Required fields are marked *