*&---------------------------------------------------------------------*
*& Report ZASTEST2
*&
*&---------------------------------------------------------------------*
*& Активация входящих\исходящих правил по объектам.
*&
*&---------------------------------------------------------------------*
*& Report ZASTEST2
*&
*&---------------------------------------------------------------------*
*& Активация входящих\исходящих правил по объектам.
*&
*&---------------------------------------------------------------------*
REPORT ZASTEST2.
*"----------------------------------------------------------------------
TYPES : BEGIN OF target_type ,
target TYPE sobj_name ,
END OF target_type .
DATA :
lt_targets TYPE TABLE OF target_type ,
ls_line LIKE LINE OF lt_targets ,
lf_trg TYPE rsinfocube ,
do_trans TYPE c ,
do_dtp TYPE c ,
g_r_dtp TYPE REF TO cl_rsbk_dtp ,
i_dtp TYPE rsbkdtpnm ,
t_dtp TYPE rsbk_t_dtp_detail ,
s_dtp LIKE LINE OF t_dtp ,
t_dtp1 TYPE rsbk_t_dtp_detail ,
l_subrc LIKE sy -subrc ,
g_r_trans TYPE REF TO cl_rstran_trfn ,
lt_trans TYPE TABLE OF rstran WITH HEADER LINE,
lf_trans_id LIKE lt_trans -tranid ,
ls_trans TYPE rstran .
*-----------------------------------------------------------------------
SELECT-OPTIONS : p_trg FOR lf_trg.
PARAMETERS : p_trans TYPE c DEFAULT 'X',
p_dtp TYPE c DEFAULT 'X' .
*-----------------------------------------------------------------------
BREAK-POINT ID break.
LOOP AT p_trg.
ls_line- target = p_trg -low . APPEND ls_line TO lt_targets.
ENDLOOP .
IF p_trans IS NOT INITIAL .
SELECT *
INTO TABLE lt_trans
FROM rstran
FOR ALL ENTRIES IN lt_targets
WHERE targetname = lt_targets -target
OR sourcename = lt_targets - target.
SORT lt_trans BY tranid .
DELETE ADJACENT DUPLICATES FROM lt_trans COMPARING tranid .
LOOP AT lt_trans.
lf_trans_id = lt_trans -tranid .
g_r_trans = cl_rstran_trfn =>factory ( i_tranid = lf_trans_id ).
IF sy- subrc = 0 .
CALL METHOD g_r_trans ->if_rso_tlogo_maintain ~ activate
EXPORTING
i_show_check_protocol = rs_c_false
i_force_activation = rs_c_true
i_with_cto = 'X'
IMPORTING
e_subrc = l_subrc.
ENDIF .
ENDLOOP .
WRITE : 'ok' .
ENDIF .
IF p_dtp IS NOT INITIAL .
t_dtp = cl_rsbk_dtp =>get_all ( ).
t_dtp1[] = t_dtp[] .
LOOP AT t_dtp INTO s_dtp .
READ TABLE lt_targets
INTO ls_line
WITH KEY target = s_dtp - tgt.
IF sy- subrc NE 0 .
READ TABLE lt_targets
INTO ls_line
WITH KEY target = s_dtp - src.
IF sy -subrc NE 0.
DELETE t_dtp1 WHERE dtp = s_dtp- dtp .
ENDIF .
ENDIF .
ENDLOOP .
t_dtp[] = t_dtp1[].
LOOP AT t_dtp INTO s_dtp .
i_dtp = s_dtp -dtp .
g_r_dtp = cl_rsbk_dtp =>factory ( i_dtp ).
IF sy- subrc = 0 .
WRITE : / i_dtp.
CALL METHOD g_r_dtp ->activate
EXPORTING
i_show_check_protocol = rs_c_false
i_force_activation = rs_c_true
i_with_cto = 'X'
IMPORTING
e_subrc = l_subrc.
ENDIF .
ENDLOOP .
ENDIF .
TYPES : BEGIN OF target_type ,
target TYPE sobj_name ,
END OF target_type .
DATA :
lt_targets TYPE TABLE OF target_type ,
ls_line LIKE LINE OF lt_targets ,
lf_trg TYPE rsinfocube ,
do_trans TYPE c ,
do_dtp TYPE c ,
g_r_dtp TYPE REF TO cl_rsbk_dtp ,
i_dtp TYPE rsbkdtpnm ,
t_dtp TYPE rsbk_t_dtp_detail ,
s_dtp LIKE LINE OF t_dtp ,
t_dtp1 TYPE rsbk_t_dtp_detail ,
l_subrc LIKE sy -subrc ,
g_r_trans TYPE REF TO cl_rstran_trfn ,
lt_trans TYPE TABLE OF rstran WITH HEADER LINE,
lf_trans_id LIKE lt_trans -tranid ,
ls_trans TYPE rstran .
*-----------------------------------------------------------------------
SELECT-OPTIONS : p_trg FOR lf_trg.
PARAMETERS : p_trans TYPE c DEFAULT 'X',
p_dtp TYPE c DEFAULT 'X' .
*-----------------------------------------------------------------------
BREAK-POINT ID break.
LOOP AT p_trg.
ls_line- target = p_trg -low . APPEND ls_line TO lt_targets.
ENDLOOP .
IF p_trans IS NOT INITIAL .
SELECT *
INTO TABLE lt_trans
FROM rstran
FOR ALL ENTRIES IN lt_targets
WHERE targetname = lt_targets -target
OR sourcename = lt_targets - target.
SORT lt_trans BY tranid .
DELETE ADJACENT DUPLICATES FROM lt_trans COMPARING tranid .
LOOP AT lt_trans.
lf_trans_id = lt_trans -tranid .
g_r_trans = cl_rstran_trfn =>factory ( i_tranid = lf_trans_id ).
IF sy- subrc = 0 .
CALL METHOD g_r_trans ->if_rso_tlogo_maintain ~ activate
EXPORTING
i_show_check_protocol = rs_c_false
i_force_activation = rs_c_true
i_with_cto = 'X'
IMPORTING
e_subrc = l_subrc.
ENDIF .
ENDLOOP .
WRITE : 'ok' .
ENDIF .
IF p_dtp IS NOT INITIAL .
t_dtp = cl_rsbk_dtp =>get_all ( ).
t_dtp1[] = t_dtp[] .
LOOP AT t_dtp INTO s_dtp .
READ TABLE lt_targets
INTO ls_line
WITH KEY target = s_dtp - tgt.
IF sy- subrc NE 0 .
READ TABLE lt_targets
INTO ls_line
WITH KEY target = s_dtp - src.
IF sy -subrc NE 0.
DELETE t_dtp1 WHERE dtp = s_dtp- dtp .
ENDIF .
ENDIF .
ENDLOOP .
t_dtp[] = t_dtp1[].
LOOP AT t_dtp INTO s_dtp .
i_dtp = s_dtp -dtp .
g_r_dtp = cl_rsbk_dtp =>factory ( i_dtp ).
IF sy- subrc = 0 .
WRITE : / i_dtp.
CALL METHOD g_r_dtp ->activate
EXPORTING
i_show_check_protocol = rs_c_false
i_force_activation = rs_c_true
i_with_cto = 'X'
IMPORTING
e_subrc = l_subrc.
ENDIF .
ENDLOOP .
ENDIF .
*-----------------------------------------------------------------------
Комментариев нет:
Отправить комментарий