Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

The Field "mandt" in Internal Table is in wrong place in the primary key defination

RachamallaKiran
Participant
0 Kudos

Hi all,

when i am trying to select an internal table getting following error. can you please help how to correct the error.

The table is a sorted table.

Regards,

kiran rachamalla.

3 REPLIES 3

Jeansy
Active Contributor

Can you please share the definition of this internal table?

Sandra_Rossi
Active Contributor

The definition and the rest of relevant code, too.

RachamallaKiran
Participant
0 Kudos

So here is the details for example

line type ( structure )

Table Type
with line type above strcuture with properties

DATA: lref_test  TYPE REF TO data,
      lref_test1 TYPE REF TO data.

FIELD-SYMBOLS:<it_target_sheet_data> TYPE INDEX TABLE.

CREATE DATA  lref_test TYPE zex_table_type.
ASSIGN lref_test->* TO <it_target_sheet_data>.
CREATE DATA lref_test1 TYPE LINE OF zex_table_type.
ASSIGN lref_test1->* TO FIELD-SYMBOL(<lwa_sheet_data>).

DATA(lv_from) = |@<IT_TARGET_SHEET_DATA> AS ABC|.

DATA(lv_where) = |ABC~CELEM = 'PQR' AND ABC~COUNTRY = 'IN'|.

SELECT SINGLE FROM (lv_from)                             "#EC CI_DYNTAB
              FIELDS *
              WHERE (LV_where)                         "#EC CI_DYNWHERE
              INTO CORRESPONDING FIELDS OF @<lwa_sheet_data>.<br>

Here the key component is CDERC without mandt.

Now i cannot add mandt to that keycomponent as it is already deliverd.

even if i somehow added that mandt to table type then it is giving

ERROR: "

The field "CELEM" in "<IT_TARGET_SHEET_DATA>" is in the wrong place in the

primary key definition or it is missing.

"

i cannot give whole key structure in that primary key. so we have any other option ?

Regards,

kiran rachamalla.