选择屏幕多页签、动态访问后台表

*&---------------------------------------------------------------------*
*& Report ZFMR002
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
report ZFMR002.

tables:SSCRFIELDS.

*SAP基础配置
selection-screen: begin of screen 100 as subscreen,
                  begin of block B1 with frame title text-000,
                  skip,
                  pushbutton /1(42) text-001 user-command ZT001,
                  pushbutton 52(42) text-002 user-command ZTCSKS,
                  pushbutton /1(42) text-003 user-command ZTSKA1,
                  pushbutton 52(42) text-004 user-command ZTFCTR,
                  pushbutton /1(42) text-005 user-command ZTFMCI,
                  pushbutton 52(42) text-006 user-command ZTXJLL,
                  "PUSHBUTTON /1(42) TEXT-007 USER-COMMAND zt2501,
                  "PUSHBUTTON 52(42) TEXT-008 USER-COMMAND zt2503,
                  end of block B1,
                  end of screen 100.
*OA组织结构
selection-screen: begin of screen 200 as subscreen,
                  begin of block B2 with frame title text-009,
                  skip,
                  pushbutton /1(42) text-010 user-command ZTUNIT,
                  pushbutton 52(42) text-011 user-command ZTDEPT,
                  "PUSHBUTTON /1(42) TEXT-012 USER-COMMAND ztjob,
                  pushbutton /1(42) text-013 user-command ZTGRADE,
                  "PUSHBUTTON /1(42) TEXT-014 USER-COMMAND ztpost,
                  pushbutton 52(42) text-015 user-command ZTHR01,
                  end of block B2,
                  end of screen 200.
*FK基础配置
*selection-screen: begin of screen 300 as subscreen,
*                  begin of block B3 with frame title text-016,
*                  skip,
*                  pushbutton /1(42) text-017 user-command ZTGJAHR,
*                  pushbutton 52(42) text-018 user-command ZTJKTYP,
*                  pushbutton /1(42) text-019 user-command ZTBDTYP,
*                  end of block B3,
*                  end of screen 300.
*FK个性化配置
selection-screen: begin of screen 400 as subscreen,
                  begin of block B4 with frame title text-020,
                  skip,
                  pushbutton /1(42) text-017 user-command ZTGJAHR,
                  pushbutton 52(42) text-018 user-command ZTJKTYP,
                  pushbutton /1(42) text-019 user-command ZTBDTYP,
                  pushbutton 52(42) text-021 user-command ZTFYTYP,
                  pushbutton /1(42) text-022 user-command ZTFXTYP,
                  pushbutton 52(42) text-023 user-command ZTDZBX,
                  pushbutton /1(42) text-024 user-command ZTFX_FMCI,
                  pushbutton 52(42) text-025 user-command ZTFY_SKA1,
                  pushbutton /1(42) text-026 user-command ZTINTYP,
                  pushbutton 52(42) text-027 user-command ZTKMDET,
                  "pushbutton 52(42) text-028 user-command ZTDZKM,
*                  pushbutton /1(42) text-029 user-command ZTFMPOINT,
                  "pushbutton /1(42) text-030 user-command ZTBXKM,
                  end of block B4,
                  end of screen 400.
*报销标准相关
selection-screen: begin of screen 500 as subscreen,
                  begin of block B5 with frame title text-031,
                  skip,
                  pushbutton /1(42) text-032 user-command ZTBXVER,
                  pushbutton 52(42) text-033 user-command ZTBXLVL,
                  pushbutton /1(42) text-034 user-command ZTBXLVLMAN,
                  pushbutton 52(42) text-035 user-command ZTJTUTL,
                  pushbutton /1(42) text-036 user-command ZTCW,
                  pushbutton 52(42) text-037 user-command ZTDZBXLIST,
                  "pushbutton /1(42) text-038 user-command ZTZS,
                  pushbutton /1(42) text-040 user-command ZTBXSTD,
                  pushbutton 52(42) text-039 user-command ZTZSCITY,
                  "pushbutton 52(42) text-041 user-command ZTBXLVLPOSI,
                  "pushbutton /1(42) text-042 user-command ZTLVLMAN,
                  end of block B5,
                  end of screen 500.
*付款相关配置
selection-screen: begin of screen 600 as subscreen,
                  begin of block B6 with frame title text-043,
                  skip,
                  pushbutton /1(42) text-044 user-command ZTFKFS,
                  pushbutton 52(42) text-045 user-command ZTPAYTYP,
                  pushbutton /1(42) text-046 user-command ZTSKEMP,
                  pushbutton 52(42) text-047 user-command ZTSKEMPFK,
                  pushbutton /1(42) text-048 user-command ZTFKFACC,
                  end of block B6,
                  end of screen 600.
*银行相关配置
selection-screen: begin of screen 700 as subscreen,
                  begin of block B7 with frame title text-049,
                  skip,
                  pushbutton /1(42) text-050 user-command ZTBANK,
                  pushbutton 52(42) text-051 user-command ZTBKCITY,
                  pushbutton /1(42) text-052 user-command ZTBKTNR,
                  pushbutton 52(42) text-053 user-command ZTBANKACC,
                  end of block B7,
                  end of screen 700.
*流程配置
selection-screen: begin of screen 800 as subscreen,
                  begin of block B8 with frame title text-054,
                  skip,
                  pushbutton /1(42) text-055 user-command ZTPRO_NODE_OPER,
                  pushbutton 52(42) text-056 user-command ZTPRO_NODE_ACT,
                  pushbutton /1(42) text-057 user-command ZTPRO_RETN_MODE,
                  pushbutton 52(42) text-058 user-command ZTPRO_CFG,
                  pushbutton /1(42) text-059 user-command ZTPRO_NODE_CFG,
                  pushbutton 52(42) text-060 user-command ZTPRO_NODE_REL,
                  pushbutton /1(42) text-061 user-command ZTPRO_NODE_LINE,
                  pushbutton 52(42) text-062 user-command ZTPRO_ROLE_CFG,
                  pushbutton /1(42) text-063 user-command ZTPRO_NODE_ROLE,
                  pushbutton 52(42) text-064 user-command ZTPRO_ROLE_USER,
                  "pushbutton /1(42) text-065 user-command ZTPRO_SKIP_NODE,
                  pushbutton /1(42) text-066 user-command ZTPRO_ASSIGN_CFG,
                  end of block B8,
                  begin of block B9 with frame title text-068,
                  skip,
                  pushbutton /1(42) text-069 user-command ZVCPRO,
                  end of block B9,
                  end of screen 800.

selection-screen: begin of block B0 with frame title text-067.
parameters P_SHOW as checkbox default ABAP_FALSE.
selection-screen: end of block B0.

selection-screen: begin of tabbed block TBLOCK for 18 lines,
                  tab (20) text-000 user-command PUSH1 default screen 100,
                  tab (20) text-009 user-command PUSH2 default screen 200,
                  "tab (20) text-016 user-command PUSH3 default screen 300,
                  tab (20) text-020 user-command PUSH4 default screen 400,
                  tab (20) text-031 user-command PUSH5 default screen 500,
                  tab (20) text-043 user-command PUSH6 default screen 600,
                  tab (20) text-049 user-command PUSH7 default screen 700,
                  tab (20) text-054 user-command PUSH8 default screen 800,
                  end of block TBLOCK.

at selection-screen.

  if P_SHOW = ABAP_TRUE.
    data(LV_ACTION) = 'S'.
  else.
    LV_ACTION = 'U'.
  endif.

  if SSCRFIELDS-UCOMM(2) = 'ZT'.
    data(LV_VIEW) = value DD25V-VIEWNAME( ).
    LV_VIEW = SSCRFIELDS-UCOMM.

    call function 'VIEW_AUTHORITY_CHECK'
      exporting
        VIEW_NAME                      = LV_VIEW
      exceptions
        INVALID_ACTION                 = 1
        NO_AUTHORITY                   = 2
        NO_CLIENTINDEPENDENT_AUTHORITY = 3
        TABLE_NOT_FOUND                = 4
        NO_LINEDEPENDENT_AUTHORITY     = 5
        others                         = 6.
    if SY-SUBRC = 0.
      call function 'VIEW_MAINTENANCE_CALL'
        exporting
          ACTION                       = LV_ACTION
          VIEW_NAME                    = LV_VIEW
        exceptions
          CLIENT_REFERENCE             = 1
          FOREIGN_LOCK                 = 2
          INVALID_ACTION               = 3
          NO_CLIENTINDEPENDENT_AUTH    = 4
          NO_DATABASE_FUNCTION         = 5
          NO_EDITOR_FUNCTION           = 6
          NO_SHOW_AUTH                 = 7
          NO_TVDIR_ENTRY               = 8
          NO_UPD_AUTH                  = 9
          ONLY_SHOW_ALLOWED            = 10
          SYSTEM_FAILURE               = 11
          UNKNOWN_FIELD_IN_DBA_SELLIST = 12
          VIEW_NOT_FOUND               = 13
          MAINTENANCE_PROHIBITED       = 14
          others                       = 15.
      case SY-SUBRC.
        when 8.
          message '没有维护视图,请先创建!' type 'E'.
        when others.
      endcase.
    endif.

    clear:SSCRFIELDS-UCOMM, LV_VIEW.

  elseif SSCRFIELDS-UCOMM(3) = 'ZVC'.
    data(LV_VC) = conv VCLDIR-VCLNAME( SSCRFIELDS-UCOMM ).

    call function 'VIEWCLUSTER_MAINTENANCE_CALL'
      exporting
        VIEWCLUSTER_NAME             = LV_VC
        MAINTENANCE_ACTION           = LV_ACTION
      exceptions
        CLIENT_REFERENCE             = 1
        FOREIGN_LOCK                 = 2
        VIEWCLUSTER_NOT_FOUND        = 3
        VIEWCLUSTER_IS_INCONSISTENT  = 4
        MISSING_GENERATED_FUNCTION   = 5
        NO_UPD_AUTH                  = 6
        NO_SHOW_AUTH                 = 7
        OBJECT_NOT_FOUND             = 8
        NO_TVDIR_ENTRY               = 9
        NO_CLIENTINDEP_AUTH          = 10
        INVALID_ACTION               = 11
        SAVING_CORRECTION_FAILED     = 12
        SYSTEM_FAILURE               = 13
        UNKNOWN_FIELD_IN_DBA_SELLIST = 14
        MISSING_CORR_NUMBER          = 15
        others                       = 16.
    if SY-SUBRC <> 0.
      message '维护视图簇发生错误,请检查!' type 'E'.
    endif.

    clear:SSCRFIELDS-UCOMM,LV_VC.
  endif.

  clear LV_ACTION.
RIPRO主题是一个优秀的主题,极致后台体验,无插件,集成会员系统
SapiBook » 选择屏幕多页签、动态访问后台表

发表评论