统计SAP BW BEx Query使用情况

    我们对客户实施的SAP BW系统已经有将近一年的时间了,前两天突然有个需求,想对之前开发的报表使用情况做一个统计,所以就有了这个程序。


*&---------------------------------------------------------------------*
*& Report  ZBW_BEXQUERY_USAGE
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  zbw_bexquery_usage.

TABLES:rsddstat_olap.

TYPES: BEGIN OF typ_data,
          objname LIKE rsddstat_olap-objname,
          stepuid LIKE rsddstat_olap-stepuid,
       END OF typ_data.
DATA: gt_data TYPE TABLE OF typ_data WITH HEADER LINE.


TYPES: BEGIN OF typ_line,
          objname LIKE rsddstat_olap-objname,
          number TYPE p,
       END OF typ_line.
DATA: gt_line TYPE TABLE OF typ_line WITH HEADER LINE.
DATA: gt_result TYPE TABLE OF typ_line WITH HEADER LINE.


SELECTION-SCREEN BEGIN OF BLOCK blk01 WITH FRAME.

SELECT-OPTIONS: p_day FOR rsddstat_olap-calday.

SELECTION-SCREEN END OF BLOCK blk01.


START-OF-SELECTION.
  PERFORM select_data.
  PERFORM show_data.

END-OF-SELECTION.
*&---------------------------------------------------------------------*
*&      Form  SELECT_DATA
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM select_data .

  SELECT objname stepuid INTO CORRESPONDING FIELDS OF TABLE gt_data
    FROM rsddstat_olap
    WHERE calday IN p_day
    AND objname NE ''
    AND handletp = 'OLAP'
    AND STEPTP = 'BEX'
    ORDER BY objname stepuid.

  DELETE ADJACENT DUPLICATES FROM gt_data.

  LOOP AT gt_data.
    gt_line-objname = gt_data-objname.
    gt_line-number = 1.

    COLLECT gt_line.
  ENDLOOP.

ENDFORM.                    " SELECT_DATA
*&---------------------------------------------------------------------*
*&      Form  SHOW_DATA
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM show_data .

  LOOP AT gt_line.
    WRITE:/ gt_line-objname, gt_line-number.
  ENDLOOP.

ENDFORM.                    " SHOW_DATA


你可能感兴趣的:(query,BW,BEx)