Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

syntax problem, implicit header line

I keep getting this errors like this one in Extended Check:

LIT_ERRORS stands for 2 fields: Table LIT_ERRORS[] and its header line

Field string LIT_ERRORS is not referenced statically in the program

and the tables have heading line, although i dont want them to have it.

code is:

TYPES:
    ty_c(1),
    ty_idoc        TYPE yidocproc_idocinfo,                 "shorter name
    ty_recipient   TYPE yidocproc_rcpnts,
    tty_idocs      TYPE STANDARD TABLE OF ty_idoc WITH KEY docnum credat,          "idocs container
    tty_status     TYPE STANDARD TABLE OF teds1-status,
    tty_recvs      TYPE STANDARD TABLE OF soos1,            "email recipients

(...)

FORM process_idocs
                TABLES
                   lit_idocs  TYPE tty_idocs
                   lit_errors TYPE tty_errors.
  DATA:
        lit_bommats TYPE tty_idocs,
        lit_other   TYPE tty_idocs,
        wa_date     TYPE sy-datum.

  FIELD-SYMBOLS:
        <fs_idoc> TYPE ty_idoc.

  " loop thru idocs, process them day by day
LOOP AT lit_idocs[] ASSIGNING <fs_idoc>.

    " filter out bommats to be processed
    IF <fs_idoc>-mestyp EQ 'BOMMAT'
      AND ( <fs_idoc>-status EQ '64' OR <fs_idoc>-status EQ '51' ) .  "check for not processed ?
      INSERT <fs_idoc> INTO TABLE lit_bommats.
    ELSE.
      INSERT <fs_idoc> INTO TABLE lit_other.
    ENDIF.

    AT END OF credat.
      " check idocs not to be processed for a given day
      PERFORM check_idocs
                TABLES
                  lit_other[]
                  lit_errors[].

      IF NOT lit_bommats[] IS INITIAL AND lit_errors[] IS INITIAL.
        " process bommats for a given day
        PERFORM process_bommats
                  TABLES
                     lit_bommats[]
                     lit_errors[].
      ENDIF.

      REFRESH: lit_bommats[],
               lit_other[].

    ENDAT.

  ENDLOOP.

the END AT credat doesnt work properly, processed idoc one by one. And i have to constantly remember to use [] when using table body.

I've been stuck on this one for 3h or more, any idea?

Tags:
replied

Is your table sorted, and is the "credat" field at the beginning of the structure, else the AT END will trigger each time any of the previous fields is changing....

Loop at AT END online documentation from Abap editor

AT END OF f.

In an ABAP Objects context, a more severe syntax check is performed that in other ABAP areas. See Compatible Work Area with Control Level Processing and Field Symbols Not Allowed as Control Level Criterion.

Effect

f is a sub-field of an internal table processed with LOOP. The sequence of statements which follow it is executed if the sub-field f or a sub-field in the current LOOP line defined (on the left) before f has a different value than in the preceding (AT NEW) or subsequent (AT END OF) table line.

So change to a structure

beginning with "credat" field.

Regards

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question