This document provides instructions on creating the SAP function module ZRFC_DOCEXPLOIT_CODE_EXPORTER, setting up the necessary structure, assigning permissions, and running script to export ABAP program code.
ZRFC_DOCEXPLOIT_CODE_EXPORTERZRFC_DOCEXPLOIT_CODE_EXPORTER and click Create.PROGRAM_NAMETYPE CHAR40SOURCE_CODECHAR255 (see next section).Z_DOCEXPLOIT_TABLE_TYPE.CHAR255FUNCTION ZRFC_DOCEXPLOIT_CODE_EXPORTER.
READ REPORT program_name INTO source_code.
ENDFUNCTION.Ensure the user executing the Python script has the following permissions:
TRDIRREPOSRCS_RFC.ZRFC_DOCEXPLOIT_CODE_EXPORTER is accessible.Contact your SAP Basis team to verify and assign these permissions.
Obtain the precompiled executable file, e.g., export_sap_programs_windows.exe (Windows) or export_sap_programs_linux (Linux).
Netweaver RFC SDK is needed in Linux machines. You can download it from SAP page: SAP NetWeaver Remote Function Call (RFC) Software Development Kit (SDK).
In the case of Windows, is needed to install the Business Client included in the SAPGUI installer.
Run the executable with the following syntax:
Replace the placeholders with your SAP system details:
USER: SAP usernamePASSWORD: SAP passwordHOST: Application server hostnameSYSNR: System numberCLIENT: SAP clientEN: Language (default: EN)Example:
./export_sap_programs_linux -u DEVELOPER -p ABAPtr2022#01 -host localhost -s 00 -c 001 -l EN
You can try it by connecting to official trial image: sapse/abap-cloud-developer-trial – Docker Image | Docker Hub
The program will:
Z* and Y*)../sap_programs directory (relative to where the executable is run).The last step is to run the cli client of DocExploit in a normal way, using sap as the language.
Example: ./docexploit-cli docspot analyze $PROJECTID sap $PATH $APIKEY
ZRFC_DOCEXPLOIT_CODE_EXPORTER.Check the script logs and the SAP system’s logs (e.g., Transaction Code ST22) for more details.










