SAP SD_SPECIAL_STOCK_ASSIGN Function Module for Determine special stock indicator for availability check
SD_SPECIAL_STOCK_ASSIGN is a standard sd special stock assign SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Determine special stock indicator for availability check 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 sd special stock assign FM, simply by entering the name SD_SPECIAL_STOCK_ASSIGN into the relevant SAP transaction such as SE37 or SE38.
Function Group: V03S
Program Name: SAPLV03S
Main Program: SAPLV03S
Appliation area: V
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function SD_SPECIAL_STOCK_ASSIGN 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 'SD_SPECIAL_STOCK_ASSIGN'"Determine special stock indicator for availability check.
EXPORTING
* ITEM_CATEGORY = ' ' "
MOVEMENT_TYPE = "
* RETURNS_ITEM = ' ' "
* SPECIAL_STOCK_TYPE = ' ' "
IMPORTING
STOCK_TYPE_TRANSFER = "
WA_TVAP = "
EXCEPTIONS
ITEM_CATEGORY_NOT_VALID = 1 NOT_FOUND = 2 NO_MOVEMENT_TYPE = 3 NO_RETURNS_ITEM = 4
IMPORTING Parameters details for SD_SPECIAL_STOCK_ASSIGN
ITEM_CATEGORY -
Data type: TVAP-PSTYVDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
MOVEMENT_TYPE -
Data type: T156-BWARTOptional: No
Call by Reference: No ( called with pass by value option)
RETURNS_ITEM -
Data type: TVAP-SHKZGDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
SPECIAL_STOCK_TYPE -
Data type: T156B-SOBKZDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for SD_SPECIAL_STOCK_ASSIGN
STOCK_TYPE_TRANSFER -
Data type: TVAP-SOBKZOptional: No
Call by Reference: No ( called with pass by value option)
WA_TVAP -
Data type: TVAPOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
ITEM_CATEGORY_NOT_VALID -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NOT_FOUND -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_MOVEMENT_TYPE -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_RETURNS_ITEM -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for SD_SPECIAL_STOCK_ASSIGN 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_item_category | TYPE TVAP-PSTYV, " SPACE | |||
| lv_stock_type_transfer | TYPE TVAP-SOBKZ, " | |||
| lv_item_category_not_valid | TYPE TVAP, " | |||
| lv_wa_tvap | TYPE TVAP, " | |||
| lv_not_found | TYPE TVAP, " | |||
| lv_movement_type | TYPE T156-BWART, " | |||
| lv_returns_item | TYPE TVAP-SHKZG, " SPACE | |||
| lv_no_movement_type | TYPE TVAP, " | |||
| lv_no_returns_item | TYPE TVAP, " | |||
| lv_special_stock_type | TYPE T156B-SOBKZ. " SPACE |
|   CALL FUNCTION 'SD_SPECIAL_STOCK_ASSIGN' "Determine special stock indicator for availability check |
| EXPORTING | ||
| ITEM_CATEGORY | = lv_item_category | |
| MOVEMENT_TYPE | = lv_movement_type | |
| RETURNS_ITEM | = lv_returns_item | |
| SPECIAL_STOCK_TYPE | = lv_special_stock_type | |
| IMPORTING | ||
| STOCK_TYPE_TRANSFER | = lv_stock_type_transfer | |
| WA_TVAP | = lv_wa_tvap | |
| EXCEPTIONS | ||
| ITEM_CATEGORY_NOT_VALID = 1 | ||
| NOT_FOUND = 2 | ||
| NO_MOVEMENT_TYPE = 3 | ||
| NO_RETURNS_ITEM = 4 | ||
| . " SD_SPECIAL_STOCK_ASSIGN | ||
ABAP code using 7.40 inline data declarations to call FM SD_SPECIAL_STOCK_ASSIGN
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 PSTYV FROM TVAP INTO @DATA(ld_item_category). | ||||
| DATA(ld_item_category) | = ' '. | |||
| "SELECT single SOBKZ FROM TVAP INTO @DATA(ld_stock_type_transfer). | ||||
| "SELECT single BWART FROM T156 INTO @DATA(ld_movement_type). | ||||
| "SELECT single SHKZG FROM TVAP INTO @DATA(ld_returns_item). | ||||
| DATA(ld_returns_item) | = ' '. | |||
| "SELECT single SOBKZ FROM T156B INTO @DATA(ld_special_stock_type). | ||||
| DATA(ld_special_stock_type) | = ' '. | |||
Search for further information about these or an SAP related objects