Select data from the Maintenance View

Select data from the Maintenance View
1.

select single lgnum from v_t320 into DATA(***) where werks eq p_i_werks and lgort eq p_i_lgort.
 CALL FUNCTION 'VIEW_MAINTENANCE_CALL'

EXPORTING

action = 'U'

view_name = 'table'

TABLES

dba_sellist = gt_typo

EXCEPTIONS

OTHERS = 14.
REPORT ymaintenance.
 
DATA:wf_tab TYPE REF TO data,
     repid  TYPE sy-repid.
 
FIELD-SYMBOLS: <fs_tab> TYPE table.
 
PARAMETERS:pa_view TYPE dd02v-tabname OBLIGATORY.
 
START-OF-SELECTION.
 
  FIELD-SYMBOLS: <f1> TYPE x,
                 <f2> TYPE x.
  DATA: BEGIN OF itab1 OCCURS 1,
          c TYPE c LENGTH 8192, " max length
        END OF itab1.
 
  CREATE DATA wf_tab TYPE TABLE OF (pa_view).
  IF wf_tab IS BOUND.
    ASSIGN wf_tab->* TO <fs_tab>.
    CHECK <fs_tab> IS ASSIGNED.
  ELSE.
    EXIT.
  ENDIF.
 
  CALL FUNCTION 'VIEW_GET_DATA'
    EXPORTING
      view_name              = pa_view
      with_authority_check   = 'X'
    TABLES
      data                   = itab1
    EXCEPTIONS
      no_viewmaint_tool      = 1
      no_authority           = 2
      no_auth_for_sel        = 3
      data_access_restricted = 4
      OTHERS                 = 5.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
 
  LOOP AT itab1 ASSIGNING <f1> CASTING.
    APPEND INITIAL LINE TO <fs_tab> ASSIGNING <f2> CASTING.
    <f2> = <f1>.
  ENDLOOP.
 
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_structure_name = pa_view
    TABLES
      t_outtab         = <fs_tab>
    EXCEPTIONS
      program_error    = 1
      OTHERS           = 2.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值