SAPStub
SAPStub component implements functions that are called up by an ABAP Backend. The JCo server program is registered in the component via the SAP Gateway and waits for inbound RFC calls. It is possible to manually configure the input/Export/Table parameters, or automatically import the INPUT, EXPORT, TABLE parameters from any BAPI / RFC from a SAP instance.
Configuration
The component can be configured using the custom property sheet as shown in the following sections.
Server Configuration Panel
Figure 1: Server Configuration Panel
- Host Name: Enter the SAP gateway host name
- Program Id: Enter the program Id in SAP RFC Destination . Program ID is configured under sm59 transaction of SAP.
- Unicode: Provide Server properties like Unicode (check if Unicode).
- Use same targetNamespace for Input and Output: Select this to set same target namespace for both input and output schemas. Otherwise /IN(Input Schema), /OUT(Output Schema) will be appended to targetNamespace provided
Provide any additional Server properties under "Server Additional Properties".
Structure Configuration Panel
Figure 2: Structure Configuration Panel
Function Name: Enter the RFC name which would be called from ABAP program using the method as call function <function name> destination <destinationName> ..import .. export .. table.......
Enter the user credentials. Enter BAPI / RFC name which will be called in design time. The INPUT /OUPUT / TABLE parameters of this BAPI/RFC entered are used to automatically define the parameters for the RFC defined in Fiorano SAP STUB component.
Defining Parameters Manually
Figure 3: Defining parameters manually
Enable Manually Define structure to define the parameters manually.
- Structure: To create the definition of a structure . Once a structure is created, the same can be used to define the IMPORT , EXPORT , TABLE parameter.
- Import: Create a field and import structure
- Export: Similar to Import
- Table: Table parameters can be created and define the structure by selecting the already defined structure from the drop down.
The data type definition can be given while adding a field to a structure or Import / Export. After setting the structure automatically, the details can be edited.
Once the component is configured, the parameters specified while configuring the component would be automatically populated on IN /Out port of the component
Functional Demonstration
Figure 4: Scenario demonstration
Figure 4 demonstrates how SAPStub can be configured to receive request and send response back from a sample ABAP report. The request can be routed to any other application ( for example CRM ) and response can be defined from target application.
Enter Transaction code 'se38' to get to ABAP Editor page. ZFIORANO_STUB program is called via which RFC GET_SYSTEM_INFO function is called on destination provided, for example, "STUB".
Figure 5: ZFIORANO_STUB Function
Sample function which asks for destination on which it is to be called
Figure 6: Triggering SAPStub component
On RFC destination "STUB", program id specified is "stubcall" (as specified in CPS).
Figure 7: Output
Execute ZFIORANO_STUB report from SAP , with RFC Destination parameter set , request is sent to SAPStub component. In flow provided in Figure 4, using transformation, request is processed and output can be observed in figure 8.
RFC Destination needs to be configured in SAP. Enter transaction code sm59. Go to TCP/IP Connections and create necessary RFC Destination, for example "STUB". Also provide program ID which should be given in Server Configuration panel.