SAP Reports / Programs

FAGL_MIG_AFA_POST SAP ABAP Report - Transfer All Deprec. Docs After Migration with New Acct Determination







FAGL_MIG_AFA_POST is a standard Executable ABAP Report available within your SAP system (depending on your version and release level). It is used for You use this program when switching from the account approach to the ledger approach...see full standard documentation available for this report. Also check out the submitted Comments related to this SAP report and the details below to see which OBJECTS it interacts with such as TABLES, FUNCTION MODULES, INCLUDES ETC.

If you would like to execute this report or see the full code listing simply enter FAGL_MIG_AFA_POST into the relevant SAP transactions such as SE38 or SE80


ABAP code to call this SAP report using the submit statement

This report can be called from another progam/report simply by using the ABAP SUBMIT statement, see below for example ABAP code snipts of how to do this.






SUBMIT FAGL_MIG_AFA_POST. "Basic submit
SUBMIT FAGL_MIG_AFA_POST AND RETURN. "Return to original report after report execution complete
SUBMIT FAGL_MIG_AFA_POST VIA SELECTION-SCREEN. "Display selection screen of submitted report to user
    See more syntax options for the ABAP SUBMIT statement


Text pool values


Selection Text: P_PRODUC = Update Run
Selection Text: P_TEST = Test Run
Selection Text: P_BUKRS = D .
Selection Text: P_KTOPL = D .
Selection Text: P_MGPLN = D .
Selection Text: S_AFABE = D .
Title: Transfer All Deprec. Docs After Migration with New Acct Determination
Text Symbol: 002 = Migration Plan
Text Symbol: 003 = Chrt/Accts
Text Symbol: 004 = Other Selections
Text Symbol: 006 = User
Text Symbol: 007 = Date/Time
Text Symbol: 008 = Processing Options
Text Symbol: 009 = List of Documents to Be Reversed During the Migration
Text Symbol: 011 = List of Old and New G/L Accounts


INCLUDES used within this REPORT FAGL_MIG_AFA_POST

INCLUDE FAGL_MIG_AFA_POST_DATADEF.
INCLUDE FAGL_MIG_MONI_SM_PARAMS. "COCKPIT
INCLUDE FAGL_MIG_AFA_POST_LOG.
INCLUDE FAGL_MIG_CONSTANTS. "COCKPIT
INCLUDE FAGL_MIG_AFA_POST_ALV.


TABLES used within REPORT and the associated SELECT statement:





No SAP DATABASE tables are accessed within this REPORT code!


Function Modules used within report and the associated call statement:

MESSAGES_INITIALIZE CALL FUNCTION 'MESSAGES_INITIALIZE' EXPORTING reset = 'X' i_identification = gd_message_ident IMPORTING e_identification = gd_message_ident.

FAGL_MIG_GET_ALL_MGPLN_DATA_EX CALL FUNCTION 'FAGL_MIG_GET_ALL_MGPLN_DATA_EX' EXPORTING it_mgpln = lt_all_mgpln IMPORTING et_mgpln_data_ext = lt_mig_mgpln_ext EXCEPTIONS internal_error = 1 no_data_found = 2 OTHERS = 3.

T093C_READ CALL FUNCTION 'T093C_READ' EXPORTING i_bukrs = l_bukrs * F_T093C = * I_PBO_CHECK = ' ' IMPORTING f_t093c = l_t093c EXCEPTIONS not_found = 1 OTHERS = 2.

FAGL_GET_BKPF_SEL CALL FUNCTION 'FAGL_GET_BKPF_SEL' EXPORTING it_selection = lt_selection IMPORTING et_bkpf = gt_bkpf EXCEPTIONS not_found = 1 OTHERS = 2.

FAGL_ACT_MGPLN_FOR_BUKRS_EXIST CALL FUNCTION 'FAGL_ACT_MGPLN_FOR_BUKRS_EXIST' EXPORTING id_bukrs = p_bukrs IMPORTING ed_active_mgpln_exist = lv_mgpln_exist EXCEPTIONS OTHERS = 0.

FAGL_GET_BUKRS_LEDGER_IN_MGPLN CALL FUNCTION 'FAGL_GET_BUKRS_LEDGER_IN_MGPLN' EXPORTING i_mgpln = p_mgpln IMPORTING et_bukrs = gt_bukrs EXCEPTIONS invalid_input = 1 no_data_found = 2 OTHERS = 3.

FI_PERIOD_DETERMINE CALL FUNCTION 'FI_PERIOD_DETERMINE' EXPORTING i_budat = ls_mig_mgpln_ext-migdt i_bukrs = gv_bukrs IMPORTING e_gjahr = lv_gjahr EXCEPTIONS fiscal_year = 1 period = 2 period_version = 3 posting_period = 4 special_period = 5 version = 6 posting_date = 7 OTHERS = 8.

FI_DOCUMENT_READ CALL FUNCTION 'FI_DOCUMENT_READ' EXPORTING i_awtyp = i_bkpf-awtyp * i_awref = lv_awref i_awsys = i_bkpf-awsys i_bukrs = i_bkpf-bukrs i_belnr = i_bkpf-belnr i_gjahr = i_bkpf-gjahr i_bstat = i_bkpf-bstat i_xblnr = i_bkpf-xblnr i_budat = i_bkpf-budat i_blart = i_bkpf-blart TABLES t_acchd = gt_acchd t_accit = gt_accit t_acccr = gt_acccr t_bseg = gt_bseg EXCEPTIONS wrong_input = 1 not_found = 2 OTHERS = 3 .

T001_READ CALL FUNCTION 'T001_READ' EXPORTING bukrs = i_bukrs IMPORTING struct = ls_t001 EXCEPTIONS no_entry = 1 OTHERS = 2.

OWN_LOGICAL_SYSTEM_GET CALL FUNCTION 'OWN_LOGICAL_SYSTEM_GET' IMPORTING own_logical_system = ld_awsys EXCEPTIONS own_logical_system_not_defined = 0 OTHERS = 2.

AC_DOCUMENT_REVERSE CALL FUNCTION 'AC_DOCUMENT_REVERSE' EXPORTING i_accrev = l_accrev * I_COMP = EXCEPTIONS reverse_impossible = 1 OTHERS = 2 .

AC_DOCUMENT_POST CALL FUNCTION 'AC_DOCUMENT_POST' EXPORTING i_awtyp = l_accrev-awtyp i_awref = l_accrev-awref i_aworg = l_accrev-aworg i_awsys = l_accrev-awsys * I_COMP = ' ' .

READ_SKB1 CALL FUNCTION 'READ_SKB1' EXPORTING xbukrs = i_bkpf-bukrs xsaknr = ls_accit-hkont IMPORTING XSKB1 = ls_skb1 EXCEPTIONS KEY_INCOMPLETE = 1 NOT_AUTHORIZED = 2 NOT_FOUND = 3 OTHERS = 4.

FI_GET_POSTING_KEY CALL FUNCTION 'FI_GET_POSTING_KEY' EXPORTING i_ktosl = 'ANL' IMPORTING E_BSCHS = lv_bschs E_BSCHH = lv_bschh EXCEPTIONS MISSING_POSTING_KEYS = 1 OTHERS = 2 .

AC_DOCUMENT_CREATE CALL FUNCTION 'AC_DOCUMENT_CREATE' EXPORTING i_free_table = ' ' TABLES t_acchd = gt_acchd t_accit = gt_accit t_acccr = gt_acccr.

AC_DOCUMENT_POST CALL FUNCTION 'AC_DOCUMENT_POST' EXPORTING i_awtyp = ls_acchd-awtyp i_awref = ls_acchd-awref i_aworg = ls_acchd-aworg i_awsys = ls_acchd-awsys.

FI_ACCBELNR_GET CALL FUNCTION 'FI_ACCBELNR_GET' TABLES t_belnr = lt_belnr.

FAGL_GET_DATA_FOR_MGPLN CALL FUNCTION 'FAGL_GET_DATA_FOR_MGPLN' EXPORTING i_mgpln = p_mgpln IMPORTING et_fagl_mig_001 = lt_mgpln_001 EXCEPTIONS mgpln_not_found = 1 * OTHERS = 2 .

FAGL_GET_STATUS_OF_MIGRATION





CALL FUNCTION 'FAGL_GET_STATUS_OF_MIGRATION' EXPORTING i_mgpln = p_mgpln IMPORTING et_fagl_mig_001_s = lt_fagl_mig_001_s EXCEPTIONS no_data_found = 1 OTHERS = 2.

FAGL_GET_BUKRS_LEDGER_IN_MGPLN CALL FUNCTION 'FAGL_GET_BUKRS_LEDGER_IN_MGPLN' EXPORTING i_mgpln = p_mgpln IMPORTING et_bukrs = gt_bukrs * et_rldnr = lt_rldnr * et_fagl_mig_002 = lt_fagl_mig_002 * ET_BUKRS_RLDNR = EXCEPTIONS invalid_input = 1 no_data_found = 2 OTHERS = 3 .

FAGL_GET_BUKRS_LEDGER_IN_MGPLN CALL FUNCTION 'FAGL_GET_BUKRS_LEDGER_IN_MGPLN' EXPORTING i_mgpln = p_mgpln IMPORTING * ET_BUKRS = * ET_RLDNR = * ET_FAGL_MIG_002 = et_bukrs_rldnr = gt_bukrs_ledger EXCEPTIONS invalid_input = 1 no_data_found = 2 OTHERS = 3 .

FAGL_GET_GROUPS_WITH_LEDGER CALL FUNCTION 'FAGL_GET_GROUPS_WITH_LEDGER' EXPORTING i_rldnr = lv_ledger TABLES et_ldgrp = gt_ldgrp.

MESSAGE_STORE CALL FUNCTION 'MESSAGE_STORE' EXPORTING msgty = u_msgty msgv1 = u_msgv1 msgv2 = u_msgv2 msgv3 = u_msgv3 msgv4 = u_msgv4 arbgb = u_arbgb txtnr = l_txtnr exception_if_not_active = space.

T095_READ call function 'T095_READ' exporting f_t095 = ls_t095 importing f_t095 = ls_t095 exceptions not_found = 1 others = 2.

T095B_READ call function 'T095B_READ' exporting f_t095b = ls_t095b importing f_t095b = ls_t095b exceptions not_found = 1 others = 2.

T093C_READ CALL FUNCTION 'T093C_READ' EXPORTING i_bukrs = i_bukrs * F_T093C = * I_PBO_CHECK = ' ' IMPORTING f_t093c = ls_t093c EXCEPTIONS not_found = 1 OTHERS = 2 .

FAGL_GET_LEDGER_FROM_GROUP CALL FUNCTION 'FAGL_GET_LEDGER_FROM_GROUP' EXPORTING i_ldgrp = p_bkpf-ldgrp IMPORTING et_ledger = lt_ledger EXCEPTIONS error_in_ledgergroup = 1 OTHERS = 2.

FAGL_GET_ALL_LEDGERS_IN_BUKRS CALL FUNCTION 'FAGL_GET_ALL_LEDGERS_IN_BUKRS' EXPORTING i_bukrs = p_bkpf-bukrs IMPORTING et_ledgers = lt_ledger.

FAGL_GET_TABLENAMES CALL FUNCTION 'FAGL_GET_TABLENAMES' EXPORTING i_ledger = lv_ledger i_client = sy-mandt IMPORTING es_tabnames = ls_tablenames EXCEPTIONS not_found = 1 configuration_error = 2 OTHERS = 3.

DDIF_DTEL_GET CALL FUNCTION 'DDIF_DTEL_GET' EXPORTING name = i_field langu = sy-langu IMPORTING dd04v_wa = p_dd04v EXCEPTIONS illegal_input = 1 OTHERS = 2.

/NGL/GET_MGPLN_FROM_PACKID CALL FUNCTION '/NGL/GET_MGPLN_FROM_PACKID' "#EC EXISTS EXPORTING i_packid = p_pack IMPORTING es_mgpln = ls_fagl_mig_001 EXCEPTIONS mgpln_not_found = 1 packid_not_found = 2 packid_not_valid_for_newgl = 3 packid_not_assigned = 4 too_many_mgpln_assigned = 5 OTHERS = 6.

FI_POSTING_KEY_REVERSE CALL FUNCTION 'FI_POSTING_KEY_REVERSE' EXPORTING i_posting_key = ls_accit-bschl IMPORTING e_posting_key = ls_accit-bschl EXCEPTIONS posting_key_existance = 1 rev_posting_key_existance = 2 OTHERS = 3.

AC_DOCUMENT_CREATE CALL FUNCTION 'AC_DOCUMENT_CREATE' TABLES t_acchd = lt_acchd t_accit = lt_accit t_acccr = lt_acccr.

AC_DOCUMENT_POST CALL FUNCTION 'AC_DOCUMENT_POST' EXPORTING i_awtyp = i_bkpf-awtyp i_awref = i_bkpf-awkey(10) i_aworg = i_bkpf-awkey+10(10).

FI_ACCBELNR_GET CALL FUNCTION 'FI_ACCBELNR_GET' TABLES t_belnr = lt_belnr.

MESSAGES_STOP CALL FUNCTION 'MESSAGES_STOP' EXCEPTIONS i_message = 1 w_message = 2 e_message = 3 a_message = 4 OTHERS = 8.

MESSAGES_SHOW CALL FUNCTION 'MESSAGES_SHOW'.



Contribute (Add Comments)

Although this basic information may have limited use it does provide an easy to find location to store any knowledge about this program/report.

The contribute/comments section below therefore offer's an opportunity for anyone to add additional information. This can be anything from useful hints, tips and screen shots to relevant SAP notes or anything else you feel is relevant to this report.

This will then be available for everyone to easily find by simply searching on the report name FAGL_MIG_AFA_POST or its description.