SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

FAQ



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> FI
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1639

PostPosted: Sat Oct 20, 2007 2:23 pm    Post subject: FAQ Reply with quote

Important Tables in SAP FI

Tables in Visio format

Financial Accounting
Table Name Description Important Fields
Financial Accounting
FBAS Financial Accounting “Basis”
BKPF Accounting Document Header BUKRS / BELNR / GJAHR
BSEG Accounting Document Segment BUKRS / BELNR / GJAHR / BUZEI
BSIP Index for Vendor Validation of Double BUKRS / LIFNR / WAERS / BLDAT /
Documents XBLNR / WRBTR / BELNR / GJAHR / BUZEI
BVOR Inter Company Posting Procedure BVORG / BUKRS / GJAHR / BELNR
EBKPF Accounting Document Header (docs from GLSBK / BELNR / GJHAR / GLEBK
External Systems)
FRUN Run Date of a Program PRGID
KLPA Customer / Vendor Linking NKULI / NBUKR / NKOAR / PNTYP
/ VKULI / VBUKR / VKOAR

KNB4 Customer Payment History KUNNR / BUKRS
KNB5 Customer Master Dunning Data KUNNR / BUKRS / MABER
KNBK Customer Master Bank Details KUNNR / BANKS / BANKL / BANKN
KNC1 Customer Master Transaction Figures KUNNR / BUKRS / GJHAR
KNC3 Customer Master Special GL Transactions KUNNR / BUKRS / GJAHR / SHBKZ
Figures
LFB5 Vendor Master Dunning Data LIFNR / BUKRS / MABER
LFBK Vendor Master Bank Details LIFNR / BANKS / BANKL / BANKN
LFC1 Vendor Master Transaction Figures LIFNR / BUKRS / GJHAR
LFC3 Vendor Master Special GL Transactions LIFNR / BUKRS / GJHAR / SHBKZ
Figures
VBKPF Document Header for Document Parking AUSBK / BUKRS / BELNR / GJHAR
FBASCORE Financial Accounting General Services “Basis”
KNB1 Customer Master (Company Code) KUNNR / BUKRS
LFA1 Vendor Master (General Section) LIFNR
LFB1 Vendor Master (company Code Section) LIFNR / BUKRS
SKA1 G/L Account Master (Chart of Accounts) KTOPL / SAKNR
SKAT G/L Account Master (Chart of Accounts – SPRAS / KTOPL / SAKNR
Description)
MAHNS Accounts Blocked by Dunning Selection KOART / BUKRS / KONKO / MABER
MHNK Dunning Data (Account Entries) LAUFD / LAUFI / KOART / BUKRS /
KUNNR / LIFNR / CPDKY / SKNRZE /
SMABER / SMAHSK / BUSAB
FI-GL-GL (FBS) General Ledger Accounting: Basic Functions- G/L Accounts
SKAS G/L Account Master (Chart of Accounts – SPRAS / KTOPL / SAKNR / SCHLW
Key Word list)
SKB1 G/L Account Master (Company Code) BUKRS / SAKNR
FI-GL-GL (FBSC) General Ledger Accounting: Basic
Functions - R/3 Customizing for G/L Accounts
FIGLREP Settings for G/L Posting Reports MANDT
TSAKR Create G/L account with reference BUKRS / SAKNR
FI-GL-GL (FFE) General Ledger Accounting: Basic
Functions - Fast Data Entry
KOMU Account Assignment Templates for G/L KMNAM / KMZEI
Account items
FI-AR-AR (FBD) Accounts Receivable: Basic Functions - Customers

KNKA Customer Master Credit Management : KUNNR
Central Data
KNKK Customer Master Credit Management : KUNNR / KKBER
Control Area Data
KNKKF1 Credit Management : FI Status data LOGSYS / KUNNR / KKBER / REGUL
RFRR Accounting Data – A/R and A/P RELID / SRTFD / SRTF2
Information System
FI-BL-PT Bank Accounting: Payment (BFIBL_CHECK_D) Transactions – General Sections
PAYR Payment Medium File ZBUKR / HBKID / HKTID / RZAWE /
CHECT
PCEC Pre-numbered Check ZBUKR / HBKID / HKTID / STAPL
FI-BL-PT-AP(FMZA)Bank Accounting: Payment Transactions – Automatic Payments

F111G Global Settings for Payment Program for MANDT
Payment Requests
FDZA Cash Management Line Items in Payment KEYNO
Requests
PAYRQ Payment Requests KEYNO

What is the table name for G/L Master data, when we create centrally (T.Code - FS00)?

As far as general ledger master data is concerned, the following tables are involved :

Table name : SKB1 : G/L Account Master ( Company Code)
Fields:
BUKRS : Company Code
SAKNR : G/L Account

Table name : SKA1 : G/L Account Master ( Chart of Accounts )
Fields:
KTOPL : Char of Accounts
SAKNR : G/L Account

Table name : SKAT : G/L Account Master Record ( Chart of Accounts : Description )
Fields:
SPRAS : Language
KTOPL : Char of Accounts
SAKNR : G/L Account

FI functional modules
BAPI_GL_ACC_GETPERIODBALANCES - Posting period balances for each G/L account

FI_CHART_OF_ACCOUNT_DETERMINE

FI_COMPANY_CODE_CHECK

FI_COMPANY_CODE_DATA

FI_COUNTRY_CHECK

FI_COUNTRY_DATA - FI: return country data

FI_GL_ACCOUNT_CHECK

FI_GL_ACCOUNT_DATA

FI_VENDOR_CHECK

FI_VENDOR_DATA

FI_CUSTOMER_CHECK

FI_CUSTOMER_DATA

FI-SL Sets:

G_SET_GET_ALL_VALUES - Read All Values in a Set Hierarchy
Imports a set Id and table name and returns an internal table filled with elements of the set.
4.6C Example (retrieve set Id using G_SET_GET_ID_FROM_NAME).
Code:

DATA: BEGIN OF IT_SETVAL OCCURS 0.
INCLUDE STRUCTURE RGSB4.
DATA: END OF IT_SETVAL.
PARAMETERS: p_kostl like sethier-setid, "Cost Center Group
HP_KOSTL like sethier-setid NO-DISPLAY.
ranges: r_kostl for csks-kostl. "Cost center range


************************************************************************
FORM SELECT_COST_CENTERS.
IF P_KOSTL <> SPACE. "Cost Center Group
call function 'G_SET_GET_ID_FROM_NAME'
exporting
shortname = p_kostl
tabname = 'CCSS '
importing
new_setid = hp_kostl
exceptions
no_set_found = 1
no_set_picked_from_popup = 2
wrong_class = 3
wrong_subclass = 4
table_field_not_found = 5
fields_dont_match = 6
set_is_empty = 7
formula_in_set = 8
set_is_dynamic = 9
others = 10.
if sy-subrc = 0.
CALL FUNCTION 'G_SET_GET_ALL_VALUES'
EXPORTING
SETNR = HP_KOSTL
TABLE = 'CCSS '
TABLES
SET_VALUES = IT_SETVAL
EXCEPTIONS
SET_NOT_FOUND = 1
OTHERS = 2.
endif.
LOOP AT IT_SETVAL.
R_KOSTL-LOW = IT_SETVAL-FROM.
R_KOSTL-HIGH = IT_SETVAL-TO.
R_KOSTL-SIGN = 'I'. "Inclusion
IF IT_SETVAL-TO = SPACE.
R_KOSTL-OPTION = 'EQ'. "Equivalent
ELSE.
R_KOSTL-OPTION = 'BT'. "Between
ENDIF.
APPEND R_KOSTL.
ENDLOOP.
ENDIF.
ENDFORM.
************************************************************************


G_SET_TREE_IMPORT Importing a Set Hierarchy
Imports a set Id and table name and returns two internal tables filled with
elements of the set;
hierarchy tree of the set.
4.6C Example (retrieve set Id using G_SET_GET_ID_FROM_NAME).
Code:

*----- cost elements hierarchy -----------------------------------------
data: begin of ivalues occurs 0.
include structure setvalues.
data: end of ivalues.
data: begin of itree occurs 1.
include structure sethier.
data: end of itree.

parameters: p_kstar like sethier-setid, "Cost Element Group
hp_kstar like sethier-setid no-display,
p_kokrs like tka01-kokrs obligatory. "Controlling Area


************************************************************************
form select_cost_element_hierarchy.
call function 'G_SET_GET_ID_FROM_NAME'
exporting
shortname = p_kstar
tabname = 'CCSS '
kokrs = p_kokrs
importing
new_setid = hp_kstar
exceptions
no_set_found = 1
no_set_picked_from_popup = 2
wrong_class = 3
wrong_subclass = 4
table_field_not_found = 5
fields_dont_match = 6
set_is_empty = 7
formula_in_set = 8
set_is_dynamic = 9
others = 10.

if sy-subrc = 0.
call function 'G_SET_TREE_IMPORT'
exporting
setid = hp_kstar
tabname = 'CCSS '
tables
set_hierarchy = itree
set_values = ivalues
exceptions
set_not_found = 1
illegal_field_replacement = 2
illegal_table_replacement = 3
others = 4.
endif.
endform.
************************************************************************


G_SET_GET_ID_FROM_NAME Determining a Set ID from the Set Name and Other Information
Derives the internal set Id from the name that appears on the user interface, e.g. in order then to import the set (see the function group and function module documentation). To take in account changes in SET concept in 4.6C: see examples to G_SET_GET_ALL_VALUES and G_SET_TREE_IMPORT.

See also example reports:
  • RGSEX001 - Read-only access with G_SET_TREE_IMPORT
  • RGSEX000, RGSEX010, RGSEX020 - Access with modules from the function group GSSM
  • RGSEX030 - Create a set

Tables:
  • T800S - FI-SL Set Table (before Release 4.0)


CALCULATE_TAX_FROM_GROSSAMOUNT - calculate the tax amount and to get the correct tax account.

Code:
 
data: i_MWDAT like RTAX1U15 occurs 1.
CALL FUNCTION 'CALCULATE_TAX_FROM_GROSSAMOUNT'                   
        EXPORTING                                                           
          I_BUKRS                       = s_block-bukrs                     
          I_MWSKZ                       = s_alv_list-mwskz                 
*         I_TXJCD                       = ' '                           
          I_WAERS                       = s_block-bwaer                     
          I_WRBTR                       = v_difer                           
*         I_ZBD1P                       = 0                             
*         I_PRSDT                       =                               
*         I_PROTOKOLL                   =                               
*         I_TAXPS                       =                               
*         I_ACCNT_EXT                   =                               
        IMPORTING                                                           
*         E_FWNAV                       =                               
*         E_FWNVV                       =                               
*         E_FWSTE                       =                               
          E_FWAST                       = v_dfiva                           
        TABLES                                                             
          T_MWDAT                       = i_mwdat                           
       EXCEPTIONS                                                           
         BUKRS_NOT_FOUND               = 1                                 
         COUNTRY_NOT_FOUND             = 2                                 
         MWSKZ_NOT_DEFINED             = 3                                 
         MWSKZ_NOT_VALID               = 4                                 
         ACCOUNT_NOT_FOUND             = 5                                 
         DIFFERENT_DISCOUNT_BASE       = 6                                 
         DIFFERENT_TAX_BASE            = 7                                 
         TXJCD_NOT_VALID               = 8                                 
         NOT_FOUND                     = 9                                 
         KTOSL_NOT_FOUND               = 10                                 
         KALSM_NOT_FOUND               = 11                                 
         PARAMETER_ERROR               = 12                                 
         KNUMH_NOT_FOUND               = 13                                 
         KSCHL_NOT_FOUND               = 14                                 
         UNKNOWN_ERROR                 = 15                                 
         OTHERS                        = 16                                 
                .                                                           
  v_dfimp = abs( v_difer - v_dfiva ).                               


CALCULATE_TAX_FROM_NET_AMOUNT

Code:

data: i_MWDAT like RTAX1U15 occurs 1.

CALL FUNCTION 'CALCULATE_TAX_FROM_NET_AMOUNT'                         
    EXPORTING                                                               
      I_BUKRS                 = s_block-bukrs                               
      I_MWSKZ                 = s_alv_list-mwskz                           
*   I_TXJCD                 = ' '                                       
      I_WAERS                 = s_block-bwaer                               
      I_WRBTR                 = l_wrbtr                                     
*   I_ZBD1P                 = 0                                         
*   I_PRSDT                 =                                           
*   I_PROTOKOLL             =                                           
*   I_TAXPS                 =                                           
*   I_ACCNT_EXT             =                                           
    IMPORTING                                                               
*   E_FWNAV                 =                                           
*   E_FWNVV                 =                                           
*   E_FWSTE                 =                                           
      E_FWAST                 = l_iva                                       
   TABLES                                                                   
      T_MWDAT                 = i_mwdat                                     
   EXCEPTIONS                                                               
     BUKRS_NOT_FOUND         = 1                                           
     COUNTRY_NOT_FOUND       = 2                                           
     MWSKZ_NOT_DEFINED       = 3                                           
     MWSKZ_NOT_VALID         = 4                                           
     KTOSL_NOT_FOUND         = 5                                           
     KALSM_NOT_FOUND         = 6                                           
     PARAMETER_ERROR         = 7                                           
     KNUMH_NOT_FOUND         = 8                                           
     KSCHL_NOT_FOUND         = 9                                           
     UNKNOWN_ERROR           = 10                                           
     ACCOUNT_NOT_FOUND       = 11                                           
     TXJCD_NOT_VALID         = 12                                           
     OTHERS                  = 13                                           
            .         


DATE_TO_PERIOD_CONVERT - get FI period by date

Code:
DATA: g_monat LIKE t009b-poper,
      g_periv LIKE t001-periv.

  g_monat = p_date+4(2).

  SELECT SINGLE periv FROM t001 INTO g_periv
    WHERE bukrs = p_bukrs.
 
  IF sy-subrc IS INITIAL.
    CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
      EXPORTING
        i_date         = p_date
        i_periv        = g_periv  "Version der Periodenermittlung
      IMPORTING
        e_buper        = g_monat
      EXCEPTIONS
        input_false    = 1
        t009_notfound  = 1
        t009b_notfound = 1.
  ENDIF.
  SELECT *
    FROM bsid
    INTO CORRESPONDING FIELDS OF TABLE lt_bsid
    WHERE bukrs = p_bukrs
    AND   kunnr IN s_kunnr
    AND   gjahr = p_date(4)
    AND   monat = g_monat.


FI_PERIOD_CHECK - check if the period is opened or closed

Code:

*&---------------------------------------------------------------------*
*&      Form  DETERMINAR_FECHA_CONTABLE
*&---------------------------------------------------------------------*
FORM determinar_fecha_contable USING    pe_bldat
                              CHANGING ps_budat.
 DATA: l_ejercicio_abierto LIKE bkpf-gjahr,
       l_periodo_abierto   LIKE t009b-poper,
       l_salir LIKE sy-sUbrc.

 CALL FUNCTION 'FI_PERIOD_DETERMINE'
      EXPORTING
           i_budat        = pe_bldat
           i_bukrs        = p_bukrs
           i_monat        = 00
      IMPORTING
           e_gjahr        = l_ejercicio_abierto
           e_poper        = l_periodo_abierto
      EXCEPTIONS
           fiscal_year    = 1
           period         = 2
           period_version = 3
           posting_period = 4
           special_period = 5
           version        = 6
           posting_date   = 7
           OTHERS         = 8.

 l_salir = 1.
 ps_budat = pe_bldat.

 WHILE l_salir EQ 1.

   CALL FUNCTION 'FI_PERIOD_CHECK'
     EXPORTING
     i_bukrs                = p_bukrs
*   I_OPVAR                = ' '
     i_gjahr                = l_ejercicio_abierto
     i_koart                = '+'
     i_konto                = '+'
     i_monat                = l_periodo_abierto
  EXCEPTIONS
    error_period           = 1
    error_period_acc       = 2
    OTHERS                 = 3.

   l_salir = sy-subrc.
   IF l_salir NE 0.
*Si el periodo está cerrado hay que calcular el siguiente abierto
     CALL FUNCTION 'RE_ADD_MONTH_TO_DATE'
          EXPORTING
               months  = 1
               olddate = ps_budat
          IMPORTING
               newdate = ps_budat.

     l_ejercicio_abierto = PS_BUDAT(4).
     L_PERIODO_ABIERTO   = PS_BUDAT+4(2).
   ENDIF.

   IF PS_BUDAT > '20990101'.
     PS_BUDAT = PE_BLDAT.
     EXIT.
   ENDIF.
 ENDWHILE.

ENDFORM.                    " DETERMINAR_FECHA_CONTABLE


CONVERT_TO_LOCAL_CURRENCY - Translate foreign currency amount to local currency

An amount in local currency is calculated from a specified foreign currency amount. For this, you may either specify the translation rate manually (Parameter RATE) or have the system determine it from table TCURR on the basis of the rate type, date and currency key. Because the ratios for the units of the currencies involved in the translation are significant for this translation, table TCURF is always read by the program, and there must be a valid entry there for the data specified. IF exchange rate fixing is defined for the exchange rate type TYPE_OF_RATE or an alternative exchange rate is defined for the currency pair, this information is transferred to the calling program.

When table TCURR is read, the foreign currency key is always taken as the first part of the key and the local currency as the second part.

Code:

CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
  EXPORTING
    DATE = BKPF-WWERT
    FOREIGN_CURRENCY = BKPF-WAERS
    LOCAL_CURRENCY = T001-WAERS
    FOREIGN_AMOUNT = BSEG-WRBTR
    RATE = BKPF-KURSF
    TYPE_OF_RATE = 'M'
  IMPORTING
    EXCHANGE_RATE = KURS
    LOCAL_AMOUNT = BSEG-DMBTR
    FOREIGN_FACTOR = FAKTOR-F
    LOCAL_FACTOR = FAKTOR-L
    FIXED_RATE = FIXKURS
  EXCEPTIONS
    NO_RATE_FOUND = 4
    NO_FACTORS_FOUND = 8.


DETERMINE_DUE_DATE
Code:
MOVE-CORRESPONDING BSID TO X_FAEDE.
X_FAEDE-KOART = 'D'.

CALL FUNCTION 'DETERMINE_DUE_DATE'
        EXPORTING
             I_FAEDE = X_FAEDE
        IMPORTING
             E_FAEDE = X_FAEDE
        EXCEPTIONS
             OTHERS  = 1.
   BSEGA-NETDT = X_FAEDE-NETDT.



FI_PERIOD_DETERMINE - Find the period for a date

Code:

*---------------------------------------------------------------------*
*       FORM dev_periodo_ejerc                                        *
*---------------------------------------------------------------------*
*       Procedimiento que pasándole la fecha de contabilización       *
*       devuelve el ejercico y periodo                                *
*---------------------------------------------------------------------*
form dev_periodo_ejerc.

 clear: v_ejer_abier, v_per_abier.

 call function 'FI_PERIOD_DETERMINE'
   exporting
     i_budat              = v_fechacont
     i_bukrs              = v_sociedad
*     I_PERIV              = ' '
*     I_GJAHR              = 0000
     i_monat              = 00
*     X_XMO16              = ' '
  importing
     e_gjahr              = v_ejer_abier
*      E_MONAT              = v_mesabier
     e_poper              = v_per_abier
 exceptions
   fiscal_year          = 1
   period               = 2
   period_version       = 3
   posting_period       = 4
   special_period       = 5
   version              = 6
   posting_date         = 7
   others               = 8
           .
 if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
 endif.
endform.


GET_CLEARED_ITEMS

Code:

include RFEPOSC1. "Contiene la definición de POSTAB

SELECT SINGLE * FROM BKPF
                   WHERE BUKRS = I_DATOS-BUKRS
                   AND   BELNR = I_DATOS-BELNR
                   AND   GJAHR = I_DATOS-GJAHR.
     REFRESH POSTAB.
     CALL FUNCTION 'GET_CLEARED_ITEMS'
          EXPORTING
               I_BELNR                = I_DATOS-BELNR
               I_BUKRS                = I_DATOS-BUKRS
               I_GJAHR                = I_DATOS-GJAHR
               I_BVORG                = BKPF-BVORG
          TABLES
               T_ITEMS                = POSTAB
          EXCEPTIONS
               NOT_FOUND              = 1
               ERROR_CLEARED_ACCOUNTS = 2
               OTHERS                 = 3.
     LOOP AT POSTAB WHERE XHELL NE 'X'
                      AND BUDAT <= P_BUDAT.
       CLEAR I_PAGADO.
       I_PAGADO-BUKRS = I_DATOS-BUKRS.
       I_PAGADO-BELNR = I_DATOS-BELNR.
       I_PAGADO-GJAHR = I_DATOS-GJAHR.
       I_PAGADO-LIFNR = I_DATOS-LIFNR.
       I_PAGADO-BLART = POSTAB-BLART.
       I_PAGADO-DMBTR = POSTAB-BWWRT - POSTAB-QBSHB.
       IF BSAK-SHKZG = 'S'.
         I_PAGADO-DMBTR = - POSTAB-BWWRT.
       ENDIF.
       COLLECT I_PAGADO.
       CLEAR I_RELDOCS.
       MOVE-CORRESPONDING I_PAGADO TO I_RELDOCS.
       I_RELDOCS-BELNRP = POSTAB-BELNR.
       I_RELDOCS-GJAHRP = POSTAB-GJAHR.
       COLLECT I_RELDOCS.
     ENDLOOP.


RE_ADD_MONTH_TO_DATE - Add / substract month to/from date

Code:
data: old_datum type sy-datum value '20070809'.
data: new_datum type sy-datum.
 
do 12 times.
  call function 'RE_ADD_MONTH_TO_DATE'
       exporting
            months  = '-1'
            olddate = old_datum
       importing
            newdate = new_datum.
 
  write:/ new_datum, 'Month is:', new_datum+4(2).
  old_datum = new_datum.
enddo.


Code:
FUNCTION zexxfi_period_get.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     REFERENCE(BUKRS) TYPE  BUKRS
*"     REFERENCE(DATE) TYPE  DATUM OPTIONAL
*"     REFERENCE(MONAT) TYPE  MONAT OPTIONAL
*"     REFERENCE(GJAHR) TYPE  GJAHR OPTIONAL
*"  EXPORTING
*"     REFERENCE(MONAT_MAX) TYPE  MONAT
*"     REFERENCE(MONAT_CUR) TYPE  MONAT
*"     REFERENCE(MONAT_POST_MAX) TYPE  MONAT
*"     REFERENCE(MONAT_SPEC_MAX) TYPE  MONAT
*"     REFERENCE(LAST_DAY) TYPE  DATUM
*"     REFERENCE(FIRST_DAY) TYPE  DATUM
*"  EXCEPTIONS
*"      NO_ENTRY
*"      INPUT_FALSE
*"      T009_NOTFOUND
*"      T009B_NOTFOUND
*"----------------------------------------------------------------------

  STATICS: ct_t009 TYPE TABLE OF t009 WITH HEADER LINE.
  DATA: l_poper TYPE t009b-poper,
        l_monat TYPE bkpf-monat,
        l_periv TYPE t001-periv,
        ls_t001 TYPE t001.

  CLEAR:
      monat_max,
      monat_cur,
      monat_post_max,
      monat_spec_max.

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

  IF NOT sy-subrc IS INITIAL.
    RAISE no_entry.
  ENDIF.
  READ TABLE ct_t009 WITH KEY periv = ls_t001-periv.
  IF NOT sy-subrc IS INITIAL.
    SELECT SINGLE * INTO ct_t009
    FROM t009
    WHERE periv = ls_t001-periv.
    APPEND ct_t009.
  ENDIF.
  monat_post_max = ct_t009-anzbp.
  monat_spec_max = ct_t009-anzsp.
  monat_max = monat_post_max + monat_spec_max.

  IF NOT date IS INITIAL.

    CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
      EXPORTING
        i_date         = date
        i_periv        = l_periv  "Version der Periodenermittlung
      IMPORTING
        e_buper        = monat_cur
      EXCEPTIONS
        input_false    = 1
        t009_notfound  = 2
        t009b_notfound = 3.

    CASE sy-subrc.
      WHEN 1.
        RAISE input_false.
      WHEN 2.
        RAISE t009_notfound.
      WHEN 3.
        RAISE t009b_notfound.
    ENDCASE.

  ENDIF.

  IF NOT monat IS INITIAL AND
     NOT gjahr IS INITIAL.
    l_poper = monat.
    CALL FUNCTION 'FIRST_DAY_IN_PERIOD_GET'
      EXPORTING
        i_gjahr        = gjahr
        i_periv        = ls_t001-periv
        i_poper        = l_poper
      IMPORTING
        e_date         = first_day
      EXCEPTIONS
        input_false    = 1
        t009_notfound  = 2
        t009b_notfound = 3.

    CASE sy-subrc.
      WHEN 1.
        RAISE input_false.
      WHEN 2.
        RAISE t009_notfound.
      WHEN 3.
        RAISE t009b_notfound.
    ENDCASE.

    CALL FUNCTION 'LAST_DAY_IN_PERIOD_GET'
      EXPORTING
        i_gjahr        = gjahr
        i_periv        = ls_t001-periv
        i_poper        = l_poper
      IMPORTING
        e_date         = last_day
      EXCEPTIONS
        input_false    = 1
        t009_notfound  = 1
        t009b_notfound = 1.

    CASE sy-subrc.
      WHEN 1.
        RAISE input_false.
      WHEN 2.
        RAISE t009_notfound.
      WHEN 3.
        RAISE t009b_notfound.
    ENDCASE.
  ENDIF.

ENDFUNCTION.


TCode GCAN - статистика по спецрегистрам.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> FI All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.