Microservices

SAPStub

The 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, and 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

worddave2c54e8f2b3265c44e9122f383ea4d53.png
Figure 1: Server Configuration Panel
  • Host Name: Enter the SAP gateway hostname

  • Program Id: Enter the program ID in SAP RFC Destination. The program ID is configured under the sm59 transaction of SAP.

  • Unicode: Provide Server properties like Unicode (check if Unicode).

  • Use same targetNamespace for Input and Output: Select this to set the 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

worddavcc73f449b2eea76fbfffc76d571e0ec9.png
Figure 2: Structure Configuration Panel

Function Name: Enter the RFC name which would be called from the ABAP program using the method as call function <function name> destination <destinationName> ..import .. export .. table.......

Enter the user credentials. Enter the BAPI / RFC name which will be called in design time. The INPUT /OUTPUT / TABLE parameters of this BAPI/RFC entered are used to automatically define the parameters for the RFC defined in the Fiorano SAP STUB component.

Defining Parameters Manually
worddavf3c66474d76e583defc148bc964308ef.png
Figure 3.1: Defining parameters manually
worddav2f35869721377d4969302dc0dac31827.png
Figure 3.2: Defining parameters manually

Enable Manually Define a 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, and TABLE parameters.

  • Import: Create a field and import structure

  • Export: Similar to Import

  • Table: Table parameters can be created and defined 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 will be automatically populated on the INPUT/OUTPUT port of the component

Functional Demonstration

worddav2c822cd6ae8c6d4e63f6e472e1b25c95.png
Figure 4: Scenario demonstration

The figure above demonstrates how SAPStub can be configured to receive requests and send responses back from a sample ABAP report. The request can be routed to any other application ( for example CRM ) and the response can be defined from the target application.

Enter Transaction code 'se38' to get to the ABAP Editor page. ZFIORANO_STUB program is called via which the RFC GET_SYSTEM_INFO function is called on the destination provided, for example, "STUB".

worddav94a9c4970c7eb6eaf5f629a063b9e0d6.png
Figure 5: ZFIORANO_STUB Function

Sample function which asks for a destination on which it is to be called

worddav6e15837cadc152b0dd2c34a0423109de.png
Figure 6: Triggering SAPStub component

On RFC destination "STUB", the program ID specified is "stubcall" (as specified in CPS).

worddavebe3371234b75fd50d922a5f92be444f.png
Figure 7: Output

Execute ZFIORANO_STUB report from SAP, with RFC Destination parameter set, request is sent to SAPStub component. In the flow provided in the Functional Demonstration section, using transformation, the request is processed and the output can be observed in the figure above.

RFC Destination needs to be configured in SAP. Enter transaction code sm59. Go to TCP/IP Connections and create the necessary RFC Destination, for example, "STUB". Also, provide program ID which should be given in the Server Configuration panel.