Deploy the metadata extraction ABAP function module for the SAP R3 family of bridges
This article outlines the steps to deploy the ABAP function module in SAP Server.
The SAP Business Suite 4 HANA (S/4HANA), ECC, and R/3 ERP bridge can be used to extract metadata from the SAP Server. This is achieved by placing ABAP function module on the SAP server. This function module is remotely accessible by the bridge to query and download (as a text file) the metadata containing within the SAP server.
When executed, the bridge then either:
Imports metadata from an existing file already downloaded locally from a previous bridge execution.
Invokes the ABAP module API, wait for the download, and then import metadata from that file.
This document details the steps required to deploy this module.
The following instructions were compiled based on the SAP GUI v.7.2
Deployment of the Module
Create a Package
This step is optional, and an existing package can be used.
Log in to the SAP S/4HANA or SAP ECC server and open Object Navigator (SE80 transaction).
Select option Package from the list and enter a name for the new package (for example, Z_MITI) then press button Display.
Select Yes in the Create Package window. Consequently, a window Package Builder: Create Package opens. Enter value into Short Description field and select the Continue icon.
Select Own Requests in the Prompt for local Workbench request window. Select development request.
Create a Function Group
In Object Navigator select Function Group from the list and type its name in the input field below (for example, Z_MITI_FGROUP). Select the View icon.
In Create Object window, select yes to create a new function group.
Specify an appropriate description in the Short text field and press button Save.
Choose a package which was prepared in the previous step Create a Package and select Save.
Confirm a request by pressing icon Continue.
Activate the Function Group.
Create the ABAP Function Module
Once the function group is created, select it.
Select and hold (or right-click) on the function group name in repository browser, and select Create, then Function Module.
In the Function Module field, enter
Z_MITI_DOWNLOAD. Populate Short text input with proper description.
When the module has been created, specify the following information:
Navigate to the Attributes tab.
Select Processing Type as Remote-Enabled Function Module.
Navigate to the Source code tab. There are two ways how to deploy code for the function:
a. From the main menu, upload the text file Z_MITI_DOWNLOAD file. To do so, select Utilities, More Utilities, then Upload/Download, then Upload.
b. Alternatively, open the file, copy its content and paste into Source code area.
Navigate to the Import tab and create the following parameters:
a. P_AREA TYPE DD02L-TABNAME (Optional = True)
b. P_LOCAL_PATH TYPE STRING (Optional = True)
c. P_LANGUAGE TYPE L001TAB-DATA DEFAULT 'E'
d. ROWSKIPS TYPE SO_INT DEFAULT 0
e. ROWCOUNT TYPE SO_INT DEFAULT 0
Choose Pass Value for all of them
Navigate to the "Tables" tab and define the following:
EXPORT_TABLE LIKE TAB512
Navigate to the Exceptions tab and define the following exception:
Save the function (press ctrl+S or choose Function Module, then Save in the main menu).
Select the Activate icon on the toolbar (ctrl+F3) and select Continue button in dialog window. If prompted, you should select the generated includes to be activated along with the main function module.
Testing the Function
When all the previous steps are completed, follow the below steps to test the function:
Open Z_MITI_DOWNLOAD function module.
Choose Function Module, then Test, then Test Function Module from the main menu (or press F8).
Enter a path to the folder on the local file system into parameter P_LOCAL_PATH and press Execute icon on the toolbar (or press F8).
Put the name of the area of interest into P_AREA field if a file with metadata must be downloaded or updated. When the function finishes working, the folder which has been indicated in P_LOCAL_PATH parameter must contain several files with metadata inside. The names of files mimic areas which can be specified in P_AREA field.
The function will finish its execution and metadata will be downloaded much faster in case of launching it on the machine which has high-speed network connection with SAP S/4HANA or ECC server.