A tool to review detail of all saved queries for a given user

Created by Jerry Wang, last modified on Jun 08, 2015

requirement: you have created many saved queries and you would like to get a list of all of them. By double clicking the list item, you can navigate to the detail of each.

 

report source code: 

 

 

*&---------------------------------------------------------------------*

 

*& Report  ZVIEW_SAVED_QUERY

 

*&

 

*&---------------------------------------------------------------------*

 

*&

 

*&

 

*&---------------------------------------------------------------------*

 

REPORT zview_saved_query.

 

 

DATA: lt_saved_query TYPE STANDARD TABLE OF crmd_shortcut,

 

      ls_saved_query LIKE LINE OF lt_saved_query,

 

      ls_d_query     TYPE crmt_dyn_query,

 

      lv_guid        TYPE char4 VALUE 'guid',

 

      lv_type        TYPE char4 VALUE 'type',

 

      lv_app         TYPE char10 VALUE 'application',

 

      lv_desc        TYPE string VALUE 'description'.

 

 

START-OF-SELECTION.

 

  SELECT * INTO TABLE lt_saved_query FROM crmd_shortcut WHERE owner_key = sy-uname.

 

 

  WRITE: lv_guid COLOR COL_NEGATIVE, lv_type COLOR COL_POSITIVE, lv_app COLOR

 

  COL_GROUP, lv_desc COLOR COL_KEY.

 

  LOOP AT lt_saved_query INTO ls_saved_query.

 

    WRITE: / ls_saved_query-guid UNDER lv_guid, ls_saved_query-type,

 

    ls_saved_query-application, ls_saved_query-description.

 

    HIDE ls_saved_query-guid.

 

  ENDLOOP.

 

 

AT LINE-SELECTION.

 

  PERFORM display_detail USING ls_saved_query-guid.

 

 

FORM display_detail USING iv_guid TYPE crmd_shortcut-guid.

 

  READ TABLE lt_saved_query ASSIGNING FIELD-SYMBOL(<hit>)

 

    WITH KEY guid = iv_guid.

 

  ASSERT sy-subrc = 0.

 

 

  SELECT SINGLE * INTO ls_d_query FROM crmt_dyn_query

 

     WHERE query_id = <hit>-parameter_.

 

 

    ASSERT sy-subrc = 0.

 

 

    cl_demo_output=>display_xml( ls_d_query-selection_param ).

 

ENDFORM.


要获取更多Jerry的原创文章,请关注公众号"汪子熙":
展开阅读全文
©️2020 CSDN 皮肤主题: 深蓝海洋 设计师: CSDN官方博客 返回首页
实付0元
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值