Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8511

Re: I want to select 2 table in report pgrm,both table don't have same data....??

$
0
0

Hi Gokul,

 

Here is the Code.

 

Types: Begin of ty_itab3,

           Accnoyear          type table1-Accnoyear,

           name            type table1-name ,

           address         type table1-address ,

           pincode         type table1-pincode,

           city                type table1-city ,

           phoneno         type table1-phoneno,

           accno            type table2-accno,

           branchname   type table2-branchname,

           branchid        type table2-branchid,

           loanamount    type table2-loanamount,

           location          type table2-location,

end of ty_itab3.

 

Data: it_itab1 type standard table of table1,

        wa_itab1 type table1,

        it_itab2 type standard table of table2, 

        wa_itab2 type table2,

        it_itab3 type standard table of ty_itab3, 

        wa_itab1 type ty_itab3,

 

Data: L_accountno type string,

         L_acc(5) type c.

 

Select Acc.no name adress pincode city phoneno

from table1

into table it_tab1.

 

Select Accountno Branchname Branchid Loanamount location

from table2

into table it_tab2

 

Loop at Itab1 into wa_tab1.

L_accountno = wa_tab1-Acc.no().

Move L_accountno(5) to L_acc.

 

Read it_tab2 into wa_itab2 With Key accountno = L_acc.

 

wa_itab3-Accno         = wa_tab1-Accno.   

wa_itab3-name          = wa_tab1-name  .

wa_itab3-address       = wa_tab1-address.

wa_itab3-pincode       = wa_tab1-pincode  .

wa_itab3-city             = wa_tab1-city .

wa_itab3-phoneno      = wa_tab1phoneno.

wa_itab3-accno        = wa_itab2-accno   .

wa_itab3-branchname = wa_itab2-branchname.

wa_itab3-branchid      =wa_itab2-branchid .

wa_itab3- loanamount  =wa_itab2- loanamount.

wa_itab3-location         = wa_itab2-location     .

 

Append Wa_itab3 into It_tab3.

 

Clear: Wa_itab3, wa_itab2.wa_itab1.

 

Endloop.

 

Now Your Itab3 will have your required details.

 

hope this helps. Please get back for any issues

 

 

Regards,

Satish


Viewing all articles
Browse latest Browse all 8511

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>