• ABAP-定时-异步


    *&---------------------------------------------------------------------*
    *& Report  ZRICO_TEST18
    *&
    *&---------------------------------------------------------------------*
    *&
    *&
    *&---------------------------------------------------------------------*
    
    report zrico_test18.
    
    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....'.
    
    start-of-selection.
    
    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.
      data:lv_txt type string.
    
      receive results from function 'Z_ENQUE_SLEEP'
      importing
        ev_txt = lv_txt .
    
      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
  • 相关阅读:
    Windows如何上传代码到Github
    MSSQL的简单盲注
    各种类型文件头标准编码(转)
    Apache Flex BlazeDS(CVE-2017-5641)AFM3反序列化
    TSec《mysql client attack chain》
    # marshalsec使用
    # JDK7+ MethodHandle
    # CVE-2019-2725反序列化漏洞补丁绕过分析
    #LOF算法
    # URL异常检测
  • 原文地址:https://www.cnblogs.com/ricoo/p/10184274.html
Copyright © 2020-2023  润新知