SAP OL_SET_LVORM_MATERIAL Function Module for Preparation for Setting/Unsetting of Deletion Incicators
OL_SET_LVORM_MATERIAL is a standard ol set lvorm material SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Preparation for Setting/Unsetting of Deletion Incicators 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 ol set lvorm material FM, simply by entering the name OL_SET_LVORM_MATERIAL into the relevant SAP transaction such as SE37 or SE38.
Function Group: WSO7
Program Name: SAPLWSO7
Main Program: SAPLWSO7
Appliation area: W
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function OL_SET_LVORM_MATERIAL 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 'OL_SET_LVORM_MATERIAL'"Preparation for Setting/Unsetting of Deletion Incicators.
EXPORTING
* PI_LVORM = ' ' "'X': set, ' ': unset
PI_MATNR = "Material
* PI_WERKS = ' ' "Plant
* PI_VKORG = ' ' "Sales Organization
* PI_VTWEG = ' ' "Distribution Channel
* PI_SPERREN = ' ' "Indicator for Locking of Entries
* WRITE_CHANGE_DOCUMENTS = 'X' "Indicator for Change Document Creation
* UNAME = SY-UNAME "
EXCEPTIONS
NO_LVORM_SET = 1
Customer Function user exits
Below is a list of CUSTOMER FUNCTION exit user exits that are available within this program and maybe relevant for this FM.EXIT_SAPLWSO7_001 Find Processor Group for Error Messages
IMPORTING Parameters details for OL_SET_LVORM_MATERIAL
PI_LVORM - 'X': set, ' ': unset
Data type: MARA-LVORMDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
PI_MATNR - Material
Data type: MARA-MATNROptional: No
Call by Reference: No ( called with pass by value option)
PI_WERKS - Plant
Data type: T001W-WERKSDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
PI_VKORG - Sales Organization
Data type: T001W-VKORGDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
PI_VTWEG - Distribution Channel
Data type: T001W-VTWEGDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
PI_SPERREN - Indicator for Locking of Entries
Data type: TVGVI-SPERADefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
WRITE_CHANGE_DOCUMENTS - Indicator for Change Document Creation
Data type:Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
UNAME -
Data type: SY-UNAMEDefault: SY-UNAME
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NO_LVORM_SET - no deletion flag set
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for OL_SET_LVORM_MATERIAL 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_pi_lvorm | TYPE MARA-LVORM, " ' ' | |||
| lv_no_lvorm_set | TYPE MARA, " | |||
| lv_pi_matnr | TYPE MARA-MATNR, " | |||
| lv_pi_werks | TYPE T001W-WERKS, " ' ' | |||
| lv_pi_vkorg | TYPE T001W-VKORG, " ' ' | |||
| lv_pi_vtweg | TYPE T001W-VTWEG, " ' ' | |||
| lv_pi_sperren | TYPE TVGVI-SPERA, " ' ' | |||
| lv_write_change_documents | TYPE TVGVI, " 'X' | |||
| lv_uname | TYPE SY-UNAME. " SY-UNAME |
|   CALL FUNCTION 'OL_SET_LVORM_MATERIAL' "Preparation for Setting/Unsetting of Deletion Incicators |
| EXPORTING | ||
| PI_LVORM | = lv_pi_lvorm | |
| PI_MATNR | = lv_pi_matnr | |
| PI_WERKS | = lv_pi_werks | |
| PI_VKORG | = lv_pi_vkorg | |
| PI_VTWEG | = lv_pi_vtweg | |
| PI_SPERREN | = lv_pi_sperren | |
| WRITE_CHANGE_DOCUMENTS | = lv_write_change_documents | |
| UNAME | = lv_uname | |
| EXCEPTIONS | ||
| NO_LVORM_SET = 1 | ||
| . " OL_SET_LVORM_MATERIAL | ||
ABAP code using 7.40 inline data declarations to call FM OL_SET_LVORM_MATERIAL
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.| "SELECT single LVORM FROM MARA INTO @DATA(ld_pi_lvorm). | ||||
| DATA(ld_pi_lvorm) | = ' '. | |||
| "SELECT single MATNR FROM MARA INTO @DATA(ld_pi_matnr). | ||||
| "SELECT single WERKS FROM T001W INTO @DATA(ld_pi_werks). | ||||
| DATA(ld_pi_werks) | = ' '. | |||
| "SELECT single VKORG FROM T001W INTO @DATA(ld_pi_vkorg). | ||||
| DATA(ld_pi_vkorg) | = ' '. | |||
| "SELECT single VTWEG FROM T001W INTO @DATA(ld_pi_vtweg). | ||||
| DATA(ld_pi_vtweg) | = ' '. | |||
| "SELECT single SPERA FROM TVGVI INTO @DATA(ld_pi_sperren). | ||||
| DATA(ld_pi_sperren) | = ' '. | |||
| DATA(ld_write_change_documents) | = 'X'. | |||
| "SELECT single UNAME FROM SY INTO @DATA(ld_uname). | ||||
| DATA(ld_uname) | = SY-UNAME. | |||
Search for further information about these or an SAP related objects