ABAP SAP从期间到具体对应日期起始,以及日期获取对应期间

//日期计算 
CALL FUNCTION 'FIMA_DATE_CREATE'
      EXPORTING
        I_date = sy-datum
        i_days = dltcnt
      IMPORTING
        e_date = pfstm.

//获取期间 
    CALL FUNCTION 'G_PERIOD_GET'
      EXPORTING
        company = lbukrs
        date    = pfstm
        ledger  = '0L'
      IMPORTING
        year    = lBDATJ
        period  = lPOPER.

//期间对应起始日期
     CALL FUNCTION 'FIRST_DAY_IN_PERIOD_GET'
    EXPORTING
      i_gjahr = pperio+0(4)
      i_periv = 'K4'
      i_poper = pperio+4(3)
    IMPORTING
      e_date  = lfstdate.

  CALL FUNCTION 'LAST_DAY_IN_PERIOD_GET'
    EXPORTING
      i_gjahr = pperio+0(4)
      i_periv = 'K4'
      i_poper = pperio+4(3)
    IMPORTING
      e_date  = llstdate.

你可能感兴趣的:(ABAP,BASIS,其他,经验分享)