SAP Message AQ154 - Do all fields used have a name? (use help)

Diagnosis
This is only a warning. A generated version of the InfoSet isalways made available.
When generating query reports for queries using this InfoSet, access todatabase tables and additional tables has been optimized so that onlythe really necessary fields are retrieved (GET or SELECT with fieldlist). This represents a considerable improvement in performance overthe method where all fields of a table line are retrieved (GET withoutfield list or SELECT *).
It is possible that this particular InfoSet does not contain all theinformation required to determine the necessary fields. In this case,the retrieved fields may be set to their initial value when the queryreport is processed.
Therefore, check whether one of the cases described below appliesand correct your InfoSet accordingly.
To facilitate optimized access to database tables and additionaltables, the fields needed to generate query report are determined whenan InfoSet is generated. These fields may be any of the following:

  • Fields included in field groups

  • Fields 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 additionalfields or for the events GET / GET LATE or when a record is processed.Within such code, ABAP/4 allows you to access fields without listingthem explicitly (i.e. by using field symbols, external PERFORMS, DO ...VARYING, ADD ... THEN ... UNTIL, etc.).
    However, to guarantee error-free generation of query reports, eachpiece of code (additional field, GET / GET LATE / record processing)must be able to determine which fields are being accessed. For this, itis necessary that each field used in this piece of code is also named.

    Procedure
    If one of the pieces of code contains ABAP/4 statements which accessfields implicitly, use the ABAP/4 statement FIELDS to ensure that allthe used database fields, table fields and additional fields are alsoexplicitly named.
    Example:
    Suppose the table KNC1 contains the fields UM01U, UM02U und UM03U withthe 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 totalfrom 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 theshared memory area for the table KNC1 in the query report and in thecalled program pppppppp. You cannot determine from the above code thatthe specified fields are required. Therefore, you must change thispiece 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 queryreport only uses code if necessary and you must thus determine for eachpiece of code which fields are actually needed.
    Note also that you only have to specify the fields which are requiredimmediately.
    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 listtab-field as a used field in the code for F2. This is because theprocessing of these indirect references is performed automatically whenthe InfoSet is generated. The code for both additional fields iscorrect 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 allfields in the table tab to be retrieved in the query report. Note thatin this case, you switch off the optimized access to the table tab andthere is a considerable loss in performance when queries are processed.