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: 

Getting values back from dynamic internal table

Former Member
0 Kudos

I'm moving values from itab declared like DATA. Then moving the values to another field-symnobl data. Now after doing some change to the second table, I want to move the values to the first table. Anybody has any idea how to do it?

DATA: itab TYPE REF TO data.

GET REFERENCE OF me->query_result INTO itab.

itab = me->query_result.

FIELD-SYMBOLS: <itab1> TYPE table.

ASSIGN itab->* TO <itab1>.

Here after making change to <itab1>, I want to swap the value to itab.

Any ideas?

Thanks,

RM

1 ACCEPTED SOLUTION

former_member194623
Participant
0 Kudos

I think you are pretty confused regarding use of TYPE REF TO variable.

GET REFERENCE OF me->query_result INTO itab.

*itab = me->query_result. "Wrong construct can't do like this

FIELD-SYMBOLS: <itab1> TYPE STANDARD TABLE.

ASSIGN itab->* TO <itab1>.

"After ASSIGN <itab1> refers to the same internal table. Whatever changes you do to <itab1> would be reflected in me->query_result also.

3 REPLIES 3

former_member194623
Participant
0 Kudos

I think you are pretty confused regarding use of TYPE REF TO variable.

GET REFERENCE OF me->query_result INTO itab.

*itab = me->query_result. "Wrong construct can't do like this

FIELD-SYMBOLS: <itab1> TYPE STANDARD TABLE.

ASSIGN itab->* TO <itab1>.

"After ASSIGN <itab1> refers to the same internal table. Whatever changes you do to <itab1> would be reflected in me->query_result also.

Former Member
0 Kudos

Hi,

ASSIGN itab->* TO <itab1>.

Since you are assigning itab to itab1, itab1 refers to the same memory area of itab and hence any changes made to itab1 would reflect in itab .

Regards,

Raghavendra

Former Member
0 Kudos

Thanks both of you. It gave me the direction I needed.