Application Development and Automation 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: 
Read only

Dynamic Merging

former_member194669
Active Contributor
0 Likes
537

Hi All,

I have requirment to merge 2 dynamic internal tables.

This is the scnerio. Here i_key internal table contains the key fields of itab1 and itab2. I have loop thru itab1 and find the field value of fld5 from itab2 and fill in itab1-fld5.

i_key (Internal Table)

field key

fld1 X

fld2 X

itab1

fld1 fld2 fld3 fld4 fld5

A A 1 2

B B 1 3

itab2

fld1 fld2 fld5

A A 4

B B 4

after the looping itab1 look like:-->

itab1

fld1 fld2 fld3 fld4 fld5

A A 1 2 4

B B 1 3 4

My problem is Here itab1 and itab2 are dynamic internal table, so the fields may change.

1 REPLY 1
Read only

Former Member
0 Likes
442

Hi,

Use ASSIGN COMPONENT ...

Example

-


field-symbols: <fs>.

data: begin of s_mara ,

matnr type matnr,

end of s_mara.

ASSIGN COMPONENT 'MATNR' of structure s_mara to <FS>.

<fs> = 'Test'.

write: / s_mara-matnr.

Thanks,

Naren