SAP VENDOR_SAVE Function Module for vendor save
VENDOR_SAVE is a standard vendor save SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for vendor save processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.
See here to view full function module documentation and code listing for vendor save FM, simply by entering the name VENDOR_SAVE into the relevant SAP transaction such as SE37 or SE38.
Function Group: MASS_VENDOR_UTILITIES
Program Name: SAPLMASS_VENDOR_UTILITIES
Main Program: SAPLMASS_VENDOR_UTILITIES
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:

Function VENDOR_SAVE pattern details
In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.CALL FUNCTION 'VENDOR_SAVE'"vendor save.
EXPORTING
* I_LFA1 = "Vendor Master (General Section)
* I_LFM1 = "Vendor master record purchasing organization data
* SAVE_LFM2 = 'X' "Save to LFM2 table
* UPDATE_ME = 'X' "Update MARC/EINE if necessary
IMPORTING
TOTAL_EINE = "Returns number of eine updated
TOTAL_MARC = "Returns number of marc updated
TABLES
LFM2_NEW = "mass maintenance structure for lfm2 data
LFM2_OLD = "Change document structure; generated by RSSCD000
LFM2_ERR = "Vendor Master Record: Purchasing Data
ERROR_MSG = "Structure of message variables
IMPORTING Parameters details for VENDOR_SAVE
I_LFA1 - Vendor Master (General Section)
Data type: LFA1Optional: Yes
Call by Reference: No ( called with pass by value option)
I_LFM1 - Vendor master record purchasing organization data
Data type: LFM1Optional: Yes
Call by Reference: No ( called with pass by value option)
SAVE_LFM2 - Save to LFM2 table
Data type: FLAGDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
UPDATE_ME - Update MARC/EINE if necessary
Data type: FLAGDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for VENDOR_SAVE
TOTAL_EINE - Returns number of eine updated
Data type: IOptional: No
Call by Reference: No ( called with pass by value option)
TOTAL_MARC - Returns number of marc updated
Data type: IOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for VENDOR_SAVE
LFM2_NEW - mass maintenance structure for lfm2 data
Data type: MASS_LFM2_DOptional: No
Call by Reference: No ( called with pass by value option)
LFM2_OLD - Change document structure; generated by RSSCD000
Data type: LFM2Optional: No
Call by Reference: No ( called with pass by value option)
LFM2_ERR - Vendor Master Record: Purchasing Data
Data type: LFM2Optional: No
Call by Reference: No ( called with pass by value option)
ERROR_MSG - Structure of message variables
Data type: MASS_BALMIOptional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for VENDOR_SAVE Function Module
The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.| DATA: | ||||
| lv_i_lfa1 | TYPE LFA1, " | |||
| lt_lfm2_new | TYPE STANDARD TABLE OF MASS_LFM2_D, " | |||
| lv_total_eine | TYPE I, " | |||
| lv_i_lfm1 | TYPE LFM1, " | |||
| lt_lfm2_old | TYPE STANDARD TABLE OF LFM2, " | |||
| lv_total_marc | TYPE I, " | |||
| lt_lfm2_err | TYPE STANDARD TABLE OF LFM2, " | |||
| lv_save_lfm2 | TYPE FLAG, " 'X' | |||
| lt_error_msg | TYPE STANDARD TABLE OF MASS_BALMI, " | |||
| lv_update_me | TYPE FLAG. " 'X' |
|   CALL FUNCTION 'VENDOR_SAVE' "vendor save |
| EXPORTING | ||
| I_LFA1 | = lv_i_lfa1 | |
| I_LFM1 | = lv_i_lfm1 | |
| SAVE_LFM2 | = lv_save_lfm2 | |
| UPDATE_ME | = lv_update_me | |
| IMPORTING | ||
| TOTAL_EINE | = lv_total_eine | |
| TOTAL_MARC | = lv_total_marc | |
| TABLES | ||
| LFM2_NEW | = lt_lfm2_new | |
| LFM2_OLD | = lt_lfm2_old | |
| LFM2_ERR | = lt_lfm2_err | |
| ERROR_MSG | = lt_error_msg | |
| . " VENDOR_SAVE | ||
ABAP code using 7.40 inline data declarations to call FM VENDOR_SAVE
The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.| DATA(ld_save_lfm2) | = 'X'. | |||
| DATA(ld_update_me) | = 'X'. | |||
Search for further information about these or an SAP related objects