SAP PROFITCENTER_CHANGE Function Module for Change Profit Center









PROFITCENTER_CHANGE is a standard profitcenter change SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Change Profit Center 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 profitcenter change FM, simply by entering the name PROFITCENTER_CHANGE into the relevant SAP transaction such as SE37 or SE38.

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



Function PROFITCENTER_CHANGE 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 'PROFITCENTER_CHANGE'"Change Profit Center
EXPORTING
PRCTR_DATA = "
* INSERT_MODE = ' ' "
* BAPI_LANGUAGE = ' ' "General Indicator
PRCTR_DATAX = "Controlling Area
* LANGUAGE = ' ' "
* TESTRUN = ' ' "Test Run
* HIER_CALLED = ' ' "
* NO_CCODES_CHECK = ' ' "
* DUMMY_ALLOWED = ' ' "
* INACTIVE_VERSION = ' ' "
* COMPLETE = ' ' "

IMPORTING
RETURN = "

TABLES
* COMPANYCODE_JOINT_VENTURE = "Table of Joint Venture Data/Company Codes
* COMPANYCODE_JOINT_VENTUREX = "
.



IMPORTING Parameters details for PROFITCENTER_CHANGE

PRCTR_DATA -

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

INSERT_MODE -

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

BAPI_LANGUAGE - General Indicator

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

PRCTR_DATAX - Controlling Area

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

LANGUAGE -

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

TESTRUN - Test Run

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

HIER_CALLED -

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

NO_CCODES_CHECK -

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

DUMMY_ALLOWED -

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

INACTIVE_VERSION -

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

COMPLETE -

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

EXPORTING Parameters details for PROFITCENTER_CHANGE

RETURN -

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

TABLES Parameters details for PROFITCENTER_CHANGE

COMPANYCODE_JOINT_VENTURE - Table of Joint Venture Data/Company Codes

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

COMPANYCODE_JOINT_VENTUREX -

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

Copy and paste ABAP code example for PROFITCENTER_CHANGE 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_return  TYPE BAPIRET2, "   
lv_prctr_data  TYPE PRCT1, "   
lt_companycode_joint_venture  TYPE STANDARD TABLE OF PRCT1_BUKRS, "   
lv_insert_mode  TYPE BOOLE_D, "   SPACE
lv_bapi_language  TYPE FLAG, "   SPACE
lv_prctr_datax  TYPE PRCT1X, "   
lt_companycode_joint_venturex  TYPE STANDARD TABLE OF PRCT1_BUKRSX, "   
lv_language  TYPE SY-LANGU, "   SPACE
lv_testrun  TYPE BAPI0015_9, "   SPACE
lv_hier_called  TYPE BOOLE_D, "   SPACE
lv_no_ccodes_check  TYPE BOOLE_D, "   SPACE
lv_dummy_allowed  TYPE BOOLE_D, "   SPACE
lv_inactive_version  TYPE BOOLE_D, "   SPACE
lv_complete  TYPE BOOLE_D. "   SPACE

  CALL FUNCTION 'PROFITCENTER_CHANGE'  "Change Profit Center
    EXPORTING
         PRCTR_DATA = lv_prctr_data
         INSERT_MODE = lv_insert_mode
         BAPI_LANGUAGE = lv_bapi_language
         PRCTR_DATAX = lv_prctr_datax
         LANGUAGE = lv_language
         TESTRUN = lv_testrun
         HIER_CALLED = lv_hier_called
         NO_CCODES_CHECK = lv_no_ccodes_check
         DUMMY_ALLOWED = lv_dummy_allowed
         INACTIVE_VERSION = lv_inactive_version
         COMPLETE = lv_complete
    IMPORTING
         RETURN = lv_return
    TABLES
         COMPANYCODE_JOINT_VENTURE = lt_companycode_joint_venture
         COMPANYCODE_JOINT_VENTUREX = lt_companycode_joint_venturex
. " PROFITCENTER_CHANGE




ABAP code using 7.40 inline data declarations to call FM PROFITCENTER_CHANGE

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_insert_mode) = ' '.
 
DATA(ld_bapi_language) = ' '.
 
 
 
"SELECT single LANGU FROM SY INTO @DATA(ld_language).
DATA(ld_language) = ' '.
 
DATA(ld_testrun) = ' '.
 
DATA(ld_hier_called) = ' '.
 
DATA(ld_no_ccodes_check) = ' '.
 
DATA(ld_dummy_allowed) = ' '.
 
DATA(ld_inactive_version) = ' '.
 
DATA(ld_complete) = ' '.
 


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!