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: 

Copy fieldsymbol table to internal table

Former Member
0 Kudos

HI,

      How to copy the Field-symbol table to standard internal table.

Please help me .....

My declaration type is ....

data: it_kna1 TYPE STANDARD TABLE OF kna1.

FIELD-SYMBOLS: <it_kna1> TYPE STANDARD TABLE.

if i use it_kna1 = <it_kna1> , no syntax eror,

But i got a dump .

Please help me to solve the problem......

Thanks and regards,

Vaigundaraja.

Moderator Message: Please do some research before posting.

Message was edited by: Kesavadas Thekkillath

5 REPLIES 5

former_member184569
Active Contributor
0 Kudos

assign it_kna1 to <it_kna1>.

If you access a field symbol without assigning it, it would result in a dump.

Kindly read documentation on field symbols.

0 Kudos

Or you could get the field catalog and make an ASSIGN COMPONENT OF ..   but it's longer

regards

Fred

Former Member
0 Kudos

Hi Raja ,

whenever you use field symbol use assign <intenal table> TO <fieldsymbol>

your code become as follow ...

data: it_kna1 TYPE STANDARD TABLE OF kna1.

FIELD-SYMBOLS: <it_kna1> TYPE STANDARD TABLE.

  assign it_kna1 to  <it_kna1> .

atul_mohanty
Active Contributor
0 Kudos

Hi -

You need to use ASSIGN.

Example -

   TYPES : BEGIN OF  t_itab,
         value TYPE char20,
        END OF t_itab.

DATA : itab TYPE STANDARD TABLE OF t_itab,
       w_itab TYPE t_itab.


w_itab-value = 'KKKK ABC 12'.
APPEND w_itab TO itab.

w_itab-value = 'KKKZ  MNP 657'.
APPEND w_itab TO itab.


w_itab-value = 'KKKZ  XYZ 456'.
APPEND w_itab TO itab.

DATA : lv_itab(6)    TYPE c VALUE 'ITAB[]'.
FIELD-SYMBOLS : <fs_table_xls> TYPE  table,
            

ASSIGN (lv_itab) TO <fs_table_xls>.

raymond_giuseppi
Active Contributor
0 Kudos

Was the field-symbols already assigned, if yes you should not get a dump, except if you play with obsolete header lines requiring usage of [] to distinguish header line from internal table. So I will  suppose it is not the case. But you don't actually want to copy a non defined object (the <FS>) to the table 

Are you trying to assign the field-symbols to the table, then ASSIGN it_kna1 TO <it_kna1>, or can you explain your actual requirement ?

Regards,

Raymond