SAP COST_ALLOCATION_GENERATE Function Module for









COST_ALLOCATION_GENERATE is a standard cost allocation generate 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 cost allocation generate FM, simply by entering the name COST_ALLOCATION_GENERATE into the relevant SAP transaction such as SE37 or SE38.

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



Function COST_ALLOCATION_GENERATE 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 'COST_ALLOCATION_GENERATE'"
EXPORTING
IP_FIKRS = "
* IP_FLG_DELETE = ' ' "
IP_RLDNR = "
IP_RVERS_RECEIVER = "
IP_RVERS_SENDER_FROM = "
IP_RVERS_SENDER_TO = "
IP_RYEAR = "

TABLES
T_DISTRIBUTION = "
* T_CYCLE = "

EXCEPTIONS
ERROR = 1
.



IMPORTING Parameters details for COST_ALLOCATION_GENERATE

IP_FIKRS -

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

IP_FLG_DELETE -

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

IP_RLDNR -

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

IP_RVERS_RECEIVER -

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

IP_RVERS_SENDER_FROM -

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

IP_RVERS_SENDER_TO -

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

IP_RYEAR -

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

TABLES Parameters details for COST_ALLOCATION_GENERATE

T_DISTRIBUTION -

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

T_CYCLE -

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

EXCEPTIONS details

ERROR -

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

Copy and paste ABAP code example for COST_ALLOCATION_GENERATE 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_error  TYPE STRING, "   
lv_ip_fikrs  TYPE FM01-FIKRS, "   
lt_t_distribution  TYPE STANDARD TABLE OF FMSN_T_DISTRIBUTION, "   
lt_t_cycle  TYPE STANDARD TABLE OF FMSN_T_CYCLE, "   
lv_ip_flg_delete  TYPE FMSN_T_CYCLE, "   ' '
lv_ip_rldnr  TYPE FMIT-RLDNR, "   
lv_ip_rvers_receiver  TYPE FMIT-RVERS, "   
lv_ip_rvers_sender_from  TYPE FMIT-RVERS, "   
lv_ip_rvers_sender_to  TYPE FMIT-RVERS, "   
lv_ip_ryear  TYPE FMIT-RYEAR. "   

  CALL FUNCTION 'COST_ALLOCATION_GENERATE'  "
    EXPORTING
         IP_FIKRS = lv_ip_fikrs
         IP_FLG_DELETE = lv_ip_flg_delete
         IP_RLDNR = lv_ip_rldnr
         IP_RVERS_RECEIVER = lv_ip_rvers_receiver
         IP_RVERS_SENDER_FROM = lv_ip_rvers_sender_from
         IP_RVERS_SENDER_TO = lv_ip_rvers_sender_to
         IP_RYEAR = lv_ip_ryear
    TABLES
         T_DISTRIBUTION = lt_t_distribution
         T_CYCLE = lt_t_cycle
    EXCEPTIONS
        ERROR = 1
. " COST_ALLOCATION_GENERATE




ABAP code using 7.40 inline data declarations to call FM COST_ALLOCATION_GENERATE

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 FIKRS FROM FM01 INTO @DATA(ld_ip_fikrs).
 
 
 
DATA(ld_ip_flg_delete) = ' '.
 
"SELECT single RLDNR FROM FMIT INTO @DATA(ld_ip_rldnr).
 
"SELECT single RVERS FROM FMIT INTO @DATA(ld_ip_rvers_receiver).
 
"SELECT single RVERS FROM FMIT INTO @DATA(ld_ip_rvers_sender_from).
 
"SELECT single RVERS FROM FMIT INTO @DATA(ld_ip_rvers_sender_to).
 
"SELECT single RYEAR FROM FMIT INTO @DATA(ld_ip_ryear).
 


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!