SAP Function Modules

CMAC_FEE_DOC_INIT SAP Function module - Document Initialization







CMAC_FEE_DOC_INIT is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name CMAC_FEE_DOC_INIT into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: CMACFEE7
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM CMAC_FEE_DOC_INIT - CMAC FEE DOC INIT





CALL FUNCTION 'CMAC_FEE_DOC_INIT' "Document Initialization
  EXPORTING
    is_stinfo =                 " cmac_st       Student Information
    is_fee_ctrl =               " cmac_fee_control  Fee Calculation Control
  IMPORTING
    et_ficadoc =                " cmac_feefica_t
    et_calc_fees =              " cmac_t_fee_duedates  Fee with due dates
  TABLES
    it_auto_fee =               " cmac_t_fee_type  Fee Type Table for CM Student Acct.
    it_manl_fee =               " cmac_t_fee_type  Fee Type Table for CM Student Acct.
    et_header =                 " cmac_fkkko    Extended FI-CA document header
    et_bp_items =               " cmac_fkkop    Extended FI-CA document items - business partner
    et_gl_items =               " cmac_fkkopk   Extended FI-CA document items - G/L account
    et_cl_items =               " cmac_fkkcl    Extended FI-CA Document Items - Clearing Items
    ct_log_tab =                " piq_error_structure  Return parameter for error message.
* CHANGING
*   cv_index =                  " cmac_index_number  temp: Index number
  EXCEPTIONS
    FAIL_TO_CREATE_DATA = 1     "               fail to create document data
    .  "  CMAC_FEE_DOC_INIT

ABAP code example for Function Module CMAC_FEE_DOC_INIT





The ABAP code below is a full code listing to execute function module CMAC_FEE_DOC_INIT including all data declarations. The code uses 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 original method of declaring data variables up front. 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).

DATA:
ld_et_ficadoc  TYPE CMAC_FEEFICA_T ,
ld_et_calc_fees  TYPE CMAC_T_FEE_DUEDATES ,
it_it_auto_fee  TYPE STANDARD TABLE OF CMAC_T_FEE_TYPE,"TABLES PARAM
wa_it_auto_fee  LIKE LINE OF it_it_auto_fee ,
it_it_manl_fee  TYPE STANDARD TABLE OF CMAC_T_FEE_TYPE,"TABLES PARAM
wa_it_manl_fee  LIKE LINE OF it_it_manl_fee ,
it_et_header  TYPE STANDARD TABLE OF CMAC_FKKKO,"TABLES PARAM
wa_et_header  LIKE LINE OF it_et_header ,
it_et_bp_items  TYPE STANDARD TABLE OF CMAC_FKKOP,"TABLES PARAM
wa_et_bp_items  LIKE LINE OF it_et_bp_items ,
it_et_gl_items  TYPE STANDARD TABLE OF CMAC_FKKOPK,"TABLES PARAM
wa_et_gl_items  LIKE LINE OF it_et_gl_items ,
it_et_cl_items  TYPE STANDARD TABLE OF CMAC_FKKCL,"TABLES PARAM
wa_et_cl_items  LIKE LINE OF it_et_cl_items ,
it_ct_log_tab  TYPE STANDARD TABLE OF PIQ_ERROR_STRUCTURE,"TABLES PARAM
wa_ct_log_tab  LIKE LINE OF it_ct_log_tab .

DATA(ld_cv_index) = 'Check type of data required'.
DATA(ld_is_stinfo) = 'Check type of data required'.
DATA(ld_is_fee_ctrl) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_auto_fee to it_it_auto_fee.

"populate fields of struture and append to itab
append wa_it_manl_fee to it_it_manl_fee.

"populate fields of struture and append to itab
append wa_et_header to it_et_header.

"populate fields of struture and append to itab
append wa_et_bp_items to it_et_bp_items.

"populate fields of struture and append to itab
append wa_et_gl_items to it_et_gl_items.

"populate fields of struture and append to itab
append wa_et_cl_items to it_et_cl_items.

"populate fields of struture and append to itab
append wa_ct_log_tab to it_ct_log_tab. . CALL FUNCTION 'CMAC_FEE_DOC_INIT' EXPORTING is_stinfo = ld_is_stinfo is_fee_ctrl = ld_is_fee_ctrl IMPORTING et_ficadoc = ld_et_ficadoc et_calc_fees = ld_et_calc_fees TABLES it_auto_fee = it_it_auto_fee it_manl_fee = it_it_manl_fee et_header = it_et_header et_bp_items = it_et_bp_items et_gl_items = it_et_gl_items et_cl_items = it_et_cl_items ct_log_tab = it_ct_log_tab * CHANGING * cv_index = ld_cv_index EXCEPTIONS FAIL_TO_CREATE_DATA = 1 . " CMAC_FEE_DOC_INIT
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_cv_index  TYPE CMAC_INDEX_NUMBER ,
ld_et_ficadoc  TYPE CMAC_FEEFICA_T ,
ld_is_stinfo  TYPE CMAC_ST ,
it_it_auto_fee  TYPE STANDARD TABLE OF CMAC_T_FEE_TYPE ,
wa_it_auto_fee  LIKE LINE OF it_it_auto_fee,
ld_et_calc_fees  TYPE CMAC_T_FEE_DUEDATES ,
ld_is_fee_ctrl  TYPE CMAC_FEE_CONTROL ,
it_it_manl_fee  TYPE STANDARD TABLE OF CMAC_T_FEE_TYPE ,
wa_it_manl_fee  LIKE LINE OF it_it_manl_fee,
it_et_header  TYPE STANDARD TABLE OF CMAC_FKKKO ,
wa_et_header  LIKE LINE OF it_et_header,
it_et_bp_items  TYPE STANDARD TABLE OF CMAC_FKKOP ,
wa_et_bp_items  LIKE LINE OF it_et_bp_items,
it_et_gl_items  TYPE STANDARD TABLE OF CMAC_FKKOPK ,
wa_et_gl_items  LIKE LINE OF it_et_gl_items,
it_et_cl_items  TYPE STANDARD TABLE OF CMAC_FKKCL ,
wa_et_cl_items  LIKE LINE OF it_et_cl_items,
it_ct_log_tab  TYPE STANDARD TABLE OF PIQ_ERROR_STRUCTURE ,
wa_ct_log_tab  LIKE LINE OF it_ct_log_tab.

ld_cv_index = 'Check type of data required'.
ld_is_stinfo = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_auto_fee to it_it_auto_fee.
ld_is_fee_ctrl = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_it_manl_fee to it_it_manl_fee.

"populate fields of struture and append to itab
append wa_et_header to it_et_header.

"populate fields of struture and append to itab
append wa_et_bp_items to it_et_bp_items.

"populate fields of struture and append to itab
append wa_et_gl_items to it_et_gl_items.

"populate fields of struture and append to itab
append wa_et_cl_items to it_et_cl_items.

"populate fields of struture and append to itab
append wa_ct_log_tab to it_ct_log_tab.

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name CMAC_FEE_DOC_INIT or its description.