Skip to content

/AWS1/IF_SAG=>BATCHGETFINDINGS()

About BatchGetFindings

Retrieves multiple findings in a single request

Method Signature

METHODS /AWS1/IF_SAG~BATCHGETFINDINGS
  IMPORTING
    !IT_FINDINGIDS TYPE /AWS1/CL_SAGFINDINGIDLIST_W=>TT_FINDINGIDLIST OPTIONAL
    !IV_AGENTSPACEID TYPE /AWS1/SAGSTRING OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_sagbatchgetfndgsout
  RAISING
    /AWS1/CX_SAGCLIENTEXC
    /AWS1/CX_SAGSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

it_findingids TYPE /AWS1/CL_SAGFINDINGIDLIST_W=>TT_FINDINGIDLIST TT_FINDINGIDLIST

List of finding IDs to retrieve

iv_agentspaceid TYPE /AWS1/SAGSTRING /AWS1/SAGSTRING

ID of the agent space where the findings exist

RETURNING

oo_output TYPE REF TO /aws1/cl_sagbatchgetfndgsout /AWS1/CL_SAGBATCHGETFNDGSOUT

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->batchgetfindings(
  it_findingids = VALUE /aws1/cl_sagfindingidlist_w=>tt_findingidlist(
    ( new /aws1/cl_sagfindingidlist_w( |string| ) )
  )
  iv_agentspaceid = |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_findings( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_string = lo_row_1->get_findingid( ).
      lv_string = lo_row_1->get_agentspaceid( ).
      lv_string = lo_row_1->get_pentestid( ).
      lv_string = lo_row_1->get_pentestjobid( ).
      lv_string = lo_row_1->get_taskid( ).
      lv_string = lo_row_1->get_name( ).
      lv_string = lo_row_1->get_description( ).
      lv_findingstatus = lo_row_1->get_status( ).
      lv_string = lo_row_1->get_risktype( ).
      lv_risklevel = lo_row_1->get_risklevel( ).
      lv_string = lo_row_1->get_riskscore( ).
      lv_string = lo_row_1->get_reasoning( ).
      lv_confidencelevel = lo_row_1->get_confidence( ).
      lv_string = lo_row_1->get_attackscript( ).
      lo_coderemediationtask = lo_row_1->get_coderemediationtask( ).
      IF lo_coderemediationtask IS NOT INITIAL.
        lv_coderemediationtaskstat = lo_coderemediationtask->get_status( ).
        lv_string = lo_coderemediationtask->get_statusreason( ).
        LOOP AT lo_coderemediationtask->get_taskdetails( ) into lo_row_2.
          lo_row_3 = lo_row_2.
          IF lo_row_3 IS NOT INITIAL.
            lv_string = lo_row_3->get_reponame( ).
            lv_string = lo_row_3->get_codedifflink( ).
            lv_string = lo_row_3->get_pullrequestlink( ).
          ENDIF.
        ENDLOOP.
      ENDIF.
      lv_string = lo_row_1->get_lastupdatedby( ).
      lv_timestamp = lo_row_1->get_createdat( ).
      lv_timestamp = lo_row_1->get_updatedat( ).
    ENDIF.
  ENDLOOP.
  LOOP AT lo_result->get_notfound( ) into lo_row_4.
    lo_row_5 = lo_row_4.
    IF lo_row_5 IS NOT INITIAL.
      lv_string = lo_row_5->get_value( ).
    ENDIF.
  ENDLOOP.
ENDIF.