Skip to content

/AWS1/IF_BTC=>TERMINATESERVICEJOBS()

About TerminateServiceJobs

Terminates up to 50 service jobs in a job queue. This is a bulk version of TerminateServiceJob.

Batch reports the result for each service job individually in the response. Service jobs that were processed successfully are reported in the successful list. Service jobs that encountered errors are reported in the errors list. The response returns an HTTP status code of 200 even when some service jobs encountered errors, so check the errors list. Service jobs that can't be found are treated as successfully processed.

This operation requires batch:TerminateServiceJob permission for each service job in the request. There is no separate batch:TerminateServiceJobs IAM action. If a caller's IAM policy grants batch:TerminateServiceJob, they can use both the singular TerminateServiceJob and bulk TerminateServiceJobs operations.

Method Signature

METHODS /AWS1/IF_BTC~TERMINATESERVICEJOBS
  IMPORTING
    !IT_JOBS TYPE /AWS1/CL_BTCSTRINGLIST_W=>TT_STRINGLIST OPTIONAL
    !IV_REASON TYPE /AWS1/BTCSTRING OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_btctermservicejobsrsp
  RAISING
    /AWS1/CX_BTCCLIENTEXCEPTION
    /AWS1/CX_BTCSERVEREXCEPTION
    /AWS1/CX_BTCCLIENTEXC
    /AWS1/CX_BTCSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

it_jobs TYPE /AWS1/CL_BTCSTRINGLIST_W=>TT_STRINGLIST TT_STRINGLIST

An array of up to 50 service job IDs of the service jobs to terminate.

iv_reason TYPE /AWS1/BTCSTRING /AWS1/BTCSTRING

A message to attach to the service job that explains the reason for terminating it. This message is returned by DescribeServiceJob operations on the service job.

RETURNING

oo_output TYPE REF TO /aws1/cl_btctermservicejobsrsp /AWS1/CL_BTCTERMSERVICEJOBSRSP

Examples

Syntax Example

This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.

DATA(lo_result) = lo_client->terminateservicejobs(
  it_jobs = VALUE /aws1/cl_btcstringlist_w=>tt_stringlist(
    ( new /aws1/cl_btcstringlist_w( |string| ) )
  )
  iv_reason = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  LOOP AT lo_result->get_successful( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_string = lo_row_1->get_value( ).
    ENDIF.
  ENDLOOP.
  LOOP AT lo_result->get_errors( ) into lo_row_2.
    lo_row_3 = lo_row_2.
    IF lo_row_3 IS NOT INITIAL.
      lv_string = lo_row_3->get_job( ).
      lv_string = lo_row_3->get_code( ).
      lv_string = lo_row_3->get_message( ).
    ENDIF.
  ENDLOOP.
ENDIF.

To terminate multiple service jobs

This example terminates the specified service jobs with a reason.

DATA(lo_result) = lo_client->terminateservicejobs(
  it_jobs = VALUE /aws1/cl_btcstringlist_w=>tt_stringlist(
    ( new /aws1/cl_btcstringlist_w( |a4d6c728-8ee8-4c65-8e2a-9a5e8f4b7c3d| ) )
    ( new /aws1/cl_btcstringlist_w( |b3d0f26e-6d3a-4a5b-9c2e-7f4a1b2c3d4e| ) )
  )
  iv_reason = |Job terminated by user request|
).