SAP SD_BONUS_SETTLEMENT Function Module for NOTRANSL: Abrechnung einer Bonusvereinbarung
SD_BONUS_SETTLEMENT is a standard sd bonus settlement SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for NOTRANSL: Abrechnung einer Bonusvereinbarung 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 bonus settlement FM, simply by entering the name SD_BONUS_SETTLEMENT into the relevant SAP transaction such as SE37 or SE38.
Function Group: V14A
Program Name: SAPLV14A
Main Program: SAPLV14A
Appliation area: V
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function SD_BONUS_SETTLEMENT 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_BONUS_SETTLEMENT'"NOTRANSL: Abrechnung einer Bonusvereinbarung.
EXPORTING
BONUS_AGREEMENT = "Work area for the rebate agreement to be settled
* BONUS_CONTROL = ' ' "
* BONUS_AGREEMENT_TYPE = ' ' "Work area for table T6B1
* BRING_DIALOG = 'X' "
* CREATE_CREDIT_NOTE = 'X' "Creating the credit memo
* SAVE_CREDIT_NOTE = 'X' "
* DO_PRE_SETTLEMENT_CHECKS = ' ' "
* PERIOD_DATAB = "
* PERIOD_DATBI = "
* NO_ERROR_IF_NEW_REBATE = ' ' "
TABLES
CONDITION = "Condition records table (KONP)
CONDITION_SCALE = "Table of scales for the condition records
SETTLEMENT_VALUES = "Table of values for bonus settlement
VARIABLE_KEY = "Tables of variable keys
EXCEPTIONS
CURRENCY_CONVERSION = 1 VBOX_NOT_ACTUAL = 10 NO_TURNOVER = 11 NO_SALES = 12 DIFFERENT_UOM = 2 ERROR_IN_ORDER_CREATION = 3 ERROR_MESSAGE = 4 INVALID_BONUS_TYPE = 5 NOT_READY_FOR_SETTLEMENT = 6 NO_ORDER_TYPE = 7 OPEN_DOCUMENTS_EXIST = 8 UNIT_CONVERSION = 9
IMPORTING Parameters details for SD_BONUS_SETTLEMENT
BONUS_AGREEMENT - Work area for the rebate agreement to be settled
Data type: KONAOptional: No
Call by Reference: No ( called with pass by value option)
BONUS_CONTROL -
Data type:Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
BONUS_AGREEMENT_TYPE - Work area for table T6B1
Data type: T6B1Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
BRING_DIALOG -
Data type:Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
CREATE_CREDIT_NOTE - Creating the credit memo
Data type:Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
SAVE_CREDIT_NOTE -
Data type:Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
DO_PRE_SETTLEMENT_CHECKS -
Data type:Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
PERIOD_DATAB -
Data type: KONA-DATABOptional: Yes
Call by Reference: No ( called with pass by value option)
PERIOD_DATBI -
Data type: KONA-DATBIOptional: Yes
Call by Reference: No ( called with pass by value option)
NO_ERROR_IF_NEW_REBATE -
Data type:Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for SD_BONUS_SETTLEMENT
CONDITION - Condition records table (KONP)
Data type: KONPOptional: No
Call by Reference: No ( called with pass by value option)
CONDITION_SCALE - Table of scales for the condition records
Data type: CONDSCALEOptional: No
Call by Reference: No ( called with pass by value option)
SETTLEMENT_VALUES - Table of values for bonus settlement
Data type: BONUSVALUEOptional: No
Call by Reference: No ( called with pass by value option)
VARIABLE_KEY - Tables of variable keys
Data type: VAKEOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
CURRENCY_CONVERSION - Error in currency translation
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
VBOX_NOT_ACTUAL - Billing index is not up-to-date
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_TURNOVER -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_SALES -
Data type:Optional: No
Call by Reference: Yes
DIFFERENT_UOM - Different Units of Measure
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ERROR_IN_ORDER_CREATION - Error in creation of the credit memo
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ERROR_MESSAGE - General error exit
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INVALID_BONUS_TYPE - Invalid rebate agreement type
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NOT_READY_FOR_SETTLEMENT - Status for final settlement not yet reached
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_ORDER_TYPE - No order type for final settlement in T6B1
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
OPEN_DOCUMENTS_EXIST -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
UNIT_CONVERSION - Error During Quantity Conversion
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for SD_BONUS_SETTLEMENT 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: | ||||
| lt_condition | TYPE STANDARD TABLE OF KONP, " | |||
| lv_bonus_agreement | TYPE KONA, " | |||
| lv_currency_conversion | TYPE KONA, " | |||
| lv_bonus_control | TYPE KONA, " ' ' | |||
| lv_vbox_not_actual | TYPE KONA, " | |||
| lv_no_turnover | TYPE KONA, " | |||
| lv_no_sales | TYPE KONA, " | |||
| lv_different_uom | TYPE KONA, " | |||
| lt_condition_scale | TYPE STANDARD TABLE OF CONDSCALE, " | |||
| lv_bonus_agreement_type | TYPE T6B1, " ' ' | |||
| lv_bring_dialog | TYPE T6B1, " 'X' | |||
| lt_settlement_values | TYPE STANDARD TABLE OF BONUSVALUE, " | |||
| lv_error_in_order_creation | TYPE BONUSVALUE, " | |||
| lt_variable_key | TYPE STANDARD TABLE OF VAKE, " | |||
| lv_error_message | TYPE VAKE, " | |||
| lv_create_credit_note | TYPE VAKE, " 'X' | |||
| lv_save_credit_note | TYPE VAKE, " 'X' | |||
| lv_invalid_bonus_type | TYPE VAKE, " | |||
| lv_do_pre_settlement_checks | TYPE VAKE, " ' ' | |||
| lv_not_ready_for_settlement | TYPE VAKE, " | |||
| lv_period_datab | TYPE KONA-DATAB, " | |||
| lv_no_order_type | TYPE KONA, " | |||
| lv_period_datbi | TYPE KONA-DATBI, " | |||
| lv_open_documents_exist | TYPE KONA, " | |||
| lv_unit_conversion | TYPE KONA, " | |||
| lv_no_error_if_new_rebate | TYPE KONA. " ' ' |
|   CALL FUNCTION 'SD_BONUS_SETTLEMENT' "NOTRANSL: Abrechnung einer Bonusvereinbarung |
| EXPORTING | ||
| BONUS_AGREEMENT | = lv_bonus_agreement | |
| BONUS_CONTROL | = lv_bonus_control | |
| BONUS_AGREEMENT_TYPE | = lv_bonus_agreement_type | |
| BRING_DIALOG | = lv_bring_dialog | |
| CREATE_CREDIT_NOTE | = lv_create_credit_note | |
| SAVE_CREDIT_NOTE | = lv_save_credit_note | |
| DO_PRE_SETTLEMENT_CHECKS | = lv_do_pre_settlement_checks | |
| PERIOD_DATAB | = lv_period_datab | |
| PERIOD_DATBI | = lv_period_datbi | |
| NO_ERROR_IF_NEW_REBATE | = lv_no_error_if_new_rebate | |
| TABLES | ||
| CONDITION | = lt_condition | |
| CONDITION_SCALE | = lt_condition_scale | |
| SETTLEMENT_VALUES | = lt_settlement_values | |
| VARIABLE_KEY | = lt_variable_key | |
| EXCEPTIONS | ||
| CURRENCY_CONVERSION = 1 | ||
| VBOX_NOT_ACTUAL = 10 | ||
| NO_TURNOVER = 11 | ||
| NO_SALES = 12 | ||
| DIFFERENT_UOM = 2 | ||
| ERROR_IN_ORDER_CREATION = 3 | ||
| ERROR_MESSAGE = 4 | ||
| INVALID_BONUS_TYPE = 5 | ||
| NOT_READY_FOR_SETTLEMENT = 6 | ||
| NO_ORDER_TYPE = 7 | ||
| OPEN_DOCUMENTS_EXIST = 8 | ||
| UNIT_CONVERSION = 9 | ||
| . " SD_BONUS_SETTLEMENT | ||
ABAP code using 7.40 inline data declarations to call FM SD_BONUS_SETTLEMENT
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.| DATA(ld_bonus_control) | = ' '. | |||
| DATA(ld_bonus_agreement_type) | = ' '. | |||
| DATA(ld_bring_dialog) | = 'X'. | |||
| DATA(ld_create_credit_note) | = 'X'. | |||
| DATA(ld_save_credit_note) | = 'X'. | |||
| DATA(ld_do_pre_settlement_checks) | = ' '. | |||
| "SELECT single DATAB FROM KONA INTO @DATA(ld_period_datab). | ||||
| "SELECT single DATBI FROM KONA INTO @DATA(ld_period_datbi). | ||||
| DATA(ld_no_error_if_new_rebate) | = ' '. | |||
Search for further information about these or an SAP related objects