SAP COPA_GET_SETTLEMENT_STRUCTURE Function Module for
COPA_GET_SETTLEMENT_STRUCTURE is a standard copa get settlement structure SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, 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 copa get settlement structure FM, simply by entering the name COPA_GET_SETTLEMENT_STRUCTURE into the relevant SAP transaction such as SE37 or SE38.
Function Group: KEII
Program Name: SAPLKEII
Main Program: SAPLKEII
Appliation area: K
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function COPA_GET_SETTLEMENT_STRUCTURE 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 'COPA_GET_SETTLEMENT_STRUCTURE'".
EXPORTING
I_ERKRS = "
I_VRGNG = "
I_HKONT = "
I_KOKRS = "
* I_ERSCH = "
IMPORTING
E_ERSCH = "
E_ERZUO = "
TABLES
* T_TKB9F = "
EXCEPTIONS
INCOMPLETE_STRUCTURE = 1 ERROR_STRUCTURE = 2
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_SAPLKEII_001 User Exit for Processing AC-Document: Line Item Structure
EXIT_SAPLKEII_002 User Exit for Processing AC Document: Generated Line Items
IMPORTING Parameters details for COPA_GET_SETTLEMENT_STRUCTURE
I_ERKRS -
Data type: TKEBB-ERKRSOptional: No
Call by Reference: No ( called with pass by value option)
I_VRGNG -
Data type: TKEVG-VRGNGOptional: No
Call by Reference: No ( called with pass by value option)
I_HKONT -
Data type: BSEG-HKONTOptional: No
Call by Reference: No ( called with pass by value option)
I_KOKRS -
Data type: TKA00-KOKRSOptional: No
Call by Reference: No ( called with pass by value option)
I_ERSCH -
Data type: TKEVG-ERSCHOptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for COPA_GET_SETTLEMENT_STRUCTURE
E_ERSCH -
Data type: TKEVG-ERSCHOptional: No
Call by Reference: No ( called with pass by value option)
E_ERZUO -
Data type: TKB9C-ERZUOOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for COPA_GET_SETTLEMENT_STRUCTURE
T_TKB9F -
Data type: TKB9FOptional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
INCOMPLETE_STRUCTURE -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ERROR_STRUCTURE -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for COPA_GET_SETTLEMENT_STRUCTURE 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_e_ersch | TYPE TKEVG-ERSCH, " | |||
| lv_i_erkrs | TYPE TKEBB-ERKRS, " | |||
| lt_t_tkb9f | TYPE STANDARD TABLE OF TKB9F, " | |||
| lv_incomplete_structure | TYPE TKB9F, " | |||
| lv_e_erzuo | TYPE TKB9C-ERZUO, " | |||
| lv_i_vrgng | TYPE TKEVG-VRGNG, " | |||
| lv_error_structure | TYPE TKEVG, " | |||
| lv_i_hkont | TYPE BSEG-HKONT, " | |||
| lv_i_kokrs | TYPE TKA00-KOKRS, " | |||
| lv_i_ersch | TYPE TKEVG-ERSCH. " |
|   CALL FUNCTION 'COPA_GET_SETTLEMENT_STRUCTURE' " |
| EXPORTING | ||
| I_ERKRS | = lv_i_erkrs | |
| I_VRGNG | = lv_i_vrgng | |
| I_HKONT | = lv_i_hkont | |
| I_KOKRS | = lv_i_kokrs | |
| I_ERSCH | = lv_i_ersch | |
| IMPORTING | ||
| E_ERSCH | = lv_e_ersch | |
| E_ERZUO | = lv_e_erzuo | |
| TABLES | ||
| T_TKB9F | = lt_t_tkb9f | |
| EXCEPTIONS | ||
| INCOMPLETE_STRUCTURE = 1 | ||
| ERROR_STRUCTURE = 2 | ||
| . " COPA_GET_SETTLEMENT_STRUCTURE | ||
ABAP code using 7.40 inline data declarations to call FM COPA_GET_SETTLEMENT_STRUCTURE
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 ERSCH FROM TKEVG INTO @DATA(ld_e_ersch). | ||||
| "SELECT single ERKRS FROM TKEBB INTO @DATA(ld_i_erkrs). | ||||
| "SELECT single ERZUO FROM TKB9C INTO @DATA(ld_e_erzuo). | ||||
| "SELECT single VRGNG FROM TKEVG INTO @DATA(ld_i_vrgng). | ||||
| "SELECT single HKONT FROM BSEG INTO @DATA(ld_i_hkont). | ||||
| "SELECT single KOKRS FROM TKA00 INTO @DATA(ld_i_kokrs). | ||||
| "SELECT single ERSCH FROM TKEVG INTO @DATA(ld_i_ersch). | ||||
Search for further information about these or an SAP related objects