zoukankan      html  css  js  c++  java
  • 取汇率

    *&---------------------------------------------------------------------*
    *& 抬头     : 汇率解析                                                 *
    *& 模块     : FI                                                       *
    *& 作者     : 88392028                                                 *
    *& 创建日期 : 2018/06/21                                               *
    *& 程序类型 : 汇率解析接口                                             *
    *& 消息类   : 00                                                       *
    *& 描述     : 汇率解析                                                 *
    *& 修改记录 :                                                          *
    *& 日期        修改人           修改内容                               *
    *& 2018/09/10  88392028         二期优化                              *
    *&---------------------------------------------------------------------*
    function zdq_fi_186 .
    *"----------------------------------------------------------------------
    *"*"Local interface:
    *"  IMPORTING
    *"     VALUE(CURRENCY1) TYPE  CHAR6 OPTIONAL
    *"     VALUE(PAYTIME) TYPE  SYDATE OPTIONAL
    *"     VALUE(CURRENCY) TYPE  CHAR6 OPTIONAL
    *"     VALUE(COSTFLAGE) TYPE  CHAR2 OPTIONAL
    *"  EXPORTING
    *"     VALUE(ROE_RATE) TYPE  CHAR15
    *"     VALUE(COSTFLAGE) TYPE  CHAR2
    *"     VALUE(FFACT) TYPE  CHAR15
    *"     VALUE(TFACT) TYPE  CHAR15
    *"     VALUE(JS_RATE) TYPE  CHAR15
    *"     VALUE(OUT_STATUS) TYPE  CHAR1
    *"     VALUE(OUT_MSG) TYPE  CHAR255
    *"----------------------------------------------------------------------
      data: ls_tcurf like tcurf,
            ls_exch_rate type bapi1093_0.
    
    **s1.COSTFLAGE回写[字段名一致]
    
    **s2.TCURF表取FFACT,TFACT
      select single *
               into ls_tcurf
               from tcurf "汇率-转换因子
              where kurst = 'M'
                and fcurr = currency1
                and tcurr = currency.
      if sy-subrc eq 0.
        ffact = ls_tcurf-ffact.
        tfact = ls_tcurf-tfact.
    **s3.函数取汇率
        call function 'BAPI_EXCHANGERATE_GETDETAIL'
          exporting
            rate_type  = 'M'
            from_curr  = ls_tcurf-fcurr "从货币
            to_currncy = ls_tcurf-tcurr "到货币
            date       = paytime
          importing
            exch_rate  = ls_exch_rate.
    *    IF SY-SUBRC EQ 0.
    *****V1.0CHANGE BY 88392028 FOR XXX AT 20180910 BEGIN*****
        if ls_exch_rate-exch_rate is not initial.
    *****V1.0CHANGE BY 88392028 FOR XXX AT 20180910 E N D*****
          out_status = 'S'.
          roe_rate = ls_exch_rate-exch_rate.
    **[公式] JS_RATE  = ROE_RATE * 转换因子-到 / 转换因子-从
          if  ls_tcurf-ffact is not initial.
            js_rate  =  roe_rate * ls_tcurf-tfact / ls_tcurf-ffact.
          else.
            out_msg  =
    'R3汇率解析/转换因子从TCURF-FFACT为0,计算汇率没取到值'.
          endif.
        else.
          out_status = 'E'.
          concatenate 'R3汇率解析/'
                      currency1 '/'
                      paytime   '/'
                      currency '/'
                      costflage '/'
                      '通过函数取汇率值失败'
                      into out_msg.
        endif.
      else.
        out_status = 'E'.
        concatenate 'R3汇率解析/'
                    currency1 '/'
                    paytime   '/'
                    currency '/'
                    costflage '/'
                    '取转换因子TCURF表失败'
                    into out_msg.
      endif.
    
    
    endfunction.
  • 相关阅读:
    Attribute与元数据
    clr相关名词
    webHttpBinding、basicHttpBinding和wsHttpBinding区别
    Python3.7 AES加密 pycrypto‎ 更新为 pycrypto‎demo | TypeError: Object type <class 'str'> cannot be passed to C code(转)
    如何判断代理IP是否有效
    直观理解梯度,以及偏导数、方向导数和法向量等(转载)
    python_控制台输出带颜色的文字方法(转载)
    Matplotlib.pyplot 常用方法
    scrapy自定制命令
    scrapy中间件
  • 原文地址:https://www.cnblogs.com/rainysblog/p/11691528.html
Copyright © 2011-2022 走看看