Maximum Number of Additional Fields in an SAP Infotype
In this note, I suggest trying to break the system—or, to be more precise, to explore its limits. And I’ll do that in search of an answer to the following question: What is the maximum number of additional fields that can be added to a personnel administration infotype?
Objective
To determine the maximum number of fields that can be added to a standard personnel administration infotype.
It’s worth clarifying that I’m not so much interested in the number of fields as in the maximum allowable data length for these fields.
The test subject will be Infotype 0290 – Documents and Certificates (CIS).
See: Data Elements
Calculating the Total Length of All Fields in the Table
First, I want to highlight the number of active fields currently used in the infotype table. A little spoiler: this will help me avoid errors later.
Using transaction SE11
, I will sum the lengths of all table fields shown in the Length column.
The final total is 1884
. I’ll keep this number in mind as it may be useful shortly.
Infotype Enhancement
See: Enhancing an Infotype Included in the SAP Standard System
I enhance the standard infotype by filling the include CI_P0290 with several fields of significant length (type CHAR300
).
Upon trying to activate the changes, I receive the following error:
An attentive reader may already know the solution, based on SAP documentation:
See: Enhancing an Infotype Included in the SAP Standard System
Constraints
The following infotypes are not included in the enhancement concept:
- Actions (infotype 0000)
- Additional Actions (infotype 0302)
- Time Management infotypes (2nnn)
- Leave Entitlement (infotype 0005)
- Maternity Protection/Parental Leave (infotype 0080)
- Military Service (infotype 0081)
- Leave Entitlement Compensation (infotype 0083)
- Time Quota Compensation (infotype 0416)
- Applicant Actions (infotype 4000)
- The length of the data field structure PSnnnn together with the CI include must not exceed 1500 bytes.
- If you include additional fields in the Organizational Assignment infotype (0001), you cannot use them as selection fields
I exceeded the maximum allowable length for table fields.
As a result, the status of table PA0290 along with the filled include changes to Partly active.
Figure 4.
See: Activating ABAP Dictionary Types
Attempting to create a new infotype record results in a runtime dump.
Solution
I admit that the total length of data elements I attempted to add is likely excessive and not realistic for any personnel administration infotype. We can consider this situation as more absurd than practical. But there’s a nuance... which I won’t delve into here. Instead, I’ll just mention that there are two ways to solve the problem, both described in the following SAP Notes:
- 2458652 - Error AD846 "Table <name> is too long (>4030)" or "Table <name> is too long (>4096)"
- 636217 - ABAP Dictionary activation error due to table width >4030 bytes
- 1512035 - AD 846 error for activation of data element
The second solution involves a simple arithmetic operation: calculating the allowable total field length in the table, including the existing fields ( See: Section #1. Calculating the Total Length of All Fields in the Table).
So, if I remove a few extra fields to fit within SAP’s 4030-byte limit, the issue will be resolved.
P.S.
When extending standard infotypes, you may need to use transaction SE14.
A lot of useful info is written here: The Database Utility.
Update
To avoid manually calculating the length of all table fields (See: Section: Calculating the Total Length of All Fields in the Table), you can use a built-in function. In transaction SE11
, navigate to Extras → Table Length
The system will perform all necessary calculations automatically.
Many thanks to reader Roman for this tip.