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

move values from one internal table to another internal table.

Former Member
0 Likes
3,039

Hi Gurus,

please help me in writing a generic program to move data from one internal table to another internal tables whose fields names are different.

field 1 of internal table-1 should goto field1 of internal table-2. dont worry about data types etc.

( i have an internal table itab_zabc with field names abc1 , abc2. and another internal table itab_zxyz with field names xyz1 , xyz2.

now i want to move data from itab_zabc to itab_zxyz . abc1 to xyz1...abc2 to xyz2...etc...)

hope you got me. i tried with field symbols. but no luck.

can you send me any generic programs...utility programs.. re-usable programs.. you have. we are starting a new project . as asked above , we need all generic programs that can be re-used.

Thanks in advance.

Sree

Hi Gurus,

please help me in writing a generic program to move data from one internal table to another internal tables whose fields names are different.

field 1 of internal table-1 should goto field1 of internal table-2. dont worry about data types etc.

( i have an internal table itab_zabc with field names abc1 , abc2. and another internal table itab_zxyz with field names xyz1 , xyz2.

now i want to move data from itab_zabc to itab_zxyz . abc1 to xyz1...abc2 to xyz2...etc...)

hope you got me. i tried with field symbols. but no luck.

can you send me any generic programs...utility programs.. re-usable programs.. you have. we are starting a new project . as asked above , we need all generic programs that can be re-used.

Thanks in advance.

Sree

4 REPLIES 4
Read only

Former Member
0 Likes
1,451

If they have the same lengths, then you may want to move them to a string anf transfer the string to your target

loop at itab.

v_str = itab.

itab2 = v_str.

append itab2.

clear itab2.

endloop.

  • Works in non unicode only

Regards,

Ravi

Read only

Former Member
0 Likes
1,451

if the data types are same but names are different you can try this code:



append lines of itab_zabc to itab_zxyz.
append lines of abc1 to xyz1.
append lines of abc2 to xyz2.

Read only

0 Likes
1,451

Hi,

thanks for your replies... seems i couldnt' convey my problem..

LOOP AT lt_ethnic_tbl INTO wa_ethnic_row.

la_value-key = wa_ethnic_row-ethnic.

la_value-value = wa_ethnic_row-ethnic_desc.

APPEND la_value TO lt_value_set.

CLEAR la_value.

ENDLOOP.

above code i want to make a generic.

from the above example i am moving data from internal table " lt_ethnic_tbl" to "lt_value_set".

i have another four different internal tables similar to "lt_ethnic_tbl" .

i have 4 radio buttons. if i choose radio button 1, "lt_value_set" should be filled from lt_ethnic_tbl.

if i choose radio button 2 , "lt_value_set" should be filled from it_xyz... .and so on..

i dont want to use 4 loop ...end loops to move data to "lt_value_set".

hope you got me this time.

thanks in advance.

Sree

Read only

0 Likes
1,451

continue to earlier mail. i would like a perform with "from table" and "to table" as parameters.

first perform call , i pass "lt_ethnic_.." and "lt_value_set" .

second perform call... i would like to pass "lt_xyz..." and "lt_value_set".

thanks