Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Question about job scheduling.

Former Member
0 Kudos
331

Hi,

Our company auditors have requested some info and I'm having a hard time getting it for them. What they have requested is a list of all our scheduled jobs as well as the account of the person that scheduled it and the account that actually runs it.

I know I can get this via sm37 and manually collecting the info. We have a number of jobs however and multiple systems so this way is very time consuming.

I also tried getting the data via TBTCO, TBTCS and TBTCP and selecting SDLUNAME and AUTHCKNAM. Here's what happens

TBTCO - job names match sm37, SDLUNAME is populated, AUTHCKNAM is empty

TBTCS - job names match sm37, SDLUNAME is populated, AUTHCKNAM is empty.

TBTCP - job names don't match sm37, both SDLUNAME and AUTHCKNAM are populated.

How can I get a combination of TBTCS and TBTCP so that I get the job names in SM37 but both the SDLUNAME and AUTHCKNAM correctly populated as well?

Any help appreciated.

Peter

Edited by: Peter Bell on Sep 28, 2010 11:18 PM

3 REPLIES 3

Former Member
0 Kudos
130

Hi Peter,

Use this code.


data : jobselect_joblist_b type standard table of v_op.

SELECT DISTINCT * FROM v_op INTO TABLE jobselect_joblist_b
WHERE
      (
              (
                 ( sdlstrtdt = '20100929'
              AND  sdlstrttm >= '000000' )
              OR  sdlstrtdt > '20100929'
              )
              AND
              (
                 ( sdlstrtdt = '20100929'
              AND sdlstrttm <= '240000' )
              OR  sdlstrtdt < '20100929'
              )
              OR
              (
                sdlstrtdt EQ '' AND
                eventid   EQ space
              )
      )
      AND jobname  LIKE '%' ESCAPE '#'    "jobname2 = '%'
      AND sdluname LIKE 'DEVELOPER'  "Username
      AND jobcount LIKE '%'  " jobcount = '%'
      AND jobgroup LIKE '%'  "jobgroup = '%'
      AND progname LIKE '%'  "abapname = '%'
      AND STATUS IN ('S', 'Z', 'Y', 'R', 'F', 'A').

IF sy-subrc = 0.
  BREAK-POINT.
ENDIF.

Regards,

Amitava

Former Member
0 Kudos
130

Hi Amitava,

Thanks for your response.

How do I use this code? I created a report in SE38 but it doesn't do anything when I click execute.....?

Peter

0 Kudos
130

Hi Peter,

Sorry for delay in response,

Use this code in Se38 and activate and execute.


Parameter : p_date type sy-datum OBLIGATORY.

DATA : jobselect_joblist_b TYPE STANDARD TABLE OF v_op.

SELECT DISTINCT * FROM v_op INTO TABLE jobselect_joblist_b
WHERE
      (
              (
                 ( sdlstrtdt = p_date
              AND  sdlstrttm >= '000000' )
              OR  sdlstrtdt > p_date
              )
              AND
              (
                 ( sdlstrtdt = p_date
              AND sdlstrttm <= '240000' )
              OR  sdlstrtdt < p_date
              )
              OR
              (
                sdlstrtdt EQ '' AND
                eventid   EQ space
              )
      )
      AND jobname  LIKE '%' ESCAPE '#'    "jobname2 = '%'
      AND sdluname LIKE 'DEVELOPER'  "Username
      AND jobcount LIKE '%'  " jobcount = '%'
      AND jobgroup LIKE '%'  "jobgroup = '%'
      AND progname LIKE '%'  "abapname = '%'
      AND status IN ('S', 'Z', 'Y', 'R', 'F', 'A').

IF sy-subrc = 0.
  PERFORM sub_display_data.
ENDIF.

*&---------------------------------------------------------------------*
*&      Form  SUB_DISPLAY_DATA
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM sub_display_data .
  DATA :
  l_oref_alv       TYPE REF TO cl_salv_table,
  l_oref_error     TYPE REF TO cx_salv_error,      " Error instance
  l_text_alv_e     TYPE string,
  lr_display       TYPE REF TO cl_salv_display_settings,
  lr_functions     TYPE REF TO cl_salv_functions_list.

  TRY.
      CALL METHOD cl_salv_table=>factory
        IMPORTING
          r_salv_table = l_oref_alv
        CHANGING
          t_table      = jobselect_joblist_b.
    CATCH cx_salv_msg INTO l_oref_error.
      l_text_alv_e = l_oref_error->get_text( ).
      MESSAGE i001 WITH l_text_alv_e.
      LEAVE LIST-PROCESSING.
  ENDTRY.

* get display settings object
  lr_display = l_oref_alv->get_display_settings( ).

* set horizontal lines off
  lr_display->set_horizontal_lines( value = ' '  ).

* set striped pattern
  lr_display->set_striped_pattern( value = 'X' ).


* get the FUNCTIONS object
  lr_functions = l_oref_alv->get_functions( ).

* offer all generic functions
  lr_functions->set_all( value = if_salv_c_bool_sap=>true ).

  l_oref_alv->display( ).

ENDFORM.                    " SUB_DISPLAY_DATA

Regards,

Amitava