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: 

Searching for LFB1-LNRZE

Former Member
0 Kudos

I need to check if a vendor is a 'head office vendor' and that would require a select on table LFB1 to check field LNRZE to see if that vendor is there. This field is not indexed, so a sequential read of the entire table would be performed (not a good idea!). Does anyone have a suggestion? Should I have our basis people put an index on that field?

1 REPLY 1

nablan_umar
Active Contributor
0 Kudos

Hello Lisa,

From what I understand from your statement, you know the vendor number but not sure whether it is a "head office vendor". In this case, you don't need an index for it.

Select single lnrze into lv_lnrze from lfb1 where lifnr = lv_lifnr and bukrs = lv_bukrs.

if not lv_lnrze is initial.

*this is head office

else.

  • this is not head office

endif.

This statement will be quick. You don't need index on LNRZE.

However, if you want to get the list of vendors which are "head office vendor", then you should create an index. You index should contain the MANDT and LNRZE.