Usage and Test
This page helps you to use and test BAPI Application by using below mentioned procedure:
Create an Application
To create a BAPI application:
- In the AssistEdge Studio, navigate to the Admin tab and then the Applications sub-tab.
- Add an application of type Web API and specify all its properties.
- Specify the login URL for the SAP Instance.
- Typically, this URL is provided by the SAP-BASIS SMEs from the client’s IT team.
- This URL utilizes SAP’s internal HTTP/s server (SAP Netweaver web app server).
- Access to the HTTP/s server, port and the URL is required.
- The SAP SICF transaction code provides the URL, while the SAP SMICM transaction code provides the port. The default port is 8000. See herehere.
- Choose the Application Type as BAPI.
The new application can be used now in an existing process or a new process.
Use API Activity in a Process
To use API activity in a process, follow below mentioned steps:
- In the AssistEdge Studio, select the Home tab and click Create New to create a new process.
- Open a new process or an existing process.
- Add an API Activity in the process designer.
- Select the new application created above.
- Select BAPI.
- Click on Browse to view all available BAPIs for the SAP instance configured for this application.
- From the API details page, select the BAPI to be invoked.
- Alternatively, log in to the SAP instance (see herehere), and browse to the BAPI using the BAPI explorer window provided by SAP (see herehere).
- Click Confirm.
- Configure Input, Output, and Headers.
- Click on Search Criteria Configuration and create the input arguments.
- Add out arguments to hold the output from the BAPIResponse.
- Click on Arguments next on Variables in the AssistEdge Studio.
- Configure parameters that are required to invoke the API by clicking the settings icon on the API Activity page.
- Under the settings icon, click on Headers to define headers required to invoke the API. For the BAPI activity, Authorization and Content-Type headers are typically required. E.g. Key: Authorization, Value: Basic
- Under the settings icon, click on Input Mapping to configure RequestXSLT for BAPI invocation.
- Select the process argument from the Process Argument XML to be replaced in RequestXSLT.
- In RequestXSLT, all the mandatory fields are marked with $$Y$$. While replacing specify the template to use. AssistEdge currently supports xsl:value of xsl:if, xsl:for-each and xsl:choose templates.
- Place the cursor on RequestXSLT at the location to insert the value.
- Right-click on the selected argument for the Process Argument XML, select which template to use and click on Confirm.
- Under the settings icon, click on Output Mapping to configure the ResponseXSLT to consume the response from BAPI invocation.
- Specify the same tags as in Process Argument XML, that is, <Argument></Argument> with “out-parameters” to be mapped inside the xsl:template tag.
- Select the item from the ResponseXML to be replaced in ResponseXSLT. While replacing, specify the template to use such as, xsl:value of xsl:if, xsl:for-each or xsl:choose.
- Place the cursor on ResponseXSLT at the location to insert the value.
- Right-click on the selected argument for ResponseXML, select which template to use and click on Confirm.
- Test the process.
Click on Setup Environment and enter the credentials, if any. Test the process by clicking on Test Run. Adding a WriteLine activity after the BAPI response is received is useful to view the Response Value in the AssistEdge Studio.