SAP COPA_PROFITABILITY_SEGMENT Function Module for









COPA_PROFITABILITY_SEGMENT is a standard copa profitability segment 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 copa profitability segment FM, simply by entering the name COPA_PROFITABILITY_SEGMENT into the relevant SAP transaction such as SE37 or SE38.

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



Function COPA_PROFITABILITY_SEGMENT 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 'COPA_PROFITABILITY_SEGMENT'"
EXPORTING
* ANZEIGE = ' ' "
* I_VBAP = "
* I_VBKD = "
* I_PRPS = "
* I_VIAUFKST = "
* PRUEFEN = ' ' "
* I_ERKRS = ' ' "
* I_MODE = ' ' "
* IS_GLOBAL_FIELDS = "
* I_UPDATE = 'X' "
* NO_DUMP = ' ' "
* DIALOG = 'X' "
* SPARSE = ' ' "
* IGNORE = ' ' "
I_COBL = "
* I_COBL_REF = "
* I_KOMK = "
* I_KOMP = "
* I_VBAK = "

IMPORTING
E_COBL = "
E_DELKEY = "

TABLES
* T_COPADATA = "

EXCEPTIONS
ABNORMAL_LEAVE = 1 BTRANS_NOT_RELEVANT = 2 ERROR_COPA = 3
.




Customer Function user exits

Below is a list of CUSTOMER FUNCTION exit user exits that are available within this program and maybe relevant for this FM.
EXIT_SAPLKEAK_001 User Exit for Determining the Characteristic Group

IMPORTING Parameters details for COPA_PROFITABILITY_SEGMENT

ANZEIGE -

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

I_VBAP -

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

I_VBKD -

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

I_PRPS -

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

I_VIAUFKST -

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

PRUEFEN -

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

I_ERKRS -

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

I_MODE -

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

IS_GLOBAL_FIELDS -

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

I_UPDATE -

Data type:
Default: 'X'
Optional: Yes
Call by Reference: Yes

NO_DUMP -

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

DIALOG -

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

SPARSE -

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

IGNORE -

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

I_COBL -

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

I_COBL_REF -

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

I_KOMK -

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

I_KOMP -

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

I_VBAK -

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

EXPORTING Parameters details for COPA_PROFITABILITY_SEGMENT

E_COBL -

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

E_DELKEY -

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

TABLES Parameters details for COPA_PROFITABILITY_SEGMENT

T_COPADATA -

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

EXCEPTIONS details

ABNORMAL_LEAVE -

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

BTRANS_NOT_RELEVANT -

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

ERROR_COPA -

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

Copy and paste ABAP code example for COPA_PROFITABILITY_SEGMENT 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_e_cobl  TYPE COBL, "   
lv_anzeige  TYPE COBL, "   SPACE
lt_t_copadata  TYPE STANDARD TABLE OF COPADATA, "   
lv_abnormal_leave  TYPE COPADATA, "   
lv_i_vbap  TYPE VBAP, "   
lv_i_vbkd  TYPE VBKD, "   
lv_i_prps  TYPE PRPS, "   
lv_i_viaufkst  TYPE VIAUFKST, "   
lv_pruefen  TYPE VIAUFKST, "   ' '
lv_i_erkrs  TYPE TKEB-ERKRS, "   ' '
lv_i_mode  TYPE TKEB, "   ' '
lv_is_global_fields  TYPE KEAK_YS_POPUP_GLOBAL, "   
lv_i_update  TYPE KEAK_YS_POPUP_GLOBAL, "   'X'
lv_no_dump  TYPE KEAK_YS_POPUP_GLOBAL, "   ' '
lv_dialog  TYPE KEAK_YS_POPUP_GLOBAL, "   'X'
lv_e_delkey  TYPE I, "   
lv_btrans_not_relevant  TYPE I, "   
lv_sparse  TYPE I, "   ' '
lv_error_copa  TYPE I, "   
lv_ignore  TYPE I, "   ' '
lv_i_cobl  TYPE COBL, "   
lv_i_cobl_ref  TYPE COBL, "   
lv_i_komk  TYPE KOMK, "   
lv_i_komp  TYPE KOMP, "   
lv_i_vbak  TYPE VBAK. "   

  CALL FUNCTION 'COPA_PROFITABILITY_SEGMENT'  "
    EXPORTING
         ANZEIGE = lv_anzeige
         I_VBAP = lv_i_vbap
         I_VBKD = lv_i_vbkd
         I_PRPS = lv_i_prps
         I_VIAUFKST = lv_i_viaufkst
         PRUEFEN = lv_pruefen
         I_ERKRS = lv_i_erkrs
         I_MODE = lv_i_mode
         IS_GLOBAL_FIELDS = lv_is_global_fields
         I_UPDATE = lv_i_update
         NO_DUMP = lv_no_dump
         DIALOG = lv_dialog
         SPARSE = lv_sparse
         IGNORE = lv_ignore
         I_COBL = lv_i_cobl
         I_COBL_REF = lv_i_cobl_ref
         I_KOMK = lv_i_komk
         I_KOMP = lv_i_komp
         I_VBAK = lv_i_vbak
    IMPORTING
         E_COBL = lv_e_cobl
         E_DELKEY = lv_e_delkey
    TABLES
         T_COPADATA = lt_t_copadata
    EXCEPTIONS
        ABNORMAL_LEAVE = 1
        BTRANS_NOT_RELEVANT = 2
        ERROR_COPA = 3
. " COPA_PROFITABILITY_SEGMENT




ABAP code using 7.40 inline data declarations to call FM COPA_PROFITABILITY_SEGMENT

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_anzeige) = ' '.
 
 
 
 
 
 
 
DATA(ld_pruefen) = ' '.
 
"SELECT single ERKRS FROM TKEB INTO @DATA(ld_i_erkrs).
DATA(ld_i_erkrs) = ' '.
 
DATA(ld_i_mode) = ' '.
 
 
DATA(ld_i_update) = 'X'.
 
DATA(ld_no_dump) = ' '.
 
DATA(ld_dialog) = 'X'.
 
 
 
DATA(ld_sparse) = ' '.
 
 
DATA(ld_ignore) = ' '.
 
 
 
 
 
 


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!