• ABAP在SAP中设计自动刷新的报表代码


    REPORT zauto_refresh .
    DATA: g_init_once,
          ok_code(20),
          g_ref_from_timer.

    TYPES: BEGIN OF t_ekko,
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
      statu TYPE ekpo-statu,
      aedat TYPE ekpo-aedat,
      matnr TYPE ekpo-matnr,
      menge TYPE ekpo-menge,
      meins TYPE ekpo-meins,
      netpr TYPE ekpo-netpr,
      peinh TYPE ekpo-peinh,
    END OF t_ekko.

    DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          wa_ekko TYPE t_ekko.


    IF g_init_once <> 'X'.
      g_init_once = 'X'.
      CALL FUNCTION 'Z_ENQUE_SLEEP'
         STARTING NEW TASK 'WAIT'
         PERFORMING when_finished ON END OF TASK.

    ENDIF.

    WRITE:/ 'wait for 10 sec....'.

    AT USER-COMMAND.
      CASE ok_code.
        WHEN 'FCT_R'.
          SELECT ebeln ebelp statu aedat matnr menge meins netpr peinh
           UP TO 10 ROWS
            FROM ekpo
            INTO TABLE it_ekko.
          WRITE:/ sy-uzeit. "Time
          LOOP AT it_ekko INTO wa_ekko.
            WRITE:/ wa_ekko-ebeln, wa_ekko-ebelp.
          ENDLOOP.
          sy-lsind = 0.
          IF g_ref_from_timer = 'X'.

            CALL FUNCTION 'Z_ENQUE_SLEEP'
              STARTING NEW TASK 'INFO'
              PERFORMING when_finished ON END OF TASK.

            g_ref_from_timer = ''.
          ENDIF.
      ENDCASE.


    *---------------------------------------------------------------------*
    *       FORM WHEN_FINISHED                                            *
    *---------------------------------------------------------------------*
    *       ........                                                      *
    *---------------------------------------------------------------------*
    *  -->  TASKNAME                                                      *
    *---------------------------------------------------------------------*
    FORM when_finished USING taskname.
      RECEIVE RESULTS FROM FUNCTION 'Z_ENQUE_SLEEP'.

      g_ref_from_timer = 'X'.

    * Trigger an event to run the at user-command
      SET USER-COMMAND 'FCT_R'.
      ok_code = 'FCT_R'.
      sy-ucomm = 'FCT_R'.

    ENDFORM.                    " WHEN_FINISHED



    FUNCTION Z_ENQUE_SLEEP.
    *"----------------------------------------------------------------------
    *"*"Local interface:
    *"----------------------------------------------------------------------
    wait up to 10 seconds.

    *CALL FUNCTION 'ENQUE_SLEEP'
    *     EXPORTING
    *        SECONDS = 1.


    ENDFUNCTION.
     

  • 相关阅读:
    jQuery遍历
    jQuery DOM
    jQuery表单事件
    jQuery事件对象
    jQuery绑定事物处理器
    jQuery事件
    JQuery基础选择器
    JQuery基础 接下来我将把我最近学习jQuery所做的笔记发布,希望对初学者有些许帮助,也方便自己以后复习
    C# 连接Oracle数据库 遇到“System.Data.OracleClient 需要 Oracle 客户端软件 8.1.7 或更高版本”的解决方案
    安装oracle11版本报错此先决条件将测试系统物理内存总量是否至少为 922MB
  • 原文地址:https://www.cnblogs.com/xiaomaohai/p/6157513.html
Copyright © 2020-2023  润新知