SAP K_ACCOUNT_ASSIGNMENT_GET Function Module for









K_ACCOUNT_ASSIGNMENT_GET is a standard k account assignment get 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 account assignment get FM, simply by entering the name K_ACCOUNT_ASSIGNMENT_GET into the relevant SAP transaction such as SE37 or SE38.

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



Function K_ACCOUNT_ASSIGNMENT_GET 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_ACCOUNT_ASSIGNMENT_GET'"
EXPORTING
BUKRS = "Company code
* BWKEY = ' ' "Valuation area, if known
* GSBER = ' ' "Business area, if known
* I_PRCTR = ' ' "
KSTAR = "Cost element
* WERKS = ' ' "Plant, if known
* I_COBL = "

IMPORTING
AUFNR = "Default account assignment: order
KOSTL = "Default account assignment: cost c
PRCTR = "Default account assignment: profit center
E_PAOBJNR = "
E_REGEL = "
E_XGSBER = "
.



IMPORTING Parameters details for K_ACCOUNT_ASSIGNMENT_GET

BUKRS - Company code

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

BWKEY - Valuation area, if known

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

GSBER - Business area, if known

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

I_PRCTR -

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

KSTAR - Cost element

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

WERKS - Plant, if known

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

I_COBL -

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

EXPORTING Parameters details for K_ACCOUNT_ASSIGNMENT_GET

AUFNR - Default account assignment: order

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

KOSTL - Default account assignment: cost c

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

PRCTR - Default account assignment: profit center

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

E_PAOBJNR -

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

E_REGEL -

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

E_XGSBER -

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

Copy and paste ABAP code example for K_ACCOUNT_ASSIGNMENT_GET 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_aufnr  TYPE COAS-AUFNR, "   
lv_bukrs  TYPE T001-BUKRS, "   
lv_bwkey  TYPE T001W-BWKEY, "   SPACE
lv_kostl  TYPE CSKS-KOSTL, "   
lv_gsber  TYPE TGSB-GSBER, "   SPACE
lv_prctr  TYPE CSKS-PRCTR, "   
lv_i_prctr  TYPE COBL-PRCTR, "   SPACE
lv_e_paobjnr  TYPE COBL-PAOBJNR, "   
lv_kstar  TYPE CSKA-KSTAR, "   
lv_e_regel  TYPE TKA3A-REGEL, "   
lv_werks  TYPE T001W-WERKS, "   SPACE
lv_e_xgsber  TYPE TKA3A-XGSBER, "   
lv_i_cobl  TYPE COBL. "   

  CALL FUNCTION 'K_ACCOUNT_ASSIGNMENT_GET'  "
    EXPORTING
         BUKRS = lv_bukrs
         BWKEY = lv_bwkey
         GSBER = lv_gsber
         I_PRCTR = lv_i_prctr
         KSTAR = lv_kstar
         WERKS = lv_werks
         I_COBL = lv_i_cobl
    IMPORTING
         AUFNR = lv_aufnr
         KOSTL = lv_kostl
         PRCTR = lv_prctr
         E_PAOBJNR = lv_e_paobjnr
         E_REGEL = lv_e_regel
         E_XGSBER = lv_e_xgsber
. " K_ACCOUNT_ASSIGNMENT_GET




ABAP code using 7.40 inline data declarations to call FM K_ACCOUNT_ASSIGNMENT_GET

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 AUFNR FROM COAS INTO @DATA(ld_aufnr).
 
"SELECT single BUKRS FROM T001 INTO @DATA(ld_bukrs).
 
"SELECT single BWKEY FROM T001W INTO @DATA(ld_bwkey).
DATA(ld_bwkey) = ' '.
 
"SELECT single KOSTL FROM CSKS INTO @DATA(ld_kostl).
 
"SELECT single GSBER FROM TGSB INTO @DATA(ld_gsber).
DATA(ld_gsber) = ' '.
 
"SELECT single PRCTR FROM CSKS INTO @DATA(ld_prctr).
 
"SELECT single PRCTR FROM COBL INTO @DATA(ld_i_prctr).
DATA(ld_i_prctr) = ' '.
 
"SELECT single PAOBJNR FROM COBL INTO @DATA(ld_e_paobjnr).
 
"SELECT single KSTAR FROM CSKA INTO @DATA(ld_kstar).
 
"SELECT single REGEL FROM TKA3A INTO @DATA(ld_e_regel).
 
"SELECT single WERKS FROM T001W INTO @DATA(ld_werks).
DATA(ld_werks) = ' '.
 
"SELECT single XGSBER FROM TKA3A INTO @DATA(ld_e_xgsber).
 
 


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!