‎2013 Aug 19 10:35 PM
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
‎2013 Aug 20 5:49 AM
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
‎2013 Aug 20 5:49 AM
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
‎2013 Aug 20 10:06 AM
Thanks for your reply Mohammed. How should the loop for outputting the table look like ?
‎2013 Aug 20 11:43 AM
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
‎2013 Aug 20 11:44 AM
if you want the code.
LOOP AT it_output.
Write:/05 it_output-lifnr,
15 it_output-iban.
ENDLOOP.
OR
You can use ALV
‎2013 Aug 20 6:00 AM
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.
‎2013 Aug 20 6:03 AM
Hi Gautham,
It's a full key SELECT..... Join will be faster I suppose in this case than FAE.
Regards