The Automate Function Module (AFM) is an ABAP component installed on your SAP system. It allows you to more successfully work with Studio Transaction and Query modules.
For information about roles and administration, see Automate Function Module for Studio.
AFM and Transaction
Transaction automates many SAP data-entry processes to increase productivity, protect data quality, and maximize return on SAP investment.
WFM is designed to integrate in sync with SAP’s changing landscape in terms of integration and provides a platform to manage and control transaction processes better. The Function Module also provides additional features like look up and date formats. The Function Module may be required if you are using Transaction with ECC 6 EHP 5 or higher.
AFM and Query
Automate Query is an SAP data extraction and analysis tool that allows users to shuttle live data from the SAP transactional system into Microsoft Excel, Access, and other common formats for immediate analysis and action.
The AFM allows Query users to securely extract information while minimizing the performance impact on the SAP system. The AFM governs Query interaction with the SAP system, controlling security and performance issues that are related to data extraction.
Does AFM affect my SAP system?
The Automate Function Module resides in a WINSHUTTLE namespace that is registered with SAP. As result, the AFM does not affect any SAP standard code on the SAP server. The AFM is built using the AAK 4 tool provided by SAP.
The Automate Function Module:
|
Automate Function Module – Integration with Transaction
Required for EHP5 or higher releases
After applying SAP BASIS 7.00 Support Package 24/Ehp5 (and related packages in other SAP BASIS versions), your non-batch input recordings cease to work. Particular SAP note also causing the symptoms: SAP Note 1523808.
The function module may be required in this scenario. It replicates the capabilities of the legacy SAP function module components that were changed by SAP. This approach does not detract from the customer’s system integrity nor does it represent any added vulnerability to a given SAP system beyond the state prior to the application of the SAP support package.
Features and benefits
While the Function module has been primarily designed to go hand-in-hand with the changing requirements for third party tools to work with SAP and also provide administrative capabilities within the function module, there are a lot of additional features to help alleviate some of our end users’ or script authors’ pain points.
Smarter recording mode
If you are an existing Transaction user, you should be familiar with the current recording choices – Batch, Non-Batch with Controls and Non-Batch without Controls. Automate Function Module simplifies the recording process by not requiring you to make this selection. Instead, the most suitable recording mode is automatically selected. Batch and GUI scripting modes are still available as manual selections for scenarios that do not work with the pre-selected recording mode with WFM.
Support for F4 or SAP possible values in Automate Forms
You can add an SAP lookup control to a field for which you want to read a list of possible SAP values. If the form field is designed to include this, the end user would be able to get a list of possible values with their descriptions from SAP. It not only becomes easier for the user to enter data, but it also reduces the chances of form rejections or SAP errors. This feature is available only if you have installed the function module on the SAP system you are requesting values from.
Date formats for forms
If a date field is included in a script, a date picker control would automatically appear in the form created using Automate Web service. Automate Server would automatically convert this date to the user’s SAP date format to avoid any issues while posting data into SAP. This means that you no longer have to worry about entering your dates in the SAP accepted format. However, please make sure that function module is installed on the required SAP system or you will end up getting date format errors.
The Automate Function Module provides faster data validation
Studio allows users to validate data against their SAP systems before actually posting it. Errors are returned against individual line items, so users can identify errors in a timely fashion. This makes the validation with SAP process in WFM v11 faster than in previous versions.
Whole document simulation
Simulation is similar to the Simulate button in SAP. This method checks the validity of the whole document or transaction to the point of Commit and ensures that the data meets the script requirements. It simulates posting without actually posting the data, and all messages are returned from SAP just as they would when submitting the whole document.
Enhanced options for document attachment
The AFM supports 3 different document attachment options:
- Business Document Service: This replicates the attachment creation process.
- Generic Object Services: This is the same as ‘store business document’.
- Document Management System: This method is available when the SAP system is configured to create attachments using a content management server like IXOS or Open Text.
AFM leverages the configured document attachment option on the SAP server that is available via SAPGUI. The default attachment option for the AFM can be set up on the Admin page.
Ability to add, retrieve, or update long text without recording long text fields
This feature is in addition to the normal/legacy way of recording long text and then updating. Adding long text in Studio (versions 12 and after) is easy – users can just select the long texts they need. They do not need to use long text while recording, and don’t need to depend on any editors. With Studio versions 12 and after), users can also download long texts by changing the mapping direction to download. By using download capabilities, users can update long texts by retrieving the existing text. Then they can easily make the changes they want and upload the revised long texts. Long texts in line items can be included in loops.
Using Automate Direct to simplify execution of special handling for customer master/vendor master transactions
Certain cases for customer and vendor master cannot be recorded or are difficult to record, map, and run in Transaction. WFM v11 provides a better handling of the CRUD operations from a business user perspective.
Control and administration
The basic premise of the function module is to provide better administrative and controlling capabilities on how transaction processes are executed using Automate. While some initial components are available in the latest version of the function module, Automate is making constant investments in this area.
Troubleshooting – Tracing in Function Module
To provide faster resolution to SAP recording/run issues, tracing functionality is available within the Function Module. It records all the function calls during interaction with SAP. It is useful for scenarios where your Transaction code might work within SAP GUI, but not with Automate.
Automate Function Module – Integration with Query
Security in the AFM
Data security in Query is built around the existing SAP security authorization policies/objects. In addition to standard SAP authorization requiring Table Display authorization (S_TABU_DIS), the WFM provides a custom security table for organization-level authorization, e.g., company code, plant, sales organization, etc. In this table, the SAP administrator can specify additional authorization checks on the data. The Automate custom security table consists of the following fields:
- Table name = SAP Table name to be secured
- Authorization Fieldname = Field in the SAP table to be used for authorization check
- Authorization object = Assigned authorization object to be checked
For example, if the table name MARC is to be secured by the user’s Plant (WERKS)-level authorization (contained in the standard SAP authorization object M_MATE_WRK), the entry in this custom table would be: Table Name = MARC, Fieldname = WERKS, Authorization Object = M_MATE_WRK.
Most commonly used security and authorization objects are delivered as a standard part of this custom table, however, this security table can be modified to add, remove, or change entries by an SAP Administrator through the SAP transaction code SM30.
The security in WFM works as follows: during query creation and query execution, the WFM first uses the standard SAP security authorization to determine access level. Next, the WFM checks the Automate security table which provides another security layer. The results of these authorization checks are used to check the data retrieved from SAP. Using the results of these authorizations checks, the WFM checks each SAP record and filters unauthorized data elements from the final output. The WFM ensures that Query users only query and extract authorized data.
Performance control in WFM
Automate’s patented Adaptive Query Throttling (AQT) technology dynamically throttles the query execution time based on the system load at any time during query execution. This ensures that Query queries do not clog the SAP server performance. This dynamic throttling is enabled as follows:
First, a loop join approach is used for multi-table queries. JOINS are not directly passed for execution but broken into single table SELECT statements. The results of these single table joins are eventually combined to create the query results.
Before every single-table SELECT execution, the percentage of free server capacity is calculated. In the case of heavily loaded servers, proportionate delays are introduced in SELECT statement execution so as to avoid server clogging. For servers with free dialog processes, no delay is given. However, as the traffic increases and the server capacity decrease (as measured by the number of free dialogue process available) the AQT algorithm dynamically throttles the request.
AQT and memory usage control
At 50% of memory usage, internal compression logic kicks in for data extraction. It does not have any effect on the result set but increases the data processing capacity of the function module 10-fold. When memory utilization reaches 80%, the built-in control of the Function Module kills the query so that the overloaded Server memory does not hang up the SAP Server. At 50% dialog process utilization, the dialog processes are made available for a few moments to allow for other queries to run. These checks ensure that an inefficient query does not block the Server.
Chunking
AQT works in conjunction with chunking. Chunking allows Query to process each query in smaller, predefined chunks rather than processing the entire query as a single request.
Additional features and benefits
This table lists the benefits for which the Automate Function Module should be considered for Query.
Feature |
WFM |
Non-WFM |
---|---|---|
Single, multiple, and alias tables |
Yes |
Yes |
InfoSets |
Yes | Yes |
Additional security* |
Yes | Yes |
Logical databases |
Yes | No |
Adaptive Query Throttling |
Yes | No |
Run as SAP background process |
Yes | No |
Abort query during run |
Yes |
Yes |
Data chunking |
Yes |
No |
Find tables from a t-code recording |
Yes |
No |
Query timeout |
Yes |
No |
Pre-SAP R/3 4.7 support |
No |
Yes |
Joins on mismatched fields |
Yes |
Yes |
*Security is local to the client machine configuration. With the WFM, security can be enhanced centrally in Evolve.
- Automate also provides a User Administration Control page to handle all its parameters from one location.
- The Automate Function Module has pre-shipped authorization roles that can be used as templates for SAP access assignments.