‎2008 Aug 05 9:41 AM
hi friends,
i having a problem like , iam having 1 internal table with one field and second internal table with 9 fields and this data have to pass in to final internal table.
i used
loop of 1 internal table.
move 1field to final.
loop of 2 internal table.
move 9fields to final.
endloop.
endloop.
output:
i am getting here is
1 record values with 10 fields
but
2record with 1 field is different value same field values are coming for the 9 fields
3record with 1 field is different value same field values are coming for the 9 fields
4record with 1 field is different value same field values are coming for the 9 fields
can you solve this.
regards .
geetha.
‎2008 Aug 05 9:51 AM
Hi
do this
loop of 1 internal table.
move 1field to final.
read 2 internal table index sy-tabix.
if sy-subrc = 0.
move 9fields to final.
endif.
endloop.
Aditya
‎2008 Aug 05 10:12 AM
Hello Saigeetha,
Try this way...
loop at itab2.
itab_fianl-field1 = itab1-field1.
read table itab2 with key field2 eq itab1-field1 (or index ).
itab_final-field2 = itab2-field2.
..............
endloop.
Regards
Indu.
‎2008 Aug 05 10:15 AM
Hi,
Use the following logic,
loop at internaltab1.
move field1 to finaltab.
loop at internaltab2 where internaltab1-field1 EQ internaltab2-field1.
move remaining fields to finaltab.
endloop.
endloop.
‎2008 Aug 05 11:13 AM
hiii
you can do it by using following code
LOOP AT i_output INTO wa_output.
READ TABLE i_makt INTO wa_makt WITH KEY matnr = wa_output-matnr.
wa_output-maktx = wa_makt-maktx.
MODIFY i_output FROM wa_output.
CLEAR wa_output.
ENDLOOP. " LOOP AT i_outputregards
twinkal
‎2008 Aug 05 11:15 AM
Hi,
If u want to merge two internal table into one and the both table have a common field then u need to do in the following way...
loop at itab into wa_itab.
wa_final-field1 = wa_itab-field1.
move corresponding wa_final into it_final.
read table iatb1 with key field1 = wa_itab-field1.
if sy-subrc = 0.
wa_final-field2 = wa_itab1-field2.
wa_final-field3 = wa_itab1-field3.
wa_final-field4 = wa_itab1-field3.
.
.
.
wa_final-field9 = wa_itab1-field9.
move corresponding wa_final into it_final.
append wa_final to it_final.
endif.
endloop.
Thanks & Regards
Ashu Singh
‎2008 Aug 05 9:36 PM
There's no connection between table 1 and 2. Your loop of table 2 doesn't have any conditions attached, so it will loop all the way through, attaching the last record of table 2 to every record of table one.
‎2008 Aug 06 10:39 AM
Hi,
Try this.
Loop at itab1.
Append itab1 to final.
Read table itab2 index1.
Modify final from itab2 where f1 = itab1-f1.
endloop.
Sharin.
‎2008 Sep 30 4:56 AM