ERPClimb logoERPClimb
ALV Reports
ABAP Developmentadvanced 10 min read

ALV Reports Part 10: Authorization and Sensitive Data in ALV Reports

Preview · a free account unlocks the full lesson

Key takeaway

Secure ALV reports: authorization checks on the selection screen and per row (AUTHORITY-CHECK with organizational levels), hiding or masking sensitive columns, restricting export and layout saving, and protecting drill-down navigation.

In this lessonShow sections

Visual overview

ALV Reports Part 10: Authorization and Sensitive Data in ALV Reports — learning sheetFlow: Run the code example with a user who has access to only one company code → Observe removed rows and the masked bank account column → Trace the checks with STAUTHTRACE. Key ideas: WHERE CHECKS BELONG; AUTHORITY-CHECK; SENSITIVE COLUMNS; EXPORT AND LAYOUTS. Watch out: Hiding a column with no_out is NOT security — users can show it via the layout. Remove or mask the data itself.ERPClimb.com / ABAP / LESSON 10/10 / LEARNING SHEETALV Reports Part 10: Authorization and Sensitive Data inALV Reports1 · HOW IT FLOWS1Run the code example witha user who has access toonly one company code2Observe removed rows andthe masked bank accountcolumn3Trace the checks withSTAUTHTRACE2 · KEY IDEAS EXPLAINEDWhere Checks BelongTransaction start: S_TCODE is checkedautomatically for the transaction; reports run viaSA38 need their own check (authorization group in…Selection screen: check the entered organizationalvalues (e.g. all company codes in s_bukrs) at ATSELECTION-SCREEN.Authority-CheckAUTHORITY-CHECK OBJECT 'F_BKPF_BUK' ID 'BUKRS'FIELD lv_bukrs ID 'ACTVT' FIELD '03'.Sensitive ColumnsIf the user lacks the "sensitivedisplay" authorization: clear or mask thevalues (e.g. IBAN → DE893000) in the output table…Never rely on no_out: the layout dialog can showit again.Export And LayoutsExport to Excel/local file bypasses screen maskingonly if data is in the table — masking in datasolves both.Exclude functions (e.g. &XXL, &PC export)for reports with very sensitive data: it_excluding(REUSE_ALV) or it_toolbar_excluding…3 · REMEMBER · WATCH OUTRememberAn ALV shows everything in its output table — authorization must bechecked before rows go into it.Check at two levels: transaction/report start (S_TCODE / customobject) and per organizational unit (company code, sales org, plant).Hide or mask sensitive columns (salary, bank data, personal data) forusers without a display authorization.!Watch outHiding a column with no_out is NOTsecurity — users can show it via thelayout. Remove or mask the dataitself.4 · IN A REAL PROJECTAn internal audit found that a custom vendor ALV showed bank account numbers to all AP clerks. The developerhad set no_out on the BANKN column, but any user could add it back through "Change layout" andexport it. The fix masked the bank account in the output table unless the user had a new custom authorization…Original ERPClimb learning sheet • Verify against your SAP release and edition

Explanation

An ALV grid shows everything that is in its output table, so authorization has to be checked before rows ever go into that table — this matters because Parts 1 through 9 built functional ALVs, but a report that shows payroll, vendor bank data, or customer personal data must also be safe, and missing checks here are a common audit finding.

Checks belong at two levels. At transaction or report start, S_TCODE is checked automatically for a transaction, but a report run via SA38 needs its own check — either an authorization group set in the report's attributes, or an AUTHORITY-CHECK placed in INITIALIZATION or AT SELECTION-SCREEN.

On the selection screen, the organizational values the user entered (for example, all the company codes in s_bukrs) should be checked at AT SELECTION-SCREEN. And at the row level, after data has been selected, rows the user isn't allowed to see should be removed — check each distinct organizational value once rather than checking every single row.

The AUTHORITY-CHECK statement itself looks like AUTHORITY-CHECK OBJECT 'F_BKPF_BUK' ID 'BUKRS' FIELD lv_bukrs ID 'ACTVT' FIELD '03', where sy-subrc = 0 means the user is allowed. Use standard authorization objects where they already exist, and create custom ones in SU21 for custom data; SU53 and ST01 (the STAUTHTRACE trace) are the tools for analyzing failures.

Free account

Create a free account to keep reading

You have read the opening of this lesson. A free ERPClimb account unlocks the rest of it, every other lesson and topic, and your learning history, so you can pick up exactly where you stopped. No card needed.

  • Full explanation
  • Code example
  • Real project scenario
  • Common mistakes
  • Best practices
  • Interview angle

One tap with Google works too. Every topic keeps its first lesson open to everyone.

Keep exploring

Referenced SAP objects

Reviewed reference pages for the objects this page mentions.

Check before use: lesson examples are educational, not a guarantee of correctness for your SAP edition or release. Sample code has not been executed on your SAP system. Confirm API availability, syntax, authorizations and business impact in an approved development or test environment.