If you wish to extract Vendor Master: General data and Vendor Master: Company data then you can use the following function module.
ABAP Function Module to Read vendor Master
VENDOR_READ
The following program show the parameters that need to be passed to the function module. Basically you need to pass the Vendor Number and the Company Code.
REPORT ZEX_VENDORREAD .
Parameters: p_lifnr like LFA1-LIFNR, p_bukrs like LFB1-BUKRS.
Data: st_lfa1 like LFA1, st_lfb1 like LFB1.
CALL FUNCTION 'VENDOR_READ' EXPORTING I_BUKRS = p_bukrs I_LIFNR = p_lifnr IMPORTING E_LFA1 = st_lfa1 E_LFB1 = st_lfb1 EXCEPTIONS NOT_FOUND = 1 OTHERS = 2 . IF SY-SUBRC <> 0. * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ENDIF.
Find below a list of Vendor Master related tables:
LFA1 - Vendor Master: General data LFB1 - Vendor Master: Company data LFM1 - Vendor Master: Purchasing Data (Purchasing organization) LFM2 - Vendor Master: Purchasing Data (Plant, Vendor sub-range) LFBK - Vendor Master Bank Details
Note: For more vendor Master tables enter LF* in SE11 ad press F4
Always use Pretty Printer and Extended Program Check before releasing the code.
Do not leave unused code in the program. Comment the code thoroughly. Align the comments and the Code. Follow the SAP Standards and SAP Best Practices guidelines. It’s a good practice to take a dump of the code on your local drive.