2008 Nov 14 4:53 AM
hai abapers,
iam taken three internal tables.
first internal table some fields with 2 records with common field value ebeln.
second internal table different fields with 2 records with common field value ebeln.
third internal table different fields with 2 records with common field value ebeln.
all of these tables contains common field ebeln value is also same.
my requirement is all these three tables club into single table with two records with common ebeln value.
this is possible?
please explain.
hai abapers,
iam taken three internal tables.
first internal table some fields with 2 records with common field value ebeln.
second internal table different fields with 2 records with common field value ebeln.
third internal table different fields with 2 records with common field value ebeln.
all of these tables contains common field ebeln value is also same.
my requirement is all these three tables club into single table with two records with common ebeln value.
this is possible?
please explain.
2008 Nov 14 4:57 AM
hi,
try like this..
loop at itab1.
read table itab2 with key ebeln = itab1-ebeln.
move the records to itab.
read tabel itab3 with key ebeln = itab1-ebeln..
move the records to itab.
endloop.here itab is final internal table.
Edited by: Sathish Reddy on Nov 14, 2008 10:28 AM
2008 Nov 14 5:02 AM
Hi,
try like this...
loop at itab1.
read table itab2 with key ebeln = itab1-ebeln.
if sy-subrc eq 0.
move the records to itab.
endif.
read tabel itab3 with key ebeln = itab1-ebeln..
if sy-subrc eq 0.
move the records to itab.
endif.
endloop.
Arunima
2008 Nov 14 5:02 AM
Hi
Select field1
field2
ebeln from table1
INTO itab1
where <condtion>.
IF SY-SUBRC EQ 0.
SORT ITAB1 BY EBELN.
select field3
filed4
ebeln from table2
INTO itab2
FOR ALL ENTRIES IN ITAB1
WHERE EBELN = ITAB1-EBELN
IF SY-SUBRC EQ 0
SORT ITAB2 BY EBELN.
ENDIF.
select field5
filed6
ebeln from table3
INTO itab2
FOR ALL ENTRIES IN ITAB1
WHERE EBELN = ITAB1-EBELN
ENDIF.
Then declare a final internal table and move all the fields into the final internal table as said by sathish and arunima
Edited by: Rasheed salman on Nov 14, 2008 6:02 AM
Edited by: Rasheed salman on Nov 14, 2008 6:05 AM
2008 Nov 14 5:06 AM
Hi raj,
first itab1
loop at itab1 into wa_itab1.
read table itab2 into wa_temp1 where ebeln = wa-itab1-ebeln.
read table itab3 into wa_temp2 where ebeln = wa_temp1-ebeln.
APPEND wa_temp2 INTO itab4.
ENDLOOP.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |