Professional Documents
Culture Documents
How To Perform An ATC Check Automatically During Transport TASK Release - SAP Blogs
How To Perform An ATC Check Automatically During Transport TASK Release - SAP Blogs
Community
The ABAP Test Cockpit (ATC) can easily be con gured to check every transport request that is released.
But in case you are using transport of copies to import into the quality/test system (for example if you use SAP ChaRM for transport management), it is not possible in the standard to perform
the ATC checks automatically when transporting from development to quality/test system.
On the other hand, in various places, for example the SAP Code Inspector book by Randolf Eilenberger and others, it is described how to trigger a Code Inspector test for every transport task
release.
I have not yet found a description how to call the ATC automatically, when a transport task is released.
If this is what you want in your development system, you only have to implement one method in an implementation of BAdI CTS_REQUEST_CHECK:
METHOD if_ex_cts_request_check~check_before_release.
TRY.
DATA(or_factory) = NEW cl_satc_api_factory( ).
DATA(it_objects) = cl_satc_object_set_factory=>create_for_transport( request
)->if_satc_object_set~get_object_keys( ).
DATA(or_objects) = cl_satc_object_set_factory=>create_for_object_keys( it_objects ).
https://blogs.sap.com/2016/04/20/how-to-perform-an-atc-check-automatically-during-transport-task-release/ 1/8
2/5/2020 How to perform an ATC check automatically during transport TASK release | SAP Blogs
ENDTRY.
IF is_ok = abap_true.
MESSAGE s007(zs_dev_tools_local). ” success message – create your own message
ELSE.
MESSAGE s008(zs_dev_tools_local). ” failure message – create your own message
” we only get the execution ID with this “dirty” cast:
DATA(or_result_access_int) = CAST cl_satc_result_access( or_result_access ).
CALL FUNCTION ‘SATC_AC_DISPL_RESULT_BY_EXEC’
EXPORTING i_execution_id = or_result_access_int->if_satc_result_access~result_id
EXCEPTIONS
xpt_no_results = 1
xpt_not_authorized = 2
xpt_display_used = 3
OTHERS = 4.
ASSERT sy–subrc = 0.
RAISE cancel.
ENDIF.
ENDMETHOD.
(This coding uses some of the new 7.40 SP08 language features, so you may have to adapt it.)
I noted however, that include programs are not tested when transported on their own, because the ATC methods that I call only test frame programs (type 1 reports, classes, function groups). I
did not nd an easy way to overcome this using standard ATC framework functions, so I programmed it in a local class with the following methods:
CLASS-METHODS:
enrich_main_programs
CHANGING c_it_keys TYPE if_satc_object_set=>ty_object_keys,
is_include_program
IMPORTING i_object TYPE if_satc_object_set=>ty_object_key
RETURNING VALUE(r_is_include_program) TYPE abap_bool,
get_main_programs_for_include
IMPORTING i_object TYPE if_satc_object_set=>ty_object_key
RETURNING VALUE(r_it) TYPE if_satc_object_set=>ty_object_keys,
is_mainprog_included
IMPORTING
i_it_mainprogs TYPE if_satc_object_set=>ty_object_keys
i_it_current_keys TYPE if_satc_object_set=>ty_object_keys
RETURNING VALUE(r) TYPE abap_bool,
METHOD enrich_main_programs.
LOOP AT c_it_keys ASSIGNING FIELD-SYMBOL(<wa>).
IF is_include_program( <wa> ).
DATA(it_main_programs) = get_main_programs_for_include( <wa> ).
IF it_main_programs IS NOT INITIAL
AND NOT is_mainprog_included( EXPORTING i_it_mainprogs = it_main_programs
i_it_current_keys = c_it_keys ).
INSERT it_main_programs[ 1 ] INTO TABLE c_it_keys.
ENDIF.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD is_include_program.
r_is_include_program = abap_false.
CHECK i_object–obj_type = ‘PROG’.
SELECT SINGLE subc FROM reposrc WHERE progname = @i_object–obj_name AND subc = ‘I’
INTO @DATA(subc) ##warn_ok ##needed.
IF sy–subrc = 0.
r_is_include_program = abap_true.
ENDIF.
ENDMETHOD.
METHOD get_main_programs_for_include.
DATA it_mainprogs LIKE STANDARD TABLE OF i_object–obj_name.
DATA wa LIKE LINE OF r_it.
CLEAR r_it. ” if there are no main programs, return initial
CALL FUNCTION ‘RS_GET_MAINPROGRAMS’
https://blogs.sap.com/2016/04/20/how-to-perform-an-atc-check-automatically-during-transport-task-release/ 2/8
2/5/2020 How to perform an ATC check automatically during transport TASK release | SAP Blogs
EXPORTING
name = i_object–obj_name
TABLES
mainprograms = it_mainprogs
EXCEPTIONS
cancelled = 1
OTHERS = 2.
ASSERT sy–subrc = 0.
wa–obj_type = ‘PROG’.
LOOP AT it_mainprogs ASSIGNING FIELD-SYMBOL(<wa>).
wa–obj_name = <wa>.
INSERT wa INTO TABLE r_it.
ENDLOOP.
ENDMETHOD.
METHOD is_mainprog_included.
r = abap_false.
LOOP AT i_it_mainprogs ASSIGNING FIELD-SYMBOL(<wa>).
READ TABLE i_it_current_keys WITH KEY obj_type = <wa>-obj_type obj_name = <wa>-obj_name
TRANSPORTING NO FIELDS.
IF sy–subrc = 0.
r = abap_true.
RETURN.
ENDIF.
ENDLOOP.
ENDMETHOD.
Now, enrich_main_programs() needs to be called to change it_objects after the statement that is creating it_objects.
Alert Moderator
Assigned tags
ABAP Development | abap | abap test cockpit | code inspector | custom code management |
View more...
Con guration for ATC / Code Inspector check before releasing transport request
By Rameez Khan , Nov 21, 2018
Related Questions
task
By Former Member , Jun 01, 2007
11 Comments
https://blogs.sap.com/2016/04/20/how-to-perform-an-atc-check-automatically-during-transport-task-release/ 3/8
2/5/2020 How to perform an ATC check automatically during transport TASK release | SAP Blogs
Rayudu Vallabhaneni
Hi, thanks for your document. This BADI implementation will helps to handle the task level ATC checks. Could you please help me to understand the below scenarios.
If same program existing in two di erent tasks, during rst task releasing time some of the errors are APPROVED by QA reviewer.
So, whether these errors will be repeated during second task releasing time??
After both the tasks and respective transport numbers are released. Again, modi ed the same program. During this task releasing time, again it will consider previous approved errors or not?
Like (0)
Hi Rayudu,
this is Standard ATC functionality: ndings for which an exemption (“approval”) has been granted, will not show up in the future.
Exception: optionally, the approver can grant the exemptions for a limited time, for example for 1 month. In this case, they are shown again after that time.
Best regards,
Edo
Like (0)
Sandra Rossi
Thanks a lot. In 7.40 SP 7, most of the ATS classes you use don’t exist yet. If people want to use it in 7.40 SP 7 and before, here is an example how to run ATC. Hope it helps.
START-OF-SELECTION.
DATA:
key_iterator TYPE REF TO cl_satc_ac_iterate_ xed_keys,
f_r3tr_keys TYPE satc_t_r3tr_keys.
DATA:
check_variant TYPE satc_ci_chk_variant,
project_handle TYPE REF TO if_satc_md_project,
project_parameters TYPE REF TO cl_satc_ac_project_parameters.
check_variant = ‘Z_STANDARD’.
https://blogs.sap.com/2016/04/20/how-to-perform-an-atc-check-automatically-during-transport-task-release/ 4/8
2/5/2020 How to perform an ATC check automatically during transport TASK release | SAP Blogs
DATA:
progress_listener TYPE REF TO cl_satc_ac_ui_progress,
success TYPE abap_bool,
execution_id TYPE satc_d_exec_id.
CASE abap_true.
WHEN dialog.
IF ( sy-batch abap_true ).
CREATE OBJECT progress_listener.
ENDIF.
WHEN batch.
MESSAGE ‘Your request has been scheduled for execution in batch.’ TYPE ‘I’.
ENDCASE.
Like (0)
Mahadevan Venkata
BR
Venkat
Like (0)
Phillip Eisenhauer
Hey Edo,
https://blogs.sap.com/2016/04/20/how-to-perform-an-atc-check-automatically-during-transport-task-release/ 5/8
2/5/2020 How to perform an ATC check automatically during transport TASK release | SAP Blogs
)->if_satc_object_set~get_object_keys( ).
You use the object factory class to create an object for a transport request ( rst line).
You then use this object to get the object keys of the created object (second line).
In the third line You use the keys of the rst object to create another object_set object.
Why don’t You simple use the the “create_for_transport” method and use this object in
Is this solving any problem you ran into which I don’t see at the moment?
Greetings Phillip
Like (0)
Hi Philip,
I think the reason is described in the second but last sentence of the blog:
Now, enrich_main_programs() needs to be called to change it_objects after the statement that is creating it_objects.
Best regards,
Edo
Like (0)
Ian Stubbings
Hi Edo
We are using the standard functionality to trigger the checks which is ne but I have one other question in relation to transport release:
Is there a standard check to validate transport naming standards or do we have to create our own check for this? I’ve seen the source code naming standards as a standard (and extensive
check) but our focus is for the transport (and task).
Regards
Ian
Like (0)
https://blogs.sap.com/2016/04/20/how-to-perform-an-atc-check-automatically-during-transport-task-release/ 6/8
2/5/2020 How to perform an ATC check automatically during transport TASK release | SAP Blogs
Bärbel Winkler
Ian Stubbings
Hi Ian,
do you mean checking the content of transport titles? If yes, than I don’t think that you can do that via ATC-checks which happen too late in the game to avoid the creation of transports with
wrong titles. I did however implement a check during transport creation last year via METHOD if_ex_cts_request_check~check_before_creation, a couple of Z-tables and a function module (a
description is here – but the potential task to convert the logic to ABAP OO is still pending).
Cheers
Bärbel
Like (0)
Ian Stubbings
Hi Bärbel
Yes, indeed I am interested in checking the transport title as we have a standard way this should be built.
The check should occur at task or transport release and could therefore t into the ATC Check framework (in my opinion). I guess seeing as there is a standard check there already for source
code, I wondered if there was a standard solution for transport titles I had missed, or seeing as it’s probably quite a common request, I wondered if someone else had implemented it.
Although it would be preferable to add into the if_ex_cts_request_check~check_before_creation method, we don’t always know the details up front, so although your previous solution you
mentioned could potentially work for us, it would unfortunately be of limited bene t.
For the if_ex_cts_request_check~check_before_release method, this is ne and could work in a small SAP estate but ours is quite extensive and therefore I’d like to implement the check in our
Central ATC system rather than in each satellite system and hence an ATC check would be an ideal solution. I think anyway
Regards
Ian
Like (0)
Hi Bärbel, Hi Ian,
the ATC checks work only on development objects. They can (to my best knowledge) not work on transports themselves.
We also implemented some “non-ATC” checks manually in the check_before_release() exit, for example to check that modi cations (which are not checked by our version of ATC) always have a
comment.
You could still have the check central, if you call an RFC function on your central system. Then you only have to implement the RFC call in each system (and provide all parameters that you
would ever want :-), and implement (and update) the actual logic only in your central system.
Best regards,
Edo
Like (0)
Ian Stubbings
Hi Edo
https://blogs.sap.com/2016/04/20/how-to-perform-an-atc-check-automatically-during-transport-task-release/ 7/8
2/5/2020 How to perform an ATC check automatically during transport TASK release | SAP Blogs
I have been reading about implementing ATC checks using the standard framework and it mentions about not being reliant on in system data – such as from TADIR and therefore this would
naturally extend to transport data from E07T etc.
Therefore, I shall take your advice and implement an RFC call back to the the Central ATC system and also house any naming standing con g tables here.
Regards
Ian
Like (0)
Find us on
Newsletter Support
https://blogs.sap.com/2016/04/20/how-to-perform-an-atc-check-automatically-during-transport-task-release/ 8/8