Application Development 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: 

Internal tables.

Former Member
0 Kudos

Hi,

I have an internal table it with

f1

70

70

70

80

80

80

I have another internal table it1 with the following set of values/

f1 no

70 4.

80 5.

I want values in the first internal table or another internal table in the following format.How to do it.The first field is common in both tables.

f1 no

70 4

70 4

70 4

80 5

80 5

80 5.

Thanks..

1 ACCEPTED SOLUTION

gopi_narendra
Active Contributor
0 Kudos

ITAB1

F1

70

70

70

80

80

80

ITAB2

F1 No

70 4

80 5


loop at ITAB1.
  read table ITAB2 with key F1 = ITAB1-F1.
    if sy-subrc = 0.
      move ITAB2-No to ITAB1-No.
      modify ITAB1.
      clear : ITAB2.
    endif.
    clear : ITAB1.
endloop.

Regards

Gopi

5 REPLIES 5

Former Member
0 Kudos

loop at it1.

read table it2 with key f1 = it1-f1.

if sy-subrc = 0.

it1-no = it2-no.

modify it1.

endif.

endloop.

it will update in it1(same table) which contains the record

f1

70

70

70

80

80

80

regards

shiba dutta

Former Member
0 Kudos

data: itab3 like itab2.

loop at itab1 into wa1.

read table itab2 with key f1 = wa1-f1 into wa2.

if sy-subrc = 0.

append wa2 to itab3.

endif.

clear wa2.

endloop.

now in the itab3 the corresponding fields and entries will be there....

Message was edited by:

Muthurajan Ramkumar

gopi_narendra
Active Contributor
0 Kudos

ITAB1

F1

70

70

70

80

80

80

ITAB2

F1 No

70 4

80 5


loop at ITAB1.
  read table ITAB2 with key F1 = ITAB1-F1.
    if sy-subrc = 0.
      move ITAB2-No to ITAB1-No.
      modify ITAB1.
      clear : ITAB2.
    endif.
    clear : ITAB1.
endloop.

Regards

Gopi

Former Member
0 Kudos

Hi,

Loop at it1.

read it2 with key field1 = it1-field1

if sy-subrc eq 0.

it1-field2 = it2-field2.

modify it1.

endif.

endloop.

Declare the same field type as there in second internal table in the first internal table.

Please reward suitable answers.

Regards,

Irfan

sivaprasad_ml
Participant
0 Kudos

ITAB1

F1

70

70

70

80

80

80

ITAB2

F1 No

70 4

80 5

The third int table

ITAB3

F1 | No

70 |

70

70

80

80

80

" looping the table 1.

loop at ITAB1.

" clear ing header line.

clear itab2.

read table ITAB2 with key F1 = ITAB1-F1.

if sy-subrc = 0.

itab3 -no = itab2-no.

modify itab3 transporting no.

endif.

endloop.

Regards

Siva

Message was edited by:

Sivaprasad ML