SAP 取汇率

作者: Mmm_余安 | 来源:发表于2019-03-20 16:29 被阅读19次
      DATA:LV_FOREIGN_CURRENCY LIKE TCURR-FCURR.
      DATA:LV_RATE LIKE VBRP-KURSK,
           LV_FACT TYPE I.
    
            LV_FOREIGN_CURRENCY = GS_XVBAP-WAERK.
            CALL FUNCTION 'READ_EXCHANGE_RATE'
              EXPORTING
                CLIENT           = SY-MANDT
                DATE             = SY-DATUM
                FOREIGN_CURRENCY = LV_FOREIGN_CURRENCY
                LOCAL_CURRENCY   = 'CNY'
                TYPE_OF_RATE     = 'M'
              IMPORTING
                EXCHANGE_RATE    = LV_RATE
                FOREIGN_FACTOR   = LV_FACT
              EXCEPTIONS
                NO_RATE_FOUND    = 1
                NO_FACTORS_FOUND = 2
                NO_SPREAD_FOUND  = 3
                DERIVED_2_TIMES  = 4
                OVERFLOW         = 5
                ZERO_RATE        = 6
                OTHERS           = 7.
            IF SY-SUBRC <> 0.
    * Implement suitable error handling here
            ENDIF.
    
    • 这个函数不能通过SE37进行测试
    • LOCAL_CURRENCY = 'CNY'这个只能是CNY,然后取汇率
    • 汇率 = ( LV_RATE / LV_FACT )

    相关文章

      网友评论

        本文标题:SAP 取汇率

        本文链接:https://www.haomeiwen.com/subject/qvktvqtx.html