*&---------------------------------------------------------------------*
*& Report ZNN_MD_USAGE
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT znn_md_usage.
TYPE-POOLS:
rsddv,
rsd.
TABLES:
dd02l.
DATA:
l_valtable TYPE dd02l-tabname,
l_obj_sid TYPE i,
l_iobjnm TYPE rsd_iobjnm,
lt_outl_sid TYPE rrsi_t_sid,
lt_outl_sid_used TYPE rsr_th_sid,
lt_ulist_sid TYPE rsddv_t_ulist_sid,
lt_ulist_dim TYPE rsddv_t_ulist_dim,
lt_ulist_mdata TYPE rsddv_t_ulist_mdata,
lt_ulist_atr TYPE rsddv_t_ulist_atr,
lt_ulist_atr_nav TYPE rsddv_t_ulist_atr,
lt_ulist_cmp TYPE rsddv_t_ulist_cmp,
lt_ulist_hie TYPE rsddv_t_ulist_hie,
lt_ulist_hie_node TYPE rsddv_t_ulist_hie_node,
lt_ulist_query TYPE rsddv_t_ulist_query,
lt_ulist_odso TYPE rsddv_t_ulist_odso,
gc_alv_table TYPE REF TO cl_salv_table,
gc_columns TYPE REF TO cl_salv_columns_table,
gc_colwork TYPE REF TO cl_salv_column_table,
tab_name TYPE lvc_title.
FIELD-SYMBOLS:
<so_val> TYPE rrrange,
<lt_ulist_dim> LIKE LINE OF lt_ulist_dim,
<lt_ulist_atr_nav> LIKE LINE OF lt_ulist_atr_nav,
<lt_ulist_odso> LIKE LINE OF lt_ulist_odso.
*&---------------------------------------------------------------------*
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS:
l_iobj TYPE rsdiobjv-iobjnm OBLIGATORY. " rsd_iobjnm.
SELECTION-SCREEN END OF BLOCK b1.
l_valtable = '/BIC/S' && l_iobj. " модный in-line
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
SELECT-OPTIONS:
lt_val FOR (l_valtable) NO INTERVALS.
SELECTION-SCREEN END OF BLOCK b2.
*&---------------------------------------------------------------------*
*& Report ZNN_MD_USAGE
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT znn_md_usage.
TYPE-POOLS:
rsddv,
rsd.
TABLES:
dd02l.
DATA:
l_valtable TYPE dd02l-tabname,
l_obj_sid TYPE i,
l_iobjnm TYPE rsd_iobjnm,
lt_outl_sid TYPE rrsi_t_sid,
lt_outl_sid_used TYPE rsr_th_sid,
lt_ulist_sid TYPE rsddv_t_ulist_sid,
lt_ulist_dim TYPE rsddv_t_ulist_dim,
lt_ulist_mdata TYPE rsddv_t_ulist_mdata,
lt_ulist_atr TYPE rsddv_t_ulist_atr,
lt_ulist_atr_nav TYPE rsddv_t_ulist_atr,
lt_ulist_cmp TYPE rsddv_t_ulist_cmp,
lt_ulist_hie TYPE rsddv_t_ulist_hie,
lt_ulist_hie_node TYPE rsddv_t_ulist_hie_node,
lt_ulist_query TYPE rsddv_t_ulist_query,
lt_ulist_odso TYPE rsddv_t_ulist_odso,
gc_alv_table TYPE REF TO cl_salv_table,
gc_columns TYPE REF TO cl_salv_columns_table,
gc_colwork TYPE REF TO cl_salv_column_table,
tab_name TYPE lvc_title.
FIELD-SYMBOLS:
<so_val> TYPE rrrange,
<lt_ulist_dim> LIKE LINE OF lt_ulist_dim,
<lt_ulist_atr_nav> LIKE LINE OF lt_ulist_atr_nav,
<lt_ulist_odso> LIKE LINE OF lt_ulist_odso.
*&---------------------------------------------------------------------*
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS:
l_iobj TYPE rsdiobjv-iobjnm OBLIGATORY. " rsd_iobjnm.
SELECTION-SCREEN END OF BLOCK b1.
l_valtable = '/BIC/S' && l_iobj. " модный in-line
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
SELECT-OPTIONS:
lt_val FOR (l_valtable) NO INTERVALS.
SELECTION-SCREEN END OF BLOCK b2.
*&---------------------------------------------------------------------*
AT SELECTION-SCREEN.
LOOP AT lt_val.
CALL FUNCTION 'RRSI_VAL_SID_CONVERT_COMPLETE'
EXPORTING
i_iobjnm = l_iobj
i_chavl = lt_val-low
IMPORTING
e_sid = l_obj_sid.
APPEND l_obj_sid TO lt_outl_sid.
ENDLOOP.
l_iobjnm = l_iobj.
CALL FUNCTION 'RSDDCVER_USAGE_MDATA_BY_SID'
EXPORTING
i_iobjnm = l_iobjnm
i_t_sid_check = lt_outl_sid
i_first_call = 'X'
IMPORTING
e_t_ulist_sid = lt_ulist_sid
e_t_ulist_dim = lt_ulist_dim
e_t_ulist_mdata = lt_ulist_mdata
e_t_ulist_atr = lt_ulist_atr
e_t_ulist_atr_nav = lt_ulist_atr_nav
e_t_ulist_cmp = lt_ulist_cmp
e_t_ulist_hie = lt_ulist_hie
e_t_ulist_hie_node = lt_ulist_hie_node
e_t_ulist_query = lt_ulist_query
e_t_ulist_odso = lt_ulist_odso
CHANGING
c_th_sid_used = lt_outl_sid_used.
tab_name = 'Sids'.
PERFORM display_table CHANGING lt_ulist_sid tab_name.
tab_name = 'Dimmensions'.
PERFORM display_table CHANGING lt_ulist_dim tab_name.
tab_name = 'MD'.
PERFORM display_table CHANGING lt_ulist_mdata tab_name.
tab_name = 'Attributes'.
PERFORM display_table CHANGING lt_ulist_atr tab_name.
tab_name = 'Attributes navigations'.
PERFORM display_table CHANGING lt_ulist_atr_nav tab_name.
tab_name = 'Cmp'.
PERFORM display_table CHANGING lt_ulist_cmp tab_name.
tab_name = 'Hierarhy'.
PERFORM display_table CHANGING lt_ulist_hie tab_name.
tab_name = 'Hierarhy nodes'.
PERFORM display_table CHANGING lt_ulist_hie_node tab_name.
tab_name = 'Query'.
PERFORM display_table CHANGING lt_ulist_query tab_name.
tab_name = 'Odso'.
PERFORM display_table CHANGING lt_ulist_odso tab_name.
*&---------------------------------------------------------------------*
FORM display_table CHANGING outtab TYPE ANY TABLE
tab_name TYPE lvc_title.
DATA:
lt_components TYPE cl_abap_structdescr=>component_table,
ls_components LIKE LINE OF lt_components,
columnname TYPE lvc_fname,
value TYPE scrtext_l,
gc_display TYPE REF TO cl_salv_display_settings..
*-----------------------------------------------------------------------
IF outtab IS NOT INITIAL.
cl_salv_table=>factory( IMPORTING r_salv_table = gc_alv_table
CHANGING t_table = outtab[] ).
gc_columns = gc_alv_table->get_columns( ).
lt_components = CAST cl_abap_structdescr(
CAST cl_abap_tabledescr(
cl_abap_tabledescr=>describe_by_data_ref( REF #( outtab ) )
)->get_table_line_type( )
)->get_components( ). " модный in-line
LOOP AT lt_components INTO ls_components.
columnname = value = ls_components-name.
gc_colwork ?= gc_columns->get_column( columnname ).
gc_colwork->set_long_text( value ).
ENDLOOP.
gc_display = gc_alv_table->get_display_settings( ).
gc_display->set_list_header( tab_name ).
gc_alv_table->display( ).
ENDIF.
ENDFORM.
*&---------------------------------------------------------------------*
Комментариев нет:
Отправить комментарий