SAP NATRAB_SELECTION Function Module for NOTRANSL: Naturalrabattermittlung









NATRAB_SELECTION is a standard natrab selection 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: Naturalrabattermittlung 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 natrab selection FM, simply by entering the name NATRAB_SELECTION into the relevant SAP transaction such as SE37 or SE38.

Function Group: V61N
Program Name: SAPLV61N
Main Program: SAPLV61N
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function NATRAB_SELECTION 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 'NATRAB_SELECTION'"NOTRANSL: Naturalrabattermittlung
EXPORTING
APPLICATION = "Application
DATE = "DE-EN-LANG-SWITCH-NO-TRANSLATION
* DIALOG = 'X' "DE-EN-LANG-SWITCH-NO-TRANSLATION
HEADER_COMMUNICATION = "DE-EN-LANG-SWITCH-NO-TRANSLATION
ITEM_COMMUNICATION = "DE-EN-LANG-SWITCH-NO-TRANSLATION
SCHEME = "DE-EN-LANG-SWITCH-NO-TRANSLATION
* PROTOCOL = ' ' "DE-EN-LANG-SWITCH-NO-TRANSLATION
* ONLY_ONE_RECORD = 'X' "DE-EN-LANG-SWITCH-NO-TRANSLATION

IMPORTING
PROTOCOL_HEADER = "SD Monitor: Log Header Data

TABLES
* KONDN_DATA = "DE-EN-LANG-SWITCH-NO-TRANSLATION
* KONDNS_DATA = "DE-EN-LANG-SWITCH-NO-TRANSLATION
* KONDN_MAT_DATA = "DE-EN-LANG-SWITCH-NO-TRANSLATION

EXCEPTIONS
MINIMUM_QUANTITY_NOT_REACHED = 1 REBATE_IN_KIND_NOT_FOUND = 2 MATERIAL_UNIT_NOT_FOUND = 3 CALCULATION_TYPE_RESULTS_ZERO = 4 ADD_MATERIAL_UNIT_NOT_FOUND = 5
.



IMPORTING Parameters details for NATRAB_SELECTION

APPLICATION - Application

Data type: T683-KAPPL
Optional: No
Call by Reference: No ( called with pass by value option)

DATE - DE-EN-LANG-SWITCH-NO-TRANSLATION

Data type: SY-DATUM
Optional: No
Call by Reference: No ( called with pass by value option)

DIALOG - DE-EN-LANG-SWITCH-NO-TRANSLATION

Data type:
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

HEADER_COMMUNICATION - DE-EN-LANG-SWITCH-NO-TRANSLATION

Data type: KOMK
Optional: No
Call by Reference: Yes

ITEM_COMMUNICATION - DE-EN-LANG-SWITCH-NO-TRANSLATION

Data type: KOMP
Optional: No
Call by Reference: Yes

SCHEME - DE-EN-LANG-SWITCH-NO-TRANSLATION

Data type: T683-KALSM
Optional: No
Call by Reference: No ( called with pass by value option)

PROTOCOL - DE-EN-LANG-SWITCH-NO-TRANSLATION

Data type:
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

ONLY_ONE_RECORD - DE-EN-LANG-SWITCH-NO-TRANSLATION

Data type:
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for NATRAB_SELECTION

PROTOCOL_HEADER - SD Monitor: Log Header Data

Data type: SDPROTHEAD
Optional: No
Call by Reference: Yes

TABLES Parameters details for NATRAB_SELECTION

KONDN_DATA - DE-EN-LANG-SWITCH-NO-TRANSLATION

Data type: KONDN
Optional: Yes
Call by Reference: No ( called with pass by value option)

KONDNS_DATA - DE-EN-LANG-SWITCH-NO-TRANSLATION

Data type: KONDNS
Optional: Yes
Call by Reference: No ( called with pass by value option)

KONDN_MAT_DATA - DE-EN-LANG-SWITCH-NO-TRANSLATION

Data type: KONDN_MAT
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

MINIMUM_QUANTITY_NOT_REACHED -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

REBATE_IN_KIND_NOT_FOUND -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

MATERIAL_UNIT_NOT_FOUND -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

CALCULATION_TYPE_RESULTS_ZERO -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

ADD_MATERIAL_UNIT_NOT_FOUND -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for NATRAB_SELECTION 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_kondn_data  TYPE STANDARD TABLE OF KONDN, "   
lv_application  TYPE T683-KAPPL, "   
lv_protocol_header  TYPE SDPROTHEAD, "   
lv_minimum_quantity_not_reached  TYPE SDPROTHEAD, "   
lv_date  TYPE SY-DATUM, "   
lt_kondns_data  TYPE STANDARD TABLE OF KONDNS, "   
lv_rebate_in_kind_not_found  TYPE KONDNS, "   
lv_dialog  TYPE KONDNS, "   'X'
lt_kondn_mat_data  TYPE STANDARD TABLE OF KONDN_MAT, "   
lv_material_unit_not_found  TYPE KONDN_MAT, "   
lv_header_communication  TYPE KOMK, "   
lv_calculation_type_results_zero  TYPE KOMK, "   
lv_item_communication  TYPE KOMP, "   
lv_add_material_unit_not_found  TYPE KOMP, "   
lv_scheme  TYPE T683-KALSM, "   
lv_protocol  TYPE T683, "   SPACE
lv_only_one_record  TYPE T683. "   'X'

  CALL FUNCTION 'NATRAB_SELECTION'  "NOTRANSL: Naturalrabattermittlung
    EXPORTING
         APPLICATION = lv_application
         DATE = lv_date
         DIALOG = lv_dialog
         HEADER_COMMUNICATION = lv_header_communication
         ITEM_COMMUNICATION = lv_item_communication
         SCHEME = lv_scheme
         PROTOCOL = lv_protocol
         ONLY_ONE_RECORD = lv_only_one_record
    IMPORTING
         PROTOCOL_HEADER = lv_protocol_header
    TABLES
         KONDN_DATA = lt_kondn_data
         KONDNS_DATA = lt_kondns_data
         KONDN_MAT_DATA = lt_kondn_mat_data
    EXCEPTIONS
        MINIMUM_QUANTITY_NOT_REACHED = 1
        REBATE_IN_KIND_NOT_FOUND = 2
        MATERIAL_UNIT_NOT_FOUND = 3
        CALCULATION_TYPE_RESULTS_ZERO = 4
        ADD_MATERIAL_UNIT_NOT_FOUND = 5
. " NATRAB_SELECTION




ABAP code using 7.40 inline data declarations to call FM NATRAB_SELECTION

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 KAPPL FROM T683 INTO @DATA(ld_application).
 
 
 
"SELECT single DATUM FROM SY INTO @DATA(ld_date).
 
 
 
DATA(ld_dialog) = 'X'.
 
 
 
 
 
 
 
"SELECT single KALSM FROM T683 INTO @DATA(ld_scheme).
 
DATA(ld_protocol) = ' '.
 
DATA(ld_only_one_record) = 'X'.
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!