Do all fields used have a name? (use help)
Message type: E = Error
Message class: AQ - Message texts for SAP Query
Message number: 154
Message text: Do all fields used have a name? (use help)
What causes this issue?
<ZH>This is only a warning. A generated version of the InfoSet is
always made available.</>
When generating query reports for queries using this InfoSet, access to
database tables and additional tables has been optimized so that only
the really necessary fields are retrieved (GET or SELECT with field
list). This represents a considerable improvement in performance over
the method where all fields of a table line are retrieved (GET without
field list or SELECT *).
It is possible that this particular InfoSet does not contain all the
information required to determine the necessary fields. In this case,
the retrieved fields may be set to their initial value when the query
report is processed.
<ZH>Therefore, check whether one of the cases described below applies
and correct your InfoSet accordingly.</>
To facilitate optimized access to database tables and additional
tables, the fields needed to generate query report are determined when
an InfoSet is generated. These fields may be any of the following:
The system issues an error message and will not allow you to continue with this transaction until the error is resolved.
Fields included in field groupsFields used to formulate the WHERE condition with linked tables
Fields addressed in the coding of additional fields
Fields addressed in the events GET / GET LATE or at the point of record
processing
This particular InfoSet contains ABAP/4 code for defining additional
fields or for the events GET / GET LATE or when a record is processed.
Within such code, ABAP/4 allows you to access fields without listing
them explicitly (i.e. by using field symbols, external PERFORMS, DO ...
VARYING, ADD ... THEN ... UNTIL, etc.).
However, to guarantee error-free generation of query reports, each
piece of code (additional field, GET / GET LATE / record processing)
must be able to determine which fields are being accessed. For this, it
is necessary that each field used in this piece of code is also named.
System Response
How to fix this error?
If one of the pieces of code contains ABAP/4 statements which access
fields implicitly, use the ABAP/4 statement FIELDS to ensure that all
the used database fields, table fields and additional fields are also
explicitly named.
Example:
Suppose the table KNC1 contains the fields UM01U, UM02U und UM03U with
the sales for the first three months of a year. An additional field Q1,
which is to hold the sales for the first quarter, calculates the total
from these three fields using an external PERFORM.
PERFORM QUARTAL1(pppppppp) USING Q1.
Access to the fields KNC1-UM01U, KNC1-UM02U and KNC1-UM03U is via the
shared memory area for the table KNC1 in the query report and in the
called program pppppppp. You cannot determine from the above code that
the specified fields are required. Therefore, you must change this
piece of code as follows:
PERFORM QUARTAL1(pppppppp) USING Q1.
FIELDS: KNC1-UM01U, KNC1-UM02U, KNC1-UM03U.
Note that this must be done for each piece of code because a query
report only uses code if necessary and you must thus determine for each
piece of code which fields are actually needed.
Note also that you only have to specify the fields which are required
immediately.
Example
The additional fields F1 and F2 are defined with the following code:
F1: F1 = tab-field " tab-field is a database field
F2: F2 = F1 + 2.
Although F2 accesses tab-field indirectly, it is unnecessary to list
tab-field as a used field in the code for F2. This is because the
processing of these indirect references is performed automatically when
the InfoSet is generated. The code for both additional fields is
correct in this form.
In exceptional cases, you can use the statement
FIELDS tab.
Here, tab is a database table or an additional table. This causes all
fields in the table tab to be retrieved in the query report. Note that
in this case, you switch off the optimized access to the table tab and
there is a considerable loss in performance when queries are processed.
Error message extract from SAP system. Copyright SAP SE.