Skip to Content
author's profile photo Former Member
Former Member

Displaying Jobs in SM37 with function module BP_JOBLIST_PROCESSOR_SM37B

Hello and good afternoon,

I am attempting to display a list of jobs using function module BP_JOBLIST_PROCESSOR_SM37B. I am using this approach as there are no Parameter ID's associated with the transaction SM37 and therefore I cannot use the SET/GET Parameter ID approach followed by CALL TRANSACTION 'SM37' AND SKIP FIRST SCREEN.

I have initially used function module 'BP_JOB_SELECT' to select the job details based on my restriction criteria into a table (JOBSELECT_JOBLIST).

Using the results contained in table JOBSELECT_JOBLIST I then call function module 'BP_JOBLIST_PROCESSOR_SM37B' passing the tables parameter JOBLIST = JOBSELECT_JOBLIST. I also pass the parameter JOBLIST_OPCODE = '21' to allow the user to edit these jobs.

The correct list of jobs and their current job status are then displayed in an ALV grid. My problem arises when the user wishes to REFRESH the details contained within the result list. The REFRESH option/button doesn't appear to work. I have attempted to CANCEL jobs and DELETE jobs and the background process works (i.e. the selected job is cancelled/deleted) however the screen displays the job in the state it was originally displayed in, even after a REFRESH.

Am I missing something? I'm super confused!! 😊

Assistance would be greatly appreciated.

Kind Regards,

Richard.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Jan 17, 2012 at 03:26 PM

    Hi All,

    I have managed to solve the problem...

    I had a look at function module 'BP_JOB_MAINTENANCE'. This function module uses both function modules 'BP_JOB_SELECT' and 'BP_JOBLIST_PROCESSOR_SM37B' as I was doing. The only difference being that I was not updating the selection criteria (i.e. I was specifying the IMPORTING parameter JOBSEL_PARAM_IN but not updating the parameters with the EXPORTING parameter JOBSEL_PARAM_OUT).

    Once I had done this, all worked correcly...

    Below is a snippet of the code:

    DATA: ls_jobsel_param_in TYPE btcselect,

    lt_jobselect_joblist TYPE TABLE OF tbtcjob.

    ls_jobsel_param_in-jobname = 'ZR_PROJECT_PLAN_COPY*'.

    ls_jobsel_param_in-from_date = gv_start_date.

    ls_jobsel_param_in-from_time = gv_start_time.

    ls_jobsel_param_in-username = sy-uname.

    ls_jobsel_param_in-schedul = 'X'.

    ls_jobsel_param_in-ready = 'X'.

    ls_jobsel_param_in-running = 'X'.

    ls_jobsel_param_in-finished = 'X'.

    ls_jobsel_param_in-aborted = 'X'.

    CALL FUNCTION 'BP_JOB_SELECT'

    EXPORTING

    jobselect_dialog = 'N'

    jobsel_param_in = ls_jobsel_param_in

    • ENDDATE = ' '

    • ENDTIME = ' '

    • SELECTION = 'AL'

    IMPORTING

    jobsel_param_out = ls_jobsel_param_in

    TABLES

    jobselect_joblist = lt_jobselect_joblist

    • JOBNAME_EXT_SEL =

    • USERNAME_EXT_SEL =

    • CHANGING

    • ERROR_CODE =

    • EXCEPTIONS

    • INVALID_DIALOG_TYPE = 1

    • JOBNAME_MISSING = 2

    • NO_JOBS_FOUND = 3

    • SELECTION_CANCELED = 4

    • USERNAME_MISSING = 5

    • OTHERS = 6

    .

    IF sy-subrc <> 0.

    • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    CALL FUNCTION 'BP_JOBLIST_PROCESSOR_SM37B'

    EXPORTING

    joblist_opcode = '21'

    joblist_refr_param = ls_jobsel_param_in

    • IMPORTING

    • JOBLIST_SEL_JOB =

    TABLES

    joblist = lt_jobselect_joblist

    • EXCEPTIONS

    • INVALID_OPCODE = 1

    • JOBLIST_IS_EMPTY = 2

    • JOBLIST_PROCESSOR_CANCELED = 3

    • OTHERS = 4

    .

    IF sy-subrc <> 0.

    • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.