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

Reg : internal table & Perform statement

Former Member
0 Likes
508

hi all

i have 3 internal tables ,

* in first internal table i have mark-1 ,*

* in 2nd internal table i have mark-2 ,*

* using "PERFORM" i have to add mark 1 & mark 2*

* and i need to display the total in 3rd internal table.*

* how to do by using "PERFORM" .*

Kindly clarify.

with kind regards

vel

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
488

Do you have any relation key between two internal tables. can you give the pseudo code.

loop the both internal table and add the mark1 and mark2 and append it to internal table 3 inside the loop.

loop itab1 into witab1.

loop itab2 into witab2.

witab3-total = witab1-mark1 plus witab2-mark2.

append witab3 to itab3.

endloop.

endloop.

Regards

Raghu

4 REPLIES 4
Read only

Former Member
0 Likes
488

hi

In first table using loop add those values and append it to next Internal table.

Read only

Former Member
0 Likes
489

Do you have any relation key between two internal tables. can you give the pseudo code.

loop the both internal table and add the mark1 and mark2 and append it to internal table 3 inside the loop.

loop itab1 into witab1.

loop itab2 into witab2.

witab3-total = witab1-mark1 plus witab2-mark2.

append witab3 to itab3.

endloop.

endloop.

Regards

Raghu

Read only

0 Likes
488

hi

thanks for your answer , but i need help , by using

SUB ROUTINE [ PERFORM ] .

Read only

0 Likes
488

Raghupathy is right you just have to write:


porgram code......

perform sum_of_tables tables itab1
                                           itab2
                                           itab3.

program code....

definition of form:


form_sum_of_tables tables itab1
                                      itab2
                                      itab3.

definiton type of witab1, witab2, witab3.

loop itab1 into witab1.
loop itab2 into witab2.
witab3-total = witab1-mark1 plus witab2-mark2.
append witab3 to itab3.
endloop.
endloop.

endform.

It will return itab3 which is sum of itab1 and itab2.