Программа:
RSPC_MAINTAIN_SINGLE - Ведение цепочек процесов (1 цепочка)
Делаем из неё FM и если в Z-интерфейсе запускаем цепочку через RSPC_CHAIN_START, то делаем кнопку, чтобы сразу в лог провалиться.
На всякий случай код:
*&---------------------------------------------------------------------*
*& Report RSPC_MAINTAIN *
*& *
*&---------------------------------------------------------------------*
*& *
*& *
*&---------------------------------------------------------------------*
report rspc_maintain_single .
parameters: chain type rspc_chain,
logid type rspc_logid,
display type rs_bool as checkbox default 'X'.
data: l_bwclient type symandt.
call function 'RSCC_RSADM_ACC'
exporting
fieldname = 'BWMANDT'
action = 'S'
changing
adminvalue = l_bwclient
exceptions
others = 1.
if sy-subrc <> 0 or l_bwclient <> sy-mandt.
* ==== no BW or non BW client: call old TA ====
data: l_t_chaint type rspc_t_chaint,
l_mode type rspc_frontendmode.
if not logid is initial.
l_mode = 'LOG'.
else.
l_mode = 'PLAN'.
endif.
call function 'RSPC_CHAIN_MAINTAIN'
exporting
i_chain = chain
i_mode = l_mode
i_logid = logid
i_display_only = display
importing
e_t_chaint = l_t_chaint
exceptions
internal_error = 1
aborted_by_user = 2
others = 3.
if sy-subrc <> 0.
message id sy-msgid type 'S' number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
display like 'E'.
endif.
export chaint from l_t_chaint to memory id 'CHAIN'.
else.
* ==== BW client: Call DWB ====
data: l_r_request type ref to cl_rsawbn_request,
l_objnm type rsawbnobjnm,
l_fcode type syucomm.
data: l_r_state type ref to cl_rspc_awb_navistack,
l_s_navi type rspc_s_navistack.
l_objnm = chain.
if not logid is initial.
l_fcode = rsawc_c_tfc-display_log.
l_s_navi-tree = 'LOGS'.
l_s_navi-mode = 'LOG'.
elseif display = 'X'.
l_fcode = rsawc_c_tfc-display.
clear l_s_navi-tree.
l_s_navi-mode = 'PLAN'.
else.
l_fcode = rsawc_c_tfc-change.
l_s_navi-tree = 'RSPV'.
l_s_navi-mode = 'PLAN'.
endif.
create object l_r_request
exporting
i_awbobj = rs_c_tlogo-process_chain
i_objnm = l_objnm
i_fcode = l_fcode.
l_s_navi-view = 'C'.
l_s_navi-display_only = display.
create object l_r_state
exporting
i_s_navistack = l_s_navi
i_logid = logid.
call method l_r_request->set_external_call_state
exporting
i_r_state = l_r_state.
cl_rsawbn_awb=>start( i_r_request = l_r_request ).
endif.
RSPC_MAINTAIN_SINGLE - Ведение цепочек процесов (1 цепочка)
Делаем из неё FM и если в Z-интерфейсе запускаем цепочку через RSPC_CHAIN_START, то делаем кнопку, чтобы сразу в лог провалиться.
На всякий случай код:
*&---------------------------------------------------------------------*
*& Report RSPC_MAINTAIN *
*& *
*&---------------------------------------------------------------------*
*& *
*& *
*&---------------------------------------------------------------------*
report rspc_maintain_single .
parameters: chain type rspc_chain,
logid type rspc_logid,
display type rs_bool as checkbox default 'X'.
data: l_bwclient type symandt.
call function 'RSCC_RSADM_ACC'
exporting
fieldname = 'BWMANDT'
action = 'S'
changing
adminvalue = l_bwclient
exceptions
others = 1.
if sy-subrc <> 0 or l_bwclient <> sy-mandt.
* ==== no BW or non BW client: call old TA ====
data: l_t_chaint type rspc_t_chaint,
l_mode type rspc_frontendmode.
if not logid is initial.
l_mode = 'LOG'.
else.
l_mode = 'PLAN'.
endif.
call function 'RSPC_CHAIN_MAINTAIN'
exporting
i_chain = chain
i_mode = l_mode
i_logid = logid
i_display_only = display
importing
e_t_chaint = l_t_chaint
exceptions
internal_error = 1
aborted_by_user = 2
others = 3.
if sy-subrc <> 0.
message id sy-msgid type 'S' number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
display like 'E'.
endif.
export chaint from l_t_chaint to memory id 'CHAIN'.
else.
* ==== BW client: Call DWB ====
data: l_r_request type ref to cl_rsawbn_request,
l_objnm type rsawbnobjnm,
l_fcode type syucomm.
data: l_r_state type ref to cl_rspc_awb_navistack,
l_s_navi type rspc_s_navistack.
l_objnm = chain.
if not logid is initial.
l_fcode = rsawc_c_tfc-display_log.
l_s_navi-tree = 'LOGS'.
l_s_navi-mode = 'LOG'.
elseif display = 'X'.
l_fcode = rsawc_c_tfc-display.
clear l_s_navi-tree.
l_s_navi-mode = 'PLAN'.
else.
l_fcode = rsawc_c_tfc-change.
l_s_navi-tree = 'RSPV'.
l_s_navi-mode = 'PLAN'.
endif.
create object l_r_request
exporting
i_awbobj = rs_c_tlogo-process_chain
i_objnm = l_objnm
i_fcode = l_fcode.
l_s_navi-view = 'C'.
l_s_navi-display_only = display.
create object l_r_state
exporting
i_s_navistack = l_s_navi
i_logid = logid.
call method l_r_request->set_external_call_state
exporting
i_r_state = l_r_state.
cl_rsawbn_awb=>start( i_r_request = l_r_request ).
endif.
Комментариев нет:
Отправить комментарий