Skip to Content
1

Can the ATC be called from a report program and provide the results?

Feb 22, 2017 at 08:06 AM

242

avatar image

Hi!

I'm getting accustomed with using the ABAP Test Cockpit (ATC) in our 7.40/SP11 environment. I'd like to use it for checking a subset of development objects determined via a report program which can extract the objects contained in currently "active" transport requests. This is intended as a kind or "pre-warning" system to flag potential issues early on. It does, what it's supposed to do when I do this manually via transaction ATC where I created a check variant containing the checks I'd like to run, add the objects to check in the object set and then execute it via an inspection.

What I'd like to do is to automate this process by triggering ATC with the needed information straight from the report program. The program can either provide the transport request IDs and/or the object names. Judging from the available entry fields in the ATC, there doesn't seem to be a means to provide multiple transport requests for one inspection as there's only a parameter field for that. So, that potentially leaves just the option to specifiy the objects.

Ideally, the check results could be fed back to the calling report but it would already help if they were just readily available within the ATC.

Is there a way to accomplish this?

Note: we don't yet have the ATC available as a central instance.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Axel Jebens
Feb 22, 2017 at 08:48 AM
3

Hi,

There is an object-oriented API which you can use to create an own program based on class CL_SATC_API_FACTORY. Please check out the example program RSATC_API_USAGE_EXAMPLE. There is a remote-enabled API and example program, too. See program RSATC_API_REMOTE_USAGE_EXAMPLE.

Hope it helps!

Show 4 Share
10 |10000 characters needed characters left characters exceeded

Thanks, Axel! That's exactly what I was looking for and have already implemented it in my program. It works like a charm!

As it was the easier of the two options, I went with calling the ATC for one transport request at a time as I had that information readily available and only had to put a loop around the logic provided by the example program.

Cheers

Baerbel

0

Hi Axel,

When I run either program, exception CX_SATC_INVALID_OBJECT_KEYS is being thrown from CL_SATC_OBJECT_SET_FACTORY Method CREATE_SET_FOR_OBJECT_KEYS. The Class CL_123 and the Function Group FG_456 do not exist in our installtion. Is there a program that needs to be run to generate these objects?

Regards,

Stan

0

Hi Stanley,

before I tried running the sample program, I copied it into my own program and updated the values for l_keys to objects that exist in our system (and likewise to an existing transport-ID in the 2nd option):

create object l_factory.

l_keys = value #( ( obj_type = 'PROG' obj_name = 'ZWWXCOXL00600' )
( obj_type = 'METH' obj_name = 'ZCL_IM_LE_SHP_DELIVERY_PRO' ) ).

try.
l_object_set = cl_satc_object_set_factory=>create_for_object_keys( l_keys ).
catch cx_satc_empty_object_set into l_cx.
message l_cx type 'E'. " Object set contains no checkable objects
endtry.

This then worked fine without throwing any exceptions.

I did encounter exception cx_satc_invalid_argument in the program I added the logic to, because one of the transports was for the deletion of objects, so there wasn't anything to be checked. I decided to just ignore this completely and continue with the next transport (I'm using this just for "spot checks", so it's not a big deal if some transports get missed):

  LOOP AT lt_transp INTO ls_transp.

    CREATE OBJECT l_factory.
    TRY.
        l_object_set = cl_satc_object_set_factory=>create_for_transport( i_transport = ls_transp-strkorr ).
      CATCH cx_satc_empty_object_set INTO l_cx.
        MESSAGE l_cx TYPE 'E'. " Object set contains no checkable objects
      CATCH cx_satc_not_found INTO l_cx.
        MESSAGE l_cx TYPE 'E'. " Specified transport was not found
      CATCH cx_satc_invalid_argument INTO l_cx.
        " Just ignore, could be deletion. MESSAGE l_cx TYPE 'I'.
        CONTINUE.
      CATCH cx_satc_failure INTO l_cx.
        MESSAGE l_cx TYPE 'E'. " Other error occurred
    ENDTRY.

    TRY.
        l_variant = l_factory->get_repository( )->load_ci_check_variant( i_name = p_chkv ).
      CATCH cx_satc_not_found INTO l_cx.
        MESSAGE l_cx TYPE 'E'. " Specified Code Inspector variant was not found
    ENDTRY.

Hope this helps!

Cheers

Baerbel

0

Hi Baerbel,

Thank you for the response. I will do as you suggest and make my own version of the program in the customer namespace, and then adapt it for one of our existing objects.

Best regards,

Stan

0