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

in reports

Former Member
0 Likes
618

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.

4 REPLIES 4
Read only

Former Member
0 Likes
598

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

Read only

Former Member
0 Likes
598

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

Read only

Former Member
0 Likes
598

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

Read only

Former Member
0 Likes
598

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.