SAP SD_SALES_DOCUMENT_COPY Function Module for Copy Sales Document to a Subsequent Document
SD_SALES_DOCUMENT_COPY is a standard sd sales document copy SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Copy Sales Document to a Subsequent Document 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 sales document copy FM, simply by entering the name SD_SALES_DOCUMENT_COPY into the relevant SAP transaction such as SE37 or SE38.
Function Group: V45A
Program Name: SAPLV45A
Main Program: SAPLV45A
Appliation area: V
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function SD_SALES_DOCUMENT_COPY 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_SALES_DOCUMENT_COPY'"Copy Sales Document to a Subsequent Document.
EXPORTING
I_AUARN = "Order Type of Document to Be Created
I_VBELN = "Document number of document to be
* I_ITEMS_COPY = 'X' "Copy Items
* I_KEEP_LOCK_ENTRY = ' ' "
* IS_ENHANCEMENT = "IS Enhancement Structure - FM Import Parameter
IMPORTING
FVBAKKOM = "
ES_ENHANCEMENT = "IS Enhancement Structure - FM Export Parameter
CHANGING
* CS_ENHANCEMENT = "IS Enhancement Structure - FM Change Parameter
TABLES
* IX_VBAPKOMX_ORIG = "Checkbox List for Maintaining a Sales Document Item
EXCEPTIONS
ISM_INCOMPLETE = 1 ISM_GENERATION_ERROR = 2
IMPORTING Parameters details for SD_SALES_DOCUMENT_COPY
I_AUARN - Order Type of Document to Be Created
Data type: VBAK-AUARTOptional: No
Call by Reference: No ( called with pass by value option)
I_VBELN - Document number of document to be
Data type: VBAK-VBELNOptional: No
Call by Reference: No ( called with pass by value option)
I_ITEMS_COPY - Copy Items
Data type:Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_KEEP_LOCK_ENTRY -
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
IS_ENHANCEMENT - IS Enhancement Structure - FM Import Parameter
Data type: ISI_SD_SALES_DOCUMENT_COPYOptional: Yes
Call by Reference: Yes
EXPORTING Parameters details for SD_SALES_DOCUMENT_COPY
FVBAKKOM -
Data type: VBAKKOMOptional: No
Call by Reference: No ( called with pass by value option)
ES_ENHANCEMENT - IS Enhancement Structure - FM Export Parameter
Data type: ISX_SD_SALES_DOCUMENT_COPYOptional: No
Call by Reference: Yes
CHANGING Parameters details for SD_SALES_DOCUMENT_COPY
CS_ENHANCEMENT - IS Enhancement Structure - FM Change Parameter
Data type: ISC_SD_SALES_DOCUMENT_COPYOptional: Yes
Call by Reference: Yes
TABLES Parameters details for SD_SALES_DOCUMENT_COPY
IX_VBAPKOMX_ORIG - Checkbox List for Maintaining a Sales Document Item
Data type: VBAPKOMXOptional: Yes
Call by Reference: Yes
EXCEPTIONS details
ISM_INCOMPLETE -
Data type:Optional: No
Call by Reference: Yes
ISM_GENERATION_ERROR -
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for SD_SALES_DOCUMENT_COPY 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_auarn | TYPE VBAK-AUART, " | |||
| lv_fvbakkom | TYPE VBAKKOM, " | |||
| lv_cs_enhancement | TYPE ISC_SD_SALES_DOCUMENT_COPY, " | |||
| lv_ism_incomplete | TYPE ISC_SD_SALES_DOCUMENT_COPY, " | |||
| lt_ix_vbapkomx_orig | TYPE STANDARD TABLE OF VBAPKOMX, " | |||
| lv_i_vbeln | TYPE VBAK-VBELN, " | |||
| lv_es_enhancement | TYPE ISX_SD_SALES_DOCUMENT_COPY, " | |||
| lv_ism_generation_error | TYPE ISX_SD_SALES_DOCUMENT_COPY, " | |||
| lv_i_items_copy | TYPE ISX_SD_SALES_DOCUMENT_COPY, " 'X' | |||
| lv_i_keep_lock_entry | TYPE ISX_SD_SALES_DOCUMENT_COPY, " SPACE | |||
| lv_is_enhancement | TYPE ISI_SD_SALES_DOCUMENT_COPY. " |
|   CALL FUNCTION 'SD_SALES_DOCUMENT_COPY' "Copy Sales Document to a Subsequent Document |
| EXPORTING | ||
| I_AUARN | = lv_i_auarn | |
| I_VBELN | = lv_i_vbeln | |
| I_ITEMS_COPY | = lv_i_items_copy | |
| I_KEEP_LOCK_ENTRY | = lv_i_keep_lock_entry | |
| IS_ENHANCEMENT | = lv_is_enhancement | |
| IMPORTING | ||
| FVBAKKOM | = lv_fvbakkom | |
| ES_ENHANCEMENT | = lv_es_enhancement | |
| CHANGING | ||
| CS_ENHANCEMENT | = lv_cs_enhancement | |
| TABLES | ||
| IX_VBAPKOMX_ORIG | = lt_ix_vbapkomx_orig | |
| EXCEPTIONS | ||
| ISM_INCOMPLETE = 1 | ||
| ISM_GENERATION_ERROR = 2 | ||
| . " SD_SALES_DOCUMENT_COPY | ||
ABAP code using 7.40 inline data declarations to call FM SD_SALES_DOCUMENT_COPY
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 AUART FROM VBAK INTO @DATA(ld_i_auarn). | ||||
| "SELECT single VBELN FROM VBAK INTO @DATA(ld_i_vbeln). | ||||
| DATA(ld_i_items_copy) | = 'X'. | |||
| DATA(ld_i_keep_lock_entry) | = ' '. | |||
Search for further information about these or an SAP related objects