Overview

A Native API is specific to a system and represents a published API that can be consumed by ClearProcess. Since the system itself has connection parameters and adapters already specified, the only properties that need to be specified here are System and the Name of the API. Native APIs are configurable by administrators within your organization.

Configuring Native APIs in Clear

Native APIs
FieldDescription
APIThe name of the API within the system. You can also assign custom remote-enabled SAP function modules here.
SystemThe system within the current subdomain that will execute the API.

SAP Integration

There are many ways to find APIs and integrate with SAP. The primary methods used by Clear are outlined below.

BAPI Integration – Finding APIs in Transaction BAPI

If you want to view a full list of APIs released by SAP, use this method.

Step 1

In the transaction launcher, type BAPI and hit Enter.

BAPI 1

Step 2

Click on the Alphabetical tab, find your desired API, and click on it.

BAPI 2

Step 3

Double-click on the Function Module field.

BAPI 3

Step 4

The API definition will display. From here you can begin configuring a Clear API.

BAPI 4

BAPI Integration – Finding APIs in Database Table TFDIR

If you want to view a full list of all APIs in an SAP system, both released and unreleased, use this method. SAP will not support the use of unreleased APIs, but Clear Software will support such an integration. It may take several iterations of the process below before you find the API that meets your needs.

Step 1

In the transaction launcher, type SE16N and hit Enter.

TFDIR 1

Step 2

Type TFDIR in the Table field and hit Enter.

TFDIR 2

Step 3

Type R in the FMODE field, then type your search string in the FUNCNAME field with asterisks on both sides of the string. Press F8 to see a list of results.

TFDIR 3

Step 4

Copy the name of the API you wish to analyze.

TFDIR 4

Step 5

In the transaction launcher, type /NSE37 and hit Enter.

TFDIR 5

Step 6

Paste the API name in the Function Module field and then click the Display button.

TFDIR 6

BAPI Integration – Finding APIs from an Individual Field

If you know one of the key fields you need in your SAP integration, you can use this method to find APIs that use that key field.

Step 1

In the transaction launcher, type SE11 and hit Enter.

DB 1

Step 2

Type the name of your desired in the Table field and hit F7.

DB 2

Step 3

Double-click on your desired field’s data element.

DB 3

Step 4

Click on the Where Used button.

DB 4

Step 5

Select the Function Module Interfaces checkbox and then the green check mark.

DB 5

Step 6

Scroll until you find a function module that looks promising. Double-click on your desired function module.

DB 6

Step 7

Double-click on any of the fields that display.

DB 7

Step 8

Click on the Attributes tab.

DB 8

Step 9

Confirm that the Remote-Enable Module radio button is checked. If not, this function module is not an API and you need to search for another one.

DB 9

iDoc Integration

In some cases, SAP will not have a published API for a given integration. You can instead use a synchronous iDoc integration. iDocs are typically meant to be used in batch, but they are in fact a very stable and reliable way to integrate with SAP real-time. For a great example, see our default Clear API for CreateGLAccount.

Step 1

In the transaction launcher, type WE60 and hit Enter.

IDOC 1

Step 2

Click in the Basic Type field and press F4 and search for your desired iDoc. Once you have selected it, press F8 to display its definition.

IDOC 2

Step 3

The definition will show parent-child relationships of the various component of your integration. Pick one of the segments and copy it.

IDOC 3

Step 4

In the transaction launcher, type /NSE11 and hit Enter.

IDOC 4

Step 5

Paste the segment in the Database Table field and press F7 to display.

IDOC 5

Step 6

Here you will find the field names for this segment. From here you can begin configuring a Clear API.

IDOC 6

BDC Integration

If you have exhausted all of your options and cannot integrate with SAP via a BAPI or iDoc, there is an option to record a batch input session (transaction SHDB) and invoke the session from Clear. This should always be a last resort and will only be supported after receiving written approval from Clear. For a great example, see our default Clear API for PayCustomerItems.

Basic Debugging

To debug the integration between ClearWork, ClearProcess, and SAP, follow these steps.

Step 1

In the SAP transaction launcher, type SE37 and hit Enter.

DEBUG 1

Step 2

Enter the name of the SAP API you would like to debug and click Display.

DEBUG 2

Step 3

Click on the Source Code tab and scroll all the way to the bottom. Place your cursor on the END FUNCTION line.

DEBUG 3

Step 4

From the menu bar at the top of the screen, click on the external breakpoint button.

DEBUG 4

Step 5

The END FUNCTION line should now be highlighted in orange.

DEBUG 5

Step 6

In ClearWork, go to the page that calls the API you wish to debug, then open your browser’s developer tools.

DEBUG 6

Step 7

Click on the Network tab in the developer tools window.

DEBUG 7

Step 8

From your page, trigger the action that will call the SAP API.

DEBUG 8

Step 9

The SAP debugger will display at the breakpoint you set.

DEBUG 9

Step 10

Scroll to the top of the code and double-click on the API parameters being used by ClearProcess.

DEBUG 10

Step 11

The variables tab will display. Double-click on the variable to see the data passed in from ClearProcess.

DEBUG 11

Step 12

The data passed from ClearProcess will display. Press F8 to exit the debugger and delete the breakpoint.

DEBUG 12

Step 13

From your page, again trigger the action that will call the SAP API.

DEBUG 13

Step 14

Back in your browser’s developer tools, click on the last rpc/ entry and click on Headers. Drill into the Request Payload to see the data that was passed from ClearWork to ClearProcess.

DEBUG 14

Step 15

Click on the Preview tab. Drill into the response to see the data passed back from ClearProcess to ClearWork.

DEBUG 15