Очистка кэша в кубах по инфо-области
*&---------------------------------------------------------------------*
*& Report Z_BW_CLEAR_CACHE_BY_CUBES_SO
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT Z_BW_CLEAR_CACHE_BY_IA.
TYPE-POOLS: RSD.
TABLES: RSDCUBE, RSDODSO, RSQISET.
parameters:
lp_ia TYPE string. " Info Area
DATA:
l_cube TYPE RSINFOCUBE,
range_tab LIKE RANGE OF l_cube,
range_line LIKE LINE OF range_tab,
lt_tmplist TYPE STANDARD TABLE OF RSINFOCUBE.
FIELD-SYMBOLS:
TYPE RSINFOCUBE.
clear range_line.
range_line-sign = 'I'.
range_line-option = 'CP'.
SELECT DISTINCT INFOCUBE
FROM RSDCUBE
INTO TABLE lt_tmplist
WHERE INFOAREA = lp_ia.
IF lt_tmplist[] IS NOT INITIAL.
LOOP AT lt_tmplist
ASSIGNING .
range_line-low = .
collect range_line into range_tab.
ENDLOOP.
ENDIF.
SELECT DISTINCT ODSOBJECT
FROM RSDODSO
INTO TABLE lt_tmplist
WHERE INFOAREA = lp_ia.
IF lt_tmplist[] IS NOT INITIAL.
LOOP AT lt_tmplist
ASSIGNING .
range_line-low = .
collect range_line into range_tab.
ENDLOOP.
ENDIF.
SELECT DISTINCT INFOSET
FROM RSQISET
INTO TABLE lt_tmplist
WHERE INFOAREA = lp_ia.
IF lt_tmplist[] IS NOT INITIAL.
LOOP AT lt_tmplist
ASSIGNING .
range_line-low = .
collect range_line into range_tab.
ENDLOOP.
ENDIF.
* Вызов очистки
SUBMIT Z_BW_CLEAR_CACHE_BY_CUBES
WITH cubelist IN range_tab
AND RETURN.
*&---------------------------------------------------------------------*
*& Report Z_BW_CLEAR_CACHE_BY_CUBES
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT Z_BW_CLEAR_CACHE_BY_CUBES.
TYPE-POOLS: RSD.
TABLES: RSDCUBE.
CLASS cl_rsr_cache_mm DEFINITION LOAD.
DATA:
p_r_mem_mon TYPE REF TO if_rsr_cache_memory_monitor,
p_s_mm TYPE rsrcb_s_mm,
p_r_mem TYPE REF TO if_rsr_cache_memory,
l_s_key TYPE rsrcb_s_key,
instance TYPE REF TO if_rsr_cache_mon,
n_r_mem TYPE REF TO cl_rsr_cache_mm,
p_t_alv TYPE rsrcc_t_alv,
l_s_mm_line TYPE rsrcb_s_mm_line,
l_s_alv TYPE rsrcc_s_alv,
l_flag TYPE c VALUE 'X',
l_cube TYPE RSINFOCUBE.
SELECT-OPTIONS cubelist FOR l_cube NO INTERVALS.
* correct input value, add mask
LOOP AT cubelist.
cubelist-option = 'CP'.
CONCATENATE cubelist-low '*'
INTO cubelist-low.
modify cubelist.
ENDLOOP.
WHILE l_flag = 'X'.
* на сколько я понял, в цикле сделано, для того, чтобы
* предотвратить появление кэша во время очистки
CALL METHOD cl_rsr_cache_qu_mon=>if_rsr_cache_mon~create
RECEIVING
r_r_instance = instance.
n_r_mem = cl_rsr_cache_mm=>create( 'm' ).
p_r_mem = n_r_mem.
p_r_mem_mon = n_r_mem.
p_s_mm = p_r_mem_mon->get_monitor_data( ).
LOOP AT p_s_mm-t_mm_line INTO l_s_mm_line.
MOVE-CORRESPONDING l_s_mm_line TO l_s_alv.
APPEND l_s_alv TO p_t_alv.
ENDLOOP.
CALL METHOD instance->get_prop
EXPORTING
i_r_mem = n_r_mem
CHANGING
c_t_alv = p_t_alv.
LOOP AT p_t_alv INTO l_s_alv
WHERE mem_id_ext IN cubelist.
EXIT.
ENDLOOP.
IF sy-subrc IS INITIAL.
l_s_key-mem_id = l_s_alv-mem_id.
l_s_key-log_id = l_s_alv-log_id.
p_r_mem->delete( l_s_key ).
ELSE.
CLEAR l_flag.
ENDIF.
CLEAR: p_t_alv[], l_s_alv.
ENDWHILE.
Комментариев нет:
Отправить комментарий