SAP K_TRANS_TABU_INSERT Function Module for









K_TRANS_TABU_INSERT is a standard k trans tabu insert 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 k trans tabu insert FM, simply by entering the name K_TRANS_TABU_INSERT into the relevant SAP transaction such as SE37 or SE38.

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



Function K_TRANS_TABU_INSERT 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 'K_TRANS_TABU_INSERT'"
EXPORTING
* KORRNR = ' ' "Correction number / If space -> query via popup
* O_KORRNR = ' ' "
* WITH_ENQUEUE = 'x' "Lock tables: X = yes, ' ' = no
* NO_MESSAGE = ' ' "No verification: X = yes, ' ' = no

TABLES
TABUKEY = "Object table for insertion into correction

EXCEPTIONS
CORRECTION_USED = 1 KORRNR_LOCKED = 2 NOT_OWN_CORRECTION = 3 NO_NUMBER = 4 SYSTEM_ERROR = 5 UNEXPECTED_ERROR_FCOMMAPP_KEYS = 6 ERROR_SUBSTITUTIONS = 7 ERROR_VALIDATIONS = 8
.



IMPORTING Parameters details for K_TRANS_TABU_INSERT

KORRNR - Correction number / If space -> query via popup

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

O_KORRNR -

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

WITH_ENQUEUE - Lock tables: X = yes, ' ' = no

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

NO_MESSAGE - No verification: X = yes, ' ' = no

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

TABLES Parameters details for K_TRANS_TABU_INSERT

TABUKEY - Object table for insertion into correction

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

EXCEPTIONS details

CORRECTION_USED - Correction is already edited

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

KORRNR_LOCKED - Correction is already edited

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

NOT_OWN_CORRECTION - Attempt to edit an external correction

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

NO_NUMBER - No number returned --> terminated

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

SYSTEM_ERROR - System error

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

UNEXPECTED_ERROR_FCOMMAPP_KEYS - Error in: & routine: & number: & &

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

ERROR_SUBSTITUTIONS -

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

ERROR_VALIDATIONS -

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

Copy and paste ABAP code example for K_TRANS_TABU_INSERT 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_korrnr  TYPE DKC02-KORRNR, "   SPACE
lt_tabukey  TYPE STANDARD TABLE OF KTRAKEY, "   
lv_correction_used  TYPE KTRAKEY, "   
lv_o_korrnr  TYPE DKC02-KORRNR, "   SPACE
lv_korrnr_locked  TYPE DKC02, "   
lv_with_enqueue  TYPE DKC02, "   'x'
lv_not_own_correction  TYPE DKC02, "   
lv_no_number  TYPE DKC02, "   
lv_no_message  TYPE DKC02-TSALL, "   SPACE
lv_system_error  TYPE DKC02, "   
lv_unexpected_error_fcommapp_keys  TYPE DKC02, "   
lv_error_substitutions  TYPE DKC02, "   
lv_error_validations  TYPE DKC02. "   

  CALL FUNCTION 'K_TRANS_TABU_INSERT'  "
    EXPORTING
         KORRNR = lv_korrnr
         O_KORRNR = lv_o_korrnr
         WITH_ENQUEUE = lv_with_enqueue
         NO_MESSAGE = lv_no_message
    TABLES
         TABUKEY = lt_tabukey
    EXCEPTIONS
        CORRECTION_USED = 1
        KORRNR_LOCKED = 2
        NOT_OWN_CORRECTION = 3
        NO_NUMBER = 4
        SYSTEM_ERROR = 5
        UNEXPECTED_ERROR_FCOMMAPP_KEYS = 6
        ERROR_SUBSTITUTIONS = 7
        ERROR_VALIDATIONS = 8
. " K_TRANS_TABU_INSERT




ABAP code using 7.40 inline data declarations to call FM K_TRANS_TABU_INSERT

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 KORRNR FROM DKC02 INTO @DATA(ld_korrnr).
DATA(ld_korrnr) = ' '.
 
 
 
"SELECT single KORRNR FROM DKC02 INTO @DATA(ld_o_korrnr).
DATA(ld_o_korrnr) = ' '.
 
 
DATA(ld_with_enqueue) = 'x'.
 
 
 
"SELECT single TSALL FROM DKC02 INTO @DATA(ld_no_message).
DATA(ld_no_message) = ' '.
 
 
 
 
 


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!