Skip to Content

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

Error in collect statement(non-key fields must be numeric)...

Error in collect statement(non-key fields must be numeric)...

Hello Experts,

I created an internal table based from a ztable. The structure of the ztable is

as follows:

1. MANDT -> PRIMARY KEY

2. BUKRS -> PRIMARY KEY

3. TXK50 -> PRIMARY KEY

4. ANLKL -> PRIMARY KEY

5. KTANSW -> PRIMARY KEY

6. KOSTL -> PRIMARY KEY

Then the remainder of the fields(around 8 fields) are currency data types(ANBTR).

An error is showing saying 'You can only use the collect command in a table if all of its non-key

fields are numeric(type I,P or F).

I searched the forum and it said that non-keys must be numeric in order for the

collect command to work. But all of my primary keys are non-numeric.

Below is my declaration:

CLASS-DATA: gt_output_acq TYPE hashed TABLE OF zsd_output_acq
                              WITH UNIQUE KEY bukrs txk50 anlkl
                                              ktansw kostl,
                gt_output_ret LIKE gt_output_acq,
                wa_output_gen LIKE LINE OF gt_output_acq,
                gt_output_net TYPE HASHED TABLE OF zsd_output_net
                              WITH UNIQUE KEY bukrs txk50 anlkl
                                              ktansw kostl,
                wa_output_net LIKE LINE OF gt_output_net,
                gt_sort_crit  TYPE SORTED TABLE OF t_sort_crit
                              WITH NON-UNIQUE KEY bukrs kostl,
                wa_sort_crit  LIKE LINE OF gt_sort_crit.

FIELD-SYMBOLS: <fs_output_acq> LIKE LINE OF gt_output_acq,
                   <fs_output_ret> LIKE LINE OF gt_output_ret,
                   <fs_output_net> LIKE LINE OF gt_output_net.

COLLECT <fs_output_acq> INTO gt_output_acq.	"Here is the error

Tags:
Former Member

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question