ABAP CVA Checks: Write on sensitive database tables
A regular ATC check showed me an ABAP CVA (Code Vulnerability Analysis) finding Write on sensitive database tables where the mentioned sensitive SAP database table is USR05 User Master Parameter table. In the ABAP code I was modifying the SAP table record using OpenSQL UPDATE command or adding a new row into the USR05 table using OpenSQL INSERT command.
Here is the details of the ATC (ABAP Test Cockpit) finding complaining about USR05 table (User Master Parameter ID) update or writing a new record to this sensitive database table.
Security Checks for ABAP (CVA)
Write on sensitive database tables
Write access (INSERT) to database table USR05
The ABAP code block where I update existing data or insert a new user parameter to the SAP database table USR05 is as follows:
It is better to modify such sensitive database tables using an approptiate function module or ABAP class instead of directly executing OpenSQL Update or Insert commands in ABAP codes.
I found the solution for using an ABAP function module for updating user parameters SAP table USR05 at tutorial Set User Parameter in SAP using ABAP Function Module
Above code is showing how I converted previous CVA problematic ABAP code block into a better version at least according to the ABAP CVA (Code Vulnerability Analysis) checking tool.