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: 

Inner table pointer

former_member397166
Participant
0 Kudos

Hi all

     I define a structure(not build in database) in program and create a inner table with this structure.

     now, i want to assign a pointer to the inner table and a pointer to a work area.How?

     for example

     data: begin of ty_test1 occur,

               fname type char10,

               fid type char10,

               .....

               end of ty_test1.

     data: begin of ty_test2,

               fname2 type char10,

               fid2 type char10,

               .....

               end of ty_test2.

I need to define a pointer <fs_table> and assign to the inner table(ty_test1 or ty_test2) according customer select.And process data....

Thanks

Kical

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Kical,

Please check the code below:

DATA: BEGIN OF ty_test1 OCCURS 0,

           fname TYPE char10,

           fid TYPE char10,

           END OF ty_test1.

DATA: BEGIN OF ty_test2,

           fname2 TYPE char10,

           fid2 TYPE char10,

           END OF ty_test2.

FIELD-SYMBOLS:<fs1> TYPE ANY TABLE,

               <fs2> LIKE ty_test2.

ASSIGN:ty_test1[] TO <fs1>,

        ty_test2 TO <fs2>.


Sam

4 REPLIES 4

former_member183607
Contributor
0 Kudos

Hi,

     Field-symbols: <fs_table> type table of (ur structure name).

Regards:

0 Kudos

Hi Somendra,

I'm afraid this is a wrong statement to define a field-symbol for table.

You can type a table type or a generic type but not this statement.

Thanks,

Sam

Former Member
0 Kudos

Hi Kical,

Please check the code below:

DATA: BEGIN OF ty_test1 OCCURS 0,

           fname TYPE char10,

           fid TYPE char10,

           END OF ty_test1.

DATA: BEGIN OF ty_test2,

           fname2 TYPE char10,

           fid2 TYPE char10,

           END OF ty_test2.

FIELD-SYMBOLS:<fs1> TYPE ANY TABLE,

               <fs2> LIKE ty_test2.

ASSIGN:ty_test1[] TO <fs1>,

        ty_test2 TO <fs2>.


Sam

0 Kudos

Hi all

     Thank you!

Kical