SAP保持系统长时间在线

保持系统长时间在线
  1. 保持SAP系统长长时间在线不掉线,通过代码,保持一个页面一直在线,ABAP代码如下:

    *&---------------------------------------------------------------------*
    *& Report ZGUI
    *&---------------------------------------------------------------------*
    *&
    *&---------------------------------------------------------------------*
    REPORT ZGUI NO STANDARD PAGE HEADING MESSAGE-ID MG.
    DATA : text TYPE string,
           chr  TYPE char2,
           time TYPE i.
     
    DATA:sum  TYPE i,
         hour TYPE i,
         min  TYPE i,
         sec  TYPE i.
     
     
    time = 0.
    CONCATENATE 'Running(hh:mm:ss):' '00:00:00' INTO text.
    DO.
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
        EXPORTING
          percentage = time MOD 100
          text       = text
        EXCEPTIONS
          OTHERS     = 1.
      time = time + 1.
      sum = time * 5.
      IF sum MOD 3600 GE 1800.
        hour = sum / 3600 - 1.
      ELSE.
        hour = sum / 3600.
      ENDIF.
     
     
      IF ( sum MOD 3600 ) MOD 60 GE 30.
        min  = ( sum MOD 3600 ) / 60 - 1.
      ELSE.
        min  = ( sum MOD 3600 ) / 60.
      ENDIF.
     
      sec = sum MOD 60.
     
      chr = hour.
      IF hour < 10.
        CONCATENATE 'Running(hh:mm:ss):0' chr ':' INTO text.
      ELSE.
        CONCATENATE 'Running(hh:mm:ss):' chr ':' INTO text.
      ENDIF.
     
     
      chr = min.
      IF min < 10.
        CONCATENATE text '0' chr ':' INTO text.
      ELSE.
        CONCATENATE text chr ':' INTO text.
      ENDIF.
     
      chr = sec.
      IF sec < 10.
        CONCATENATE text '0' chr INTO text.
      ELSE.
        CONCATENATE text chr INTO text.
      ENDIF.
     
      WAIT UP TO 5 SECONDS.
    ENDDO.
    

你可能感兴趣的:(SAP,干货,SAP)