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

Find accounts with the same IBAN's ?

Former Member
0 Likes
1,430

Dear all,

If there are two tables: TIBAN and LFBK, and each of them contain some entries. Some entries of LFBK can be the same as in TIBAN. Now, LFBK contains the field "lifnr" which TIBAN doesn't, and TIBAN contains "iban" which LFBK doesn't. How can I add the "lifnr's" from LFBK to the corresponding entries in TIBAN, and then from the result, find the entries that contain the same (double) IBAN's and finally display them in output  (together with the lifnr' added from LFBK) ?  Please let me know if I wasn't very clear.

Thanks in advance,

Shkelqim

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,216

Hi Shkelqim,

Write the query

Select Lifnr IBAN bkont into table it_output

from lfbk as a

join tiban as b

on a~banks = b~banks

and a~bankl = b~bankl

and a~bankn = b~bankn.

Sort it_output by lifnr iban.

Now output the table

6 REPLIES 6
Read only

Former Member
0 Likes
1,217

Hi Shkelqim,

Write the query

Select Lifnr IBAN bkont into table it_output

from lfbk as a

join tiban as b

on a~banks = b~banks

and a~bankl = b~bankl

and a~bankn = b~bankn.

Sort it_output by lifnr iban.

Now output the table

Read only

0 Likes
1,216

Thanks for your reply Mohammed. How should the loop for outputting the table look like ?

Read only

0 Likes
1,216

You don't need to loop display this table directly you want only duplicates

Write

DELETE ADJACENT DUPICATES FROM it_output COMPARING lifnr iban.

This will only list the records which have more than one LIFNR and IBAN combination

Read only

0 Likes
1,216

if you want the code.

LOOP AT it_output.

Write:/05 it_output-lifnr,

           15 it_output-iban.

ENDLOOP.

OR

You can use ALV

Read only

GauthamV
Active Contributor
0 Likes
1,216

First select data from LFBK based on lifnr then select data from TIBAN for all entries in LFBK

where BANKS,BANKL and BANKN in LFBK.

Read only

Former Member
0 Likes
1,216

Hi Gautham,

It's a full key SELECT..... Join will be faster I suppose in this case than FAE.

Regards