Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- *&---------------------------------------------------------------------*
- *& Report ZBC_SWWW_LOGS
- *&
- *&---------------------------------------------------------------------*
- *& Permet de lister les messages des étapes de workflows
- *&---------------------------------------------------------------------*
- report zbc_swww_logs.
- types:
- begin of ty_restit,
- wi_id type sww_wiid,
- method type sww_logact,
- meth_edate type sww_edate,
- meth_etime type sww_etime,
- log_count type sww_logcnt,
- meth_user type sww_aagent,
- workarea type arbgb,
- msgtype type symsgty,
- message type string,
- end of ty_restit.
- data:
- wf_header type swwwihead,
- wf_header_t type standard table of swwwihead,
- wf_id type sww_wiid,
- wf_log type swwloghist,
- wf_log_t type standard table of swwloghist.
- data:
- restit type ty_restit,
- restit_t type standard table of ty_restit.
- data:
- salv_table type ref to cl_salv_table,
- salv_functions type ref to cl_salv_functions,
- salv_columns type ref to cl_salv_columns_table,
- salv_column type ref to cl_salv_column_table,
- salv_color type lvc_s_colo.
- data:
- s1_datum type datum,
- s1_arbgb type arbgb,
- s1_wistat type sww_wistat.
- initialization.
- selection-screen begin of block b1.
- parameters
- p1_task type sww_task default 'WS92000002'.
- select-options:
- s1_clas for s1_arbgb default 'ZWFUSR',
- s1_stat for s1_wistat default 'ERROR',
- s1_date for s1_datum.
- selection-screen end of block b1.
- start-of-selection.
- " Selection
- select *
- from swwwihead
- into table wf_header_t
- where wi_rh_task = p1_task
- and wi_cd in s1_date
- and wi_stat in s1_stat.
- loop at wf_header_t into wf_header.
- select single wi_id
- from swwwihead
- into wf_id
- where wi_chckwi = wf_header-wi_id.
- if sy-subrc <> 0. continue. endif.
- select *
- from swwloghist
- appending table wf_log_t
- where wi_id = wf_id
- and workarea in s1_clas
- and workarea <> space.
- if sy-subrc eq 0.
- "append wf_log to wf_log_t.
- endif.
- endloop.
- " Restitution
- loop at wf_log_t into wf_log.
- restit-wi_id = wf_log-wi_id.
- restit-method = wf_log-method.
- restit-meth_edate = wf_log-meth_edate.
- restit-meth_etime = wf_log-meth_etime.
- restit-log_count = wf_log-log_count.
- restit-meth_user = wf_log-meth_user.
- restit-workarea = wf_log-workarea.
- restit-msgtype = wf_log-msgtype.
- message
- id wf_log-workarea
- type 'I' number wf_log-message
- with wf_log-variable1 wf_log-variable2 wf_log-variable3 wf_log-variable4
- into restit-message.
- append restit to restit_t.
- endloop.
- call method cl_salv_table=>factory(
- importing
- r_salv_table = salv_table
- changing
- t_table = restit_t ).
- salv_columns = salv_table->get_columns( ).
- salv_color-col = 6.
- salv_color-int = 1.
- salv_color-inv = 0.
- salv_column ?= salv_columns->get_column( 'MESSAGE' ).
- salv_column->set_long_text( 'Message' ).
- "salv_column->set_color( salv_color ).
- salv_columns->set_optimize( 'X' ).
- salv_functions = salv_table->get_functions( ).
- salv_functions->set_all( 'X' ).
- salv_table->display( ).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement