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: 

Internal table with WDA

Former Member
0 Kudos

How i can create an internal table in a WDA?

I try this but not work.

data: begin of itab occurs,

low type c

high type c

end of itab.

it gives me error and said that occurs not supported!!!!

BR

Ali

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Please refer this.

In ABAP Objects, the following statement causes an error message:

READ TABLE itab WITH KEY = key INTO wa.

Correct syntax:

READ TABLE itab WITH KEY table_line = key INTO wa.

Cause:

This variant is a special solution that lets you access the table with unstructured line types using a key. The introduction of the pseudo-component table_line, which can always be used instead of a key field, renders this variant superfluous.

Hope it will solve your problem

7 REPLIES 7

Former Member
0 Kudos

Hi Ali,

you can create internal table as

Data: lt_data type table of sflight, "sflight is an existing DataBase table

ls_data like line of lt_data. " lt_data is your new internal table.

Greetings

Prashant

0 Kudos

I knwo this way,

I need to build my own internal table, not from dictionary.

BR,

Ali

0 Kudos

create a type like this:

TYPES: BEGIN OF ty_type,

field_a type c,

field_b type n.

TYPES: END OF ty_type.

DATA: itab TYPE TABLE OF ty_type.

Also check F1 help for keyword DATA.

0 Kudos

hi Micky Oestreich

you answer very helpfull.

My code is like this:

TYPES: BEGIN OF ty_type,
nomtk TYPE oijne-nomtk.
TYPES: END OF ty_type.
DATA: int_fnomtk  TYPE TABLE OF ty_type.
data int_fnomtk_wa type ty_type.

LOOP AT ra_nomtk into int_fnomtk_wa.
      READ TABLE int_fnomtk WITH KEY nomtk = int_fnomtk_wa-nomtk.
      IF sy-subrc = 0.
        DELETE ra_nomtk.
      ENDIF.

But i face another problem is that in looping it give me :

In OO context either an INTO or an ASSIGNING specification or the addition
"TRANSPORTING TO FIELDS" must be used.

Former Member
0 Kudos

Please refer this.

In ABAP Objects, the following statement causes an error message:

READ TABLE itab WITH KEY = key INTO wa.

Correct syntax:

READ TABLE itab WITH KEY table_line = key INTO wa.

Cause:

This variant is a special solution that lets you access the table with unstructured line types using a key. The introduction of the pseudo-component table_line, which can always be used instead of a key field, renders this variant superfluous.

Hope it will solve your problem

matt
Active Contributor
0 Kudos

If you take the time to read the ABAP help on these keywords, you could have answered your question yourself.

Former Member
0 Kudos

thanks all.