TP40 is a standard SAP Table which is used to store Assignment of Selection Variant / Role Set data in SAP systems, such as SAP R/3, S/4HANA, depending on the version and release level.
The TP40 table consists of various fields, each holding specific information or linking keys about Assignment of Selection Variant / Role Set data available in SAP. These include SELVAR (Selection Variant for Total Commitment), APPL (Application), RLTYP_SET (Role Set for Application)... See below for full list along with technical details, documentation, text table, check tables, foreign key relationships, conversion routines, relevant tcodes and example ABAP select code etc. .