Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata

Applies to:

SAP Business Warehouse, Netweaver 7.0

Summary

There is no simple straight forward way to get a list of scheduled Process chains in SAP BW system. This program will give you a list of process chains which are scheduled and their respective schedule start date and time.

Author(s): 

Uday Pothireddy

REPORT Get Scheduled Process Chains.
TYPES: BEGIN OF l_s_scheduled,
       chain   TYPE rspc_chain,
       sdlstrtdt TYPE tbtco-sdlstrtdt,
       sdlstrttm TYPE tbtco-sdlstrttm,
       jobname  TYPE tbtco-jobname,
       jobcount TYPE tbtco-jobcount,
       progname TYPE tbtcp-progname,
       variant TYPE tbtcp-variant,
  END OF l_s_scheduled.

DATA: l_t_scheduled TYPE STANDARD TABLE OF l_s_scheduled,
      l_t_valtab    TYPE STANDARD TABLE OF rsparams,
      l_w_valtab    TYPE rsparams.

FIELD-SYMBOLS	<l_f_scheduled> TYPE l_s_scheduled.

SELECT a~jobname a~jobcount a~sdlstrtdt a~sdlstrttm b~progname b~variant
INTO CORRESPONDING FIELDS OF TABLE l_t_scheduled
   FROM tbtco AS a JOIN tbtcp AS b
              ON a~jobname = b~jobname AND
                 a~jobcount = b~jobcount
WHERE a~jobname = 'BI_PROCESS_TRIGGER' AND
      a~status = 'S'. "Scheduled
WRITE :/ 'Chain Name               ', '|' ,'Start Date', '|', 'Start Time'.

ULINE.
LOOP AT l_t_scheduled ASSIGNING <l_f_scheduled>.
  REFRESH l_t_valtab.
  CALL FUNCTION 'RS_VARIANT_CONTENTS'
    EXPORTING
      report               = <l_f_scheduled>-progname
      variant              = <l_f_scheduled>-variant
    TABLES
      valutab              = l_t_valtab
    EXCEPTIONS
      variant_non_existent = 1
      variant_obsolete     = 2
      OTHERS               = 3.
  IF sy-subrc = 0.
    READ TABLE l_t_valtab INTO l_w_valtab
    WITH KEY selname = 'CHAIN'.
    IF sy-subrc = 0.
      <l_f_scheduled>-chain = l_w_valtab-low.
    ENDIF.

    WRITE :/ <l_f_scheduled>-chain, '|', <l_f_scheduled>-sdlstrtdt, '|' , <l_f_scheduled>-sdlstrttm.
  ENDIF.
ENDLOOP.
ULINE.