Posted: Sun Mar 16, 2008 11:57 pm Post subject: Analysis of execution processes
Code:
************************************************************************
* TITULO : Análisis de ejecución de procesos *
* *
* DESCRIPCION : Versión simplificada del análisis de trabajo en SAP *
* (Trans. ST03) que permite fácilmente ver que programas *
* se han ejecutado en periodos cercanos *
* *
* AUTOR: Andrés Picazo (http://www.sapabap.cc) FECHA: 24/05/2002 *
* *
************************************************************************
REPORT rsamon50
NO STANDARD PAGE HEADING
MESSAGE-ID v9
LINE-COUNT 065
LINE-SIZE 080.
*------TABLAS INTERNAS-------------------------------------------------*
DATA: BEGIN OF monikeydd, "Schluessel bei MONI Ex/Import
systemid(2), "Systemnummer
cpuid(8), "Server name
type(4), "Art der Daten
datum LIKE sy-datum, "Datum
END OF monikeydd.
DATA: BEGIN OF sta_per OCCURS 10.
INCLUDE STRUCTURE statp.
DATA: END OF sta_per.
DATA: BEGIN OF i_datos OCCURS 0.
INCLUDE STRUCTURE sapwlustcx.
DATA: END OF i_datos.
DATA: BEGIN OF i_list OCCURS 0,
uname LIKE bpin-uname,
tcode LIKE resab-tcode,
repid LIKE TSTC-PGMNA,
JOB LIKE BTCH2170-JOBNAME,
END OF i_list.
DATA: sta_per_2 LIKE sapwlacctp-startdate.
DATA: g_instance LIKE sapwlserv-name.
DATA: k_laenge TYPE i.
*------PARAMETER/SELECT-OPTIONS EN PANTALLA----------------------------*
SELECTION-SCREEN BEGIN OF BLOCK blk_par WITH FRAME.
SELECT-OPTIONS: s_uname FOR sy-uname,
s_repid for sy-repid.
SELECTION-SCREEN END OF BLOCK blk_par.
SELECTION-SCREEN BEGIN OF BLOCK a1 WITH FRAME TITLE text-001.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: p_list RADIOBUTTON GROUP b1.
SELECTION-SCREEN COMMENT 6(65) FOR FIELD p_list.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: p_deta RADIOBUTTON GROUP b1.
SELECTION-SCREEN COMMENT 6(65) FOR FIELD p_deta.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK a1.
********************************** ALV *********************************
TYPE-POOLS: slis.
DATA: alv_fieldtab TYPE slis_t_fieldcat_alv,
alv_heading TYPE slis_t_listheader,
alv_layout TYPE slis_layout_alv,
alv_events TYPE slis_t_event,
alv_sort TYPE slis_t_sortinfo_alv,
alv_filter TYPE slis_t_filter_alv,
alv_repname LIKE sy-repid,
alv_f2code LIKE sy-ucomm VALUE '&ETA',
alv_g_save(1) TYPE c,
alv_g_exit(1) TYPE c.
DATA: alv_fieldcat TYPE slis_fieldcat_alv.
************************************************************************
*
* LOGICA DEL PROGRAMA
*
************************************************************************
IF p_deta = 'X'.
PERFORM alv_write_output TABLES i_datos USING 'I_DATOS'.
ELSE.
LOOP AT i_datos.
CLEAR i_list.
i_list-uname = i_datos-account.
IF i_datos-entry_id+72(1) = 'T'.
i_list-tcode = i_datos-entry_id(20).
IF i_datos-entry_id(1) = 'Z'.
SELECT SINGLE PGMNA FROM TSTC
INTO I_LIST-REPID
WHERE TCODE = I_LIST-TCODE.
ENDIF.
ELSEIF i_datos-entry_id+72(1) = 'R'.
i_list-repid = i_datos-entry_id(20).
IF NOT i_datos-entry_id+40(20) IS INITIAL.
I_LIST-JOB = i_datos-entry_id+40(20).
ENDIF.
ENDIF.
if i_list-repid in s_repid or
i_list-tcode in s_repid.
APPEND i_list.
endif.
ENDLOOP.
PERFORM alv_write_output TABLES i_list USING 'I_LIST'.
ENDIF.
************************************************************************
*
* FORMS ADICIONALES
*
************************************************************************
*&---------------------------------------------------------------------*
*& Form SELECCIONAR_DATOS
*&---------------------------------------------------------------------*
* Seleccionar datos y guardarlos en la tabla I_DATOS.
*----------------------------------------------------------------------*
FORM seleccionar_datos.
IF monikeydd IS INITIAL.
CALL FUNCTION 'MONI_DATA_PERIOD_DETERMINE'
IMPORTING
monikeydd = monikeydd
speriod = sta_per
instance = g_instance
EXCEPTIONS
no_selection = 1.
IF NOT sy-subrc IS INITIAL.
MESSAGE i006.
LEAVE PROGRAM.
ENDIF.
ENDIF.
IF sta_per-term4 IS INITIAL.
sta_per_2 = sy-datum.
ELSE.
sta_per_2 = sta_per-term4.
ENDIF.
DELETE i_datos WHERE NOT account IN s_uname.
SORT i_datos.
ENDFORM. " SELECCIONAR_DATOS
*&---------------------------------------------------------------------*
*& Form BUILD_EVENTTAB
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_EVENTS[] text *
*----------------------------------------------------------------------*
FORM alv_build_eventtab USING p_events TYPE slis_t_event.
DATA: ls_event TYPE slis_alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = p_events.
READ TABLE p_events WITH KEY name = slis_ev_top_of_page
INTO ls_event.
IF sy-subrc = 0.
MOVE slis_ev_top_of_page TO ls_event-form.
MODIFY p_events FROM ls_event INDEX sy-tabix.
ENDIF.
*
READ TABLE p_events WITH KEY name = slis_ev_pf_status_set
INTO ls_event.
IF sy-subrc = 0.
MOVE slis_ev_pf_status_set TO ls_event-form.
MODIFY p_events FROM ls_event INDEX sy-tabix.
ENDIF.
READ TABLE p_events WITH KEY name = slis_ev_user_command
INTO ls_event.
IF sy-subrc = 0.
MOVE slis_ev_user_command TO ls_event-form.
MODIFY p_events FROM ls_event INDEX sy-tabix.
ENDIF.
ENDFORM. " BUILD_EVENTTAB
*&---------------------------------------------------------------------*
*& Form WRITE_OUTPUT
*&---------------------------------------------------------------------*
FORM alv_write_output TABLES pi_tabla
USING pe_tabla.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.