Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Any records exist for given VENDOR NUMBER and COMPANY CODE

Hi Experts,

Need help in checking if there are any records exist for given VENDOR NUMBER and COMPANY CODE.

in LFB1 table and if result is 0 then giving out error like COMPANY CODE DO NOT EXIST FOR THIS VENDOR NUMBER.

Thanks for all your help.

-Chris.

Tags:
replied

hi,

most effective is to use SELECT COUNT:

SELECT COUNT( * )
FROM LFB1
WHERE lifnr EQ ...
AND bukrs EQ ...

IF sy-subrc EQ 0.
=> there is a vendor for that company code
ELSE.
=> there is no ...
ENDIF.

hope this helps

ec

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question