ABAP根据公司代码和日期取得会计期间

  • 3
  • 800 views
  • A+
所属分类:Notes

两个函数可用:
G_PERIOD_GET
BAPI_COMPANYCODE_GET_PERIOD

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

目前评论:3   其中:访客  3   博主  0

    • ag

      个人觉得G_PERIOD_GET更好用一点,分别传入公司代码、日期、分类账就行了。

      • ag

        CALL FUNCTION ‘G_PERIOD_GET’

        EXPORTING
        COMPANY = P_BUKRS
        DATE = LF_SPMON
        LEDGER = ‘0L’
        IMPORTING
        PERIOD = GS_SPMON-PERIOD “期间
        YEAR = GS_SPMON-SPMONS “年度
        EXCEPTIONS
        LEDGER_NOT_ASSIGNED_TO_COMPANY = 1
        PERIOD_NOT_DEFINED = 2
        VARIANT_NOT_DEFINED = 3
        PARAMETER_ERROR = 4
        OTHERS = 5.

        IF SY-SUBRC 0.
        LEAVE LIST-PROCESSING.
        ENDIF.

        • ag

          CALL FUNCTION ‘BAPI_COMPANYCODE_GET_PERIOD’
          EXPORTING
          COMPANYCODEID = P_BUKRS
          POSTING_DATE = SY-DATUM
          IMPORTING
          FISCAL_YEAR = P_RYEAR
          FISCAL_PERIOD = P_POPER
          RETURN = L_RETURN1.
          Test for function group FACS
          Function module FI_PERIOD_DETERMINE
          Upper/lower case
          Runtime: 831 Microseconds

          Import parameters Value
          I_BUDAT 2008/10/15
          I_BUKRS SBJA
          I_PERIV
          I_GJAHR
          I_MONAT 00
          X_XMO16

          Export parameters Value
          E_GJAHR 2008
          E_MONAT 10
          E_POPER 010