zoukankan      html  css  js  c++  java
  • 汇率同步接口

    FUNCTION zrfc_mm009.
    *"----------------------------------------------------------------------
    *"*"Local interface:
    *"  IMPORTING
    *"     VALUE(CALLNO) TYPE  ZCALLNO
    *"  EXPORTING
    *"     VALUE(FLAG) LIKE  BAPIRET2-TYPE
    *"     VALUE(MESSAGE) LIKE  BAPIRET2-MESSAGE
    *"  TABLES
    *"      TCURR STRUCTURE  TCURR
    *"----------------------------------------------------------------------
    DATA: ls_tcurr TYPE tcurr,
          ukurs(15),
          ffact(9),
          tfact(9),
          lv_datano TYPE zdatano,
          lv_date1(12),
          lv_flag(1),
          lv_date(8).
    FIELD-SYMBOLS <fs> TYPE tcurr.
    
    SELECT * INTO TABLE tcurr FROM tcurr WHERE kurst = 'M'.
      IF sy-subrc = 0.
          flag = 'S'.
          message = '执行成功'.
          ELSE.
          flag = 'E'.
          message = '执行失败'.
      ENDIF.
    
    LOOP AT tcurr ASSIGNING <fs>.
      CLEAR: lv_flag,lv_date1,lv_date.
      CALL FUNCTION 'CONVERSION_EXIT_INVDT_OUTPUT'
        EXPORTING
          input         = <fs>-gdatu
       IMPORTING
         output        =  lv_date1.
    
      lv_flag = lv_date1+4(1).
      CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
        EXPORTING
          date_external                  = lv_date1
         accept_initial_date             = lv_flag
       IMPORTING
         date_internal                   = lv_date
       EXCEPTIONS
         date_external_is_invalid        = 1
         OTHERS                          = 2.
        IF sy-subrc = 0.
        <fs>-gdatu = lv_date.
        ENDIF.
    ENDLOOP.
    
    *日志记录
       CLEAR:gt_log,gs_log.
       LOOP AT tcurr INTO ls_tcurr.
        lv_datano = lv_datano + 1.
        gs_log-datano = lv_datano.
        ukurs = ls_tcurr-ukurs.
        gs_log-name   = 'ZRFC_MM009'.
        gs_log-cdate  = sy-datum.
        GET TIME.
        gs_log-ctime  = sy-uzeit.
        gs_log-callno = callno.
        gs_log-flag   = flag.
        gs_log-log    = message.
    
        CONCATENATE ls_tcurr-kurst  ls_tcurr-fcurr  ls_tcurr-tcurr  ls_tcurr-gdatu  ukurs
                     ffact          tfact
        INTO gs_log-content SEPARATED BY  ''.
        SHIFT message LEFT DELETING LEADING  ''.
        CONDENSE gs_log-content NO-GAPS.
        gs_log-length = STRLEN( gs_log-content ).
        APPEND gs_log TO gt_log.
        CLEAR: gs_log,ls_tcurr,ukurs.
       ENDLOOP.
    
       IF gt_log IS NOT INITIAL.
         INSERT zrfc_mm01in_log FROM TABLE gt_log.
         IF sy-subrc = 0.
           COMMIT WORK.
         ENDIF.
       ENDIF.
    ENDFUNCTION.
  • 相关阅读:
    js禁止鼠标右键功能
    js判断客户端是pc还是手机及获取浏览器版本
    js实现深拷贝的一些方法
    python使用requests请求的数据乱码
    PyCharm引入python需要使用的包
    几个常见用于解决nginx负载均衡的session共享问题的办法
    面试最让你手足无措的一个问题:你的系统如何支撑高并发?
    Linux/Windows 平台最容易安装 Composer教程
    Laravel一些常用命令整理
    nginx下重写隐藏index.php文件
  • 原文地址:https://www.cnblogs.com/caizjian/p/6074236.html
Copyright © 2011-2022 走看看