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: 

Query does not give desired results

Former Member
0 Kudos
211

Hi Experts

I have created a query using tables LFA1, LFB1, LFBK and TIBAN.

My requirement is to have list of vendors of a specific country in a company code.

I am getting several records from TIBAN instead of getting list based in LFBK.

I could not join LFBK-BANKN and TIBAN-BANKN. This might be reason for erratic results.

Please advise how to join the above two fields for getting correct results.

Thanks and warm regards

ramSiva

1 ACCEPTED SOLUTION

Former Member
0 Kudos
68

hi ram ,

try using left join and inner join .

length of bankn field vary in both the tables , so its quite complicated to use join , would like to suggest to use 'for all entries ' .

regards

ranjan

4 REPLIES 4

Former Member
0 Kudos
69

hi ram ,

try using left join and inner join .

length of bankn field vary in both the tables , so its quite complicated to use join , would like to suggest to use 'for all entries ' .

regards

ranjan

0 Kudos
68

Hi Ranjan

Thanks for repsonse.

Can you detail more?

warm regards

ramSiva

0 Kudos
68
SELECT * FROM LFBK
                 INTO TABLE <ITABL>
                 FOR ALL ENTRIES IN IT_TIBAN
                 WHERE BANKN EQ IT_TIBAN-BANKN.

As the Data element of TIBAN-BANKN and LFBK-BANKN is different, i afraid FOR ALL ENTRIES will also not work.. any way try or else compare with other keys like....

SELECT * FROM LFBK
                 INTO TABLE <ITABL>
                 FOR ALL ENTRIES IN IT_TIBAN
                 WHERE BANKS eq IT_TIBAN-BANKS
                 AND       BANKL eq IT_TIBAN-BANKL
                 AND       BKNOT eq IT_TIBAN-BKNOT.

If you list your requirement clear, then can help with create query with all tables...

Thanks & Regards,

SUJI.

0 Kudos
68

hi ram ,

i agree with suji's above solution .

regards

ranjan