SAP Forms
With SAP Job objects you can execute a number of SAP functions directly from within the Automation Engine. For this purpose, Automic delivers Forms, that is, predefined sets of commands that depict those functions. Via the user interface you build scripts for SAP jobs without having to worry about their exact format.
SAP Forms are available for version 12.0 as of December 2016 with the Automic.Web.Interface.SAP.Forms plug-in that you can download from Automic's Download Center (click here: Automic Download Center ).
This topic provides information on the following:
- General information on SAP Forms
- Required authorizations
- Script Editor/SAP Form - synchronized views
- Using script variables
- Parameters with default settings
- Combining SAP commands with non-SAP statements
- Retrieving values
The Automation Engine Script Guide provides detailed descriptions on the syntax of the individual SAP script elements (commands) here: About SAP JCL.
Thanks to the integration with SAP systems, you can execute jobs in SAP directly from within the Automation Engine.
Your Automation Engine system is connected to SAP via the agent, which interprets and transforms the commands sent by the client so that SAP understands them. This means that the only prerequisites your system must meet to be able to create jobs via the Automic Web Interface and execute them in the SAP client are providing the necessary connection and login data, namely:
- The agent binaries are installed and its INI file is configured to connect to the Automation Engine.
- The SAP Agent is defined
- At least one Connection (CONN) object provides the necessary data for connecting the agent to the SAP application server (the user and his/her login data). See Connection Objects.
- A Login (LOGIN) object is defined that provides the necessary credentials for the job to be executed. See Login Object (LOGIN).
Please refer to the Technical Connection chapter for detailed information.
Once these prerequisites are met, you just have to build the scripts to be executed. You do so on the Process page of the SAP Job object definition.
Given the complexity of SAP functions, this can be really cumbersome. This is where the SAP Forms provided by the Automation Engine come into play. They are an additional, intuitive way to build scripts for SAP jobs using a graphical interface that provides ready-to-use commands.
To establish the connection to the SAP system, the SAP agent takes the SAP credentials (user name, password and client) from the Connection object for ABAP Basis. To be able to use the SAP Forms you need the following authorizations:
-
Authorization object: S_RFC
- ACTVT: 16
- RFC_NAME: BDCH, RFC1, RSAB, RSPC_API, SALX, SDIFRUNTIME, SVAR_RFC, SXBP, SXMI, SYST, BACV, SYSU
- RFC_TYPE: FUGR
-
Authorization object: S_XMI_PROD
- EXTCOMPANY: *
- EXTPRODUCT: UC4
- INTERFACE: XAL, XBP, XMB
-
Authorization object: S_TABU_DIS
This is required for the form-switching operating modes, the RSAB for Infopackages and RSPC_API for process chain forms.
- ACTVT: 03
- DICBERCLS: SPFL
Synchronized Views - Script Editor/Form
Two views are available on the Process page of SAP jobs that you can toggle on/off using the buttons at the top of the page:
-
- Script editor view
-
- Form view
Both views are synchronized. Adding an SAP command via the Form view means that the corresponding code line is simultaneously written in the Script Editor; if you then populate the fields in the Form, these values are also written to the Script Editor.
Likewise, entering or editing script elements in the Script Editor results in the corresponding modifications in the SAP Form.
Instead of entering values in the fields of the SAP Forms you can use variable scripts. This also applies to the Script editor view, of course.
The synchronization of the values you specify for checkboxes and radio buttons is a special case. It is not possible to set their values in a script variable when using the script editor. If you do so, when you save the job, they will be overwritten by the values selected for those checkboxes/radio buttons in the Form view.
Example
You create a script that copies a report variant. Using the SAP Form view you simply add the Copy an Existing Variant command to the script designer and enter the values in the command fields:
If you switch to the Script editor view, the script statement looks like this:
Of course, entering or editing script elements in the script editor results in the corresponding modifications in the SAP Form as well.
Default Settings not Displayed in the Script Editor
Many command parameters have a default value. If you keep the default value when building your scripts, the Script Editor does not display these parameters.
For example, in the case of Copy an Existing Variant commands (R3_COPY_VARIANT), such as the one used in the previous example, the default for Protect Variant is No. This means that, by default, this checkbox is unselected. The Script Editor does not display this setting.
However, if you select it, that is, if you set a value other than the default, the Script Editor includes it. It looks like this:
Combining SAP Commands With Non-SAP Statements
When building scripts for SAP jobs you may want to use not only SAP-specific commands but also the Automic scripting language, for example. You can enter these statements in the Script Editor.
If you do so and then switch to the Form view, non-SAP commands are grayed out to help you easily recognize them. For example, we add the following two lines to the statement depicted in the previous screenshot:
Switch now to the Form view. This is how it looks like:
Retrieving Values from the Target SAP System
With an active online connection to an SAP system it is possible to retrieve the values with which to populate the input fields, dropdown lists, etc. Click the button where available. For example:
This opens a dialog that allows you to search for and retrieve data from the SAP client and insert it in your scripts. The contents and layout of the dialog depend on the nature of the data you need. It may display a list where you select a record and click Choose to insert it in the form field like this one:
Or it may contain a pane on the right hand side, where you must filter the data, and a left hand side pane that displays the results of your filter criteria. For example:
- Enter your search criteria on the right pane
- Click the Search button at the bottom of the pane.
- Select the appropriate record in the left pane.
-
Click Choose at the bottom of this dialog.
The selected record is inserted in the form field.
In both cases, information on the connection to the SAP system is displayed at the bottom of the dialog.
To Work with the SAP Form View
To Change the Order of the Commands/Script Elements in the Script
See also: