SAP SD_LC_DOC_SELECT Function Module for Select L/C docs from SD
SD_LC_DOC_SELECT is a standard sd lc doc select SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Select L/C docs from SD 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 lc doc select FM, simply by entering the name SD_LC_DOC_SELECT into the relevant SAP transaction such as SE37 or SE38.
Function Group: VKMP
Program Name: SAPLVKMP
Main Program: SAPLVKMP
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function SD_LC_DOC_SELECT 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_LC_DOC_SELECT'"Select L/C docs from SD.
EXPORTING
* IR_SO = "Sales and Distribution Document Number
* IT_LCNUM = "Table for SD LCNUM
* IF_MIGRATION = "Used for migration
* IF_BLOCKED_DOCUMENTS = "Select blocked documents
IMPORTING
ET_LC_SD_DOCS = "table of TSLC_SD_DOC
ET_RISK_VALUE_DOCS = "Risk value of SD documents
EXCEPTIONS
LDB_NOT_REENTRANT = 1 FREE_SELECTIONS_ERROR = 10 CALLBACK_NO_EVENT = 11 CALLBACK_NODE_DUPLICATE = 12 CALLBACK_NO_PROGRAM = 13 CALLBACK_NO_CBFORM = 14 DYN_NODE_NO_TYPE = 15 DYN_NODE_INVALID_TYPE = 16 LDB_INCORRECT = 2 LDB_ALREADY_RUNNING = 3 LDB_ERROR = 4 LDB_SELECTIONS_ERROR = 5 LDB_SELECTIONS_NOT_ACCEPTED = 6 VARIANT_NOT_EXISTENT = 7 VARIANT_OBSOLETE = 8 VARIANT_ERROR = 9
IMPORTING Parameters details for SD_LC_DOC_SELECT
IR_SO - Sales and Distribution Document Number
Data type: SACO_VBELN_RANGES_TABOptional: Yes
Call by Reference: No ( called with pass by value option)
IT_LCNUM - Table for SD LCNUM
Data type: TTLC_LCNUMOptional: Yes
Call by Reference: No ( called with pass by value option)
IF_MIGRATION - Used for migration
Data type: XFLAGOptional: Yes
Call by Reference: No ( called with pass by value option)
IF_BLOCKED_DOCUMENTS - Select blocked documents
Data type: XFLAGOptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for SD_LC_DOC_SELECT
ET_LC_SD_DOCS - table of TSLC_SD_DOC
Data type: TTLC_SD_DOCOptional: No
Call by Reference: No ( called with pass by value option)
ET_RISK_VALUE_DOCS - Risk value of SD documents
Data type: TTLC_RISK_VALUE_DOCSOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
LDB_NOT_REENTRANT - Logical database not intended for multiple calls
Data type:Optional: No
Call by Reference: Yes
FREE_SELECTIONS_ERROR - Error during dynamic selection initialization
Data type:Optional: No
Call by Reference: Yes
CALLBACK_NO_EVENT - In CALLBACK: neither GET nor GET_LATE is activated
Data type:Optional: No
Call by Reference: Yes
CALLBACK_NODE_DUPLICATE - Node doubled in CALLBACK
Data type:Optional: No
Call by Reference: Yes
CALLBACK_NO_PROGRAM - No CALLBACK program entered
Data type:Optional: No
Call by Reference: Yes
CALLBACK_NO_CBFORM - No CALLBACK routine entered
Data type:Optional: No
Call by Reference: Yes
DYN_NODE_NO_TYPE - 'Dynamically typed' nodes: No type
Data type:Optional: No
Call by Reference: Yes
DYN_NODE_INVALID_TYPE - 'Dynamically typed' nodes: Invalid type
Data type:Optional: No
Call by Reference: Yes
LDB_INCORRECT - Incorrect logical database name
Data type:Optional: No
Call by Reference: Yes
LDB_ALREADY_RUNNING - Nested call of the same logical database
Data type:Optional: No
Call by Reference: Yes
LDB_ERROR - Logical database produces error code
Data type:Optional: No
Call by Reference: Yes
LDB_SELECTIONS_ERROR - Erroneous SELECTIONS structure
Data type:Optional: No
Call by Reference: Yes
LDB_SELECTIONS_NOT_ACCEPTED - Logical database does not accept selections
Data type:Optional: No
Call by Reference: Yes
VARIANT_NOT_EXISTENT - Variant does not exist
Data type:Optional: No
Call by Reference: Yes
VARIANT_OBSOLETE - Variant is obsolete
Data type:Optional: No
Call by Reference: Yes
VARIANT_ERROR - Error during variable import
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for SD_LC_DOC_SELECT 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_ir_so | TYPE SACO_VBELN_RANGES_TAB, " | |||
| lv_et_lc_sd_docs | TYPE TTLC_SD_DOC, " | |||
| lv_ldb_not_reentrant | TYPE TTLC_SD_DOC, " | |||
| lv_free_selections_error | TYPE TTLC_SD_DOC, " | |||
| lv_callback_no_event | TYPE TTLC_SD_DOC, " | |||
| lv_callback_node_duplicate | TYPE TTLC_SD_DOC, " | |||
| lv_callback_no_program | TYPE TTLC_SD_DOC, " | |||
| lv_callback_no_cbform | TYPE TTLC_SD_DOC, " | |||
| lv_dyn_node_no_type | TYPE TTLC_SD_DOC, " | |||
| lv_dyn_node_invalid_type | TYPE TTLC_SD_DOC, " | |||
| lv_it_lcnum | TYPE TTLC_LCNUM, " | |||
| lv_ldb_incorrect | TYPE TTLC_LCNUM, " | |||
| lv_et_risk_value_docs | TYPE TTLC_RISK_VALUE_DOCS, " | |||
| lv_if_migration | TYPE XFLAG, " | |||
| lv_ldb_already_running | TYPE XFLAG, " | |||
| lv_ldb_error | TYPE XFLAG, " | |||
| lv_if_blocked_documents | TYPE XFLAG, " | |||
| lv_ldb_selections_error | TYPE XFLAG, " | |||
| lv_ldb_selections_not_accepted | TYPE XFLAG, " | |||
| lv_variant_not_existent | TYPE XFLAG, " | |||
| lv_variant_obsolete | TYPE XFLAG, " | |||
| lv_variant_error | TYPE XFLAG. " |
|   CALL FUNCTION 'SD_LC_DOC_SELECT' "Select L/C docs from SD |
| EXPORTING | ||
| IR_SO | = lv_ir_so | |
| IT_LCNUM | = lv_it_lcnum | |
| IF_MIGRATION | = lv_if_migration | |
| IF_BLOCKED_DOCUMENTS | = lv_if_blocked_documents | |
| IMPORTING | ||
| ET_LC_SD_DOCS | = lv_et_lc_sd_docs | |
| ET_RISK_VALUE_DOCS | = lv_et_risk_value_docs | |
| EXCEPTIONS | ||
| LDB_NOT_REENTRANT = 1 | ||
| FREE_SELECTIONS_ERROR = 10 | ||
| CALLBACK_NO_EVENT = 11 | ||
| CALLBACK_NODE_DUPLICATE = 12 | ||
| CALLBACK_NO_PROGRAM = 13 | ||
| CALLBACK_NO_CBFORM = 14 | ||
| DYN_NODE_NO_TYPE = 15 | ||
| DYN_NODE_INVALID_TYPE = 16 | ||
| LDB_INCORRECT = 2 | ||
| LDB_ALREADY_RUNNING = 3 | ||
| LDB_ERROR = 4 | ||
| LDB_SELECTIONS_ERROR = 5 | ||
| LDB_SELECTIONS_NOT_ACCEPTED = 6 | ||
| VARIANT_NOT_EXISTENT = 7 | ||
| VARIANT_OBSOLETE = 8 | ||
| VARIANT_ERROR = 9 | ||
| . " SD_LC_DOC_SELECT | ||
ABAP code using 7.40 inline data declarations to call FM SD_LC_DOC_SELECT
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.Search for further information about these or an SAP related objects