Sie sind auf Seite 1von 10

2/5/2020 How to trigger Code Inspector checks during the release of a ‘task’?

| SAP Blogs

Community

Ask a Question Write a Blog Post Login

Mahadevan Venkata
September 19, 2013 4 minute read

How to trigger Code Inspector checks during the release of a ‘task’?


Follow RSS feed Like

16 Likes 17,413 Views 17 Comments

Bugs in your custom ABAP code can be quite expensive when they impact critical business processes, which is why quality assurance of custom ABAP code is receiving more and more attention in
business. Detecting bugs early in the development stages before they can be moved across the landscape ensure that the cost and risk impact is minimal. To reach this goal, SAP o ers the ABAP Test
Cockpit (ATC) and Code Inspector as quality assurance tools.

The ATC is available with EhP2 for SAP NetWeaver 7.0 support package stack 12 (SAP Basis 7.02, SAP Kernel 7.20) and EhP3 for SAP NetWeaver 7.0 support package stack 5 (SAP Basis 7.31, SAP Kernel 7.20).

General process for releasing a transport request

The transport organizer is a tool for managing the objects that gather the changes carried on during the development and configuration phases, and for transporting them across the landscape. The two kinds of
objects used are the Request and the Task.

The Request is the main container, which contains zero to any number of Tasks.The CTS automatically creates one task for each user who adds objects to the Request. An ABAP transport request may contain
many tasks that are assigned to different users.When you want to transport the Request, you have to first release all the tasks of the request, and then the request itself. When it is released, the transport is done
automatically or manually by the administrator. The transport goes towards the systems and clients defined in the transport routes.

Current behavior of Code Inspector checks during the release of a transport request or a transport task

Releasing a transport request or a task can be considered as the rst quality gate to ensure that poor quality custom code is not transported across the landscape. Currently, Code Inspector
checks can be activated during the release of a transport request. To activate this feature, perform the following steps

1. Go to transaction SE03
2. Double click on the entry ‘Global Customizing’ (Transport Organizer)
3. Under ‘Check Objects when Request Released’ , select the option ‘Globally Activated’.

Now this activates the check of a transport request. But there may be the requirement to check also the single ‘tasks’. Currently, automatically triggering  Code Inspector checks during the
release of a ‘task’ is not available as a standard. To address this requirement, SAP provides a standard BAdI ‘CTS_REQUEST_CHECK’, that can be implemented by customers to trigger code
inspector checks during the release of a task.

In this blog, I will illustrate the steps required to implement the BAdI, which when activated will trigger the checks during the release of a task.

(please adapt the naming conventions, texts, badi names, class names etc as per your requirement)

Steps for triggering Code Inspector Checks during the release of tasks

1. Go to transaction SE19
2. At the create implementation box provide the name of the classic BAdI „CTS_REQUEST_CHECK‟ and click on the button „Create Impl.‟

https://blogs.sap.com/2013/09/19/how-to-trigger-atc-or-code-inspector-checks-during-the-release-of-a-transport-task/ 1/10
2/5/2020 How to trigger Code Inspector checks during the release of a ‘task’? | SAP Blogs

   3. Provide a BAdi implementation name

   4. Provide a short text. Click on the „Save‟ button. Provide package details when prompted

   5. Double clicking on the method ‚check_before_release„ of the BAdi interface takes you to the method implementation of the generated ABAP object class that was created during BAdi impl creation.

https://blogs.sap.com/2013/09/19/how-to-trigger-atc-or-code-inspector-checks-during-the-release-of-a-transport-task/ 2/10
2/5/2020 How to trigger Code Inspector checks during the release of a ‘task’? | SAP Blogs

   6. In the method „CHECK_BEFORE_RELEASE‟ rst check if the release concerns a transport request or a transport task.Code the following portion in the method ‘CHECK_BEFORE_RELEASE’

     7. For calling the actual Code inspector check itself create a new private method sci_check in the class „ZCL_IM__CTS_REQUEST_CHECK‟

     Provide the following parameters for the method SCI_CHECK  

https://blogs.sap.com/2013/09/19/how-to-trigger-atc-or-code-inspector-checks-during-the-release-of-a-transport-task/ 3/10
2/5/2020 How to trigger Code Inspector checks during the release of a ‘task’? | SAP Blogs

     create the method exception

  8. The rest of the method SCI_CHECK contains the various steps of creating Code inspector check, assigning variants, object sets etc.It is su cient if you copy the piece of code from the attachment
‘sci_check.txt.zip’

  9. Finally create the message class „ZSCI‟ with the following values

  10. Save and activate all your changes. Do not forget to activate the BAdI implementation in transaction SE19.

* Deactivate the BAdI in SE19, if you do not wish to use this feature

Alert Moderator

Assigned tags

ABAP Testing and Analysis | abap | atc | code inspector | cts+ |

View more...

Related Blog Posts

Remote Code Analysis in ATC for Developers


By Olga Dolinskaja , Feb 27, 2017
Code Inspector s Performance Checks (II)
By Randolf Eilenberger , Jul 02, 2007
Code Inspector s Performance Checks (III)
By Randolf Eilenberger , Jan 21, 2009

Related Questions

code inspector in Trasport


By Former Member , Dec 14, 2007
ATC transport checks not working
By Uwe Fetzer , Sep 18, 2017

module pool & Code Inspector


By Former Member , May 22, 2008

https://blogs.sap.com/2013/09/19/how-to-trigger-atc-or-code-inspector-checks-during-the-release-of-a-transport-task/ 4/10
2/5/2020 How to trigger Code Inspector checks during the release of a ‘task’? | SAP Blogs

17 Comments

You must be Logged on to comment or reply to a post.

Florian Wunderle

April 4, 2014 at 11:07 am

Hi!

Thkanks for sharing this. Shouldn’t it it have been better to use function module  TR_INSPECT_OBJECTS for doing the ATC check? In this case even the ATC exemption routines and the settings
in ATC and SE03 would be valid.

/Florian

Like (0)

Stefan Seeburger

October 28, 2015 at 8:06 am

TR_INSPECT_OBJECTS is exaclty what i was looking for – thx

Like (0)

Former Member

March 24, 2015 at 12:37 pm

Hello!

Great advices. I have a further question. How can I propagate my error message to the user interface. How can I make the user know why his transport was not executed and display the
message in the logger window for errors and warnings.

Thanks,

Adrian

Like (0)

Otto Gold

March 25, 2015 at 10:55 am

Hello,

ideal would be that you rst turn on the standard Code Inspector integration in SE03 and there you will see how it works as an example. Then you can mimic that behaviour or change the
behaviour but already knowing what you don’t want and where you are heading next.

cheers Otto

Like (0)

Florian Wunderle

April 1, 2015 at 7:50 am

Hi!

We are using the function module TR_INSPECT_OBJECTS for performing the checks. This raises the same type of message popup as in releasing the whole transport.

/Florian

Like (0)

Former Member

https://blogs.sap.com/2013/09/19/how-to-trigger-atc-or-code-inspector-checks-during-the-release-of-a-transport-task/ 5/10
2/5/2020 How to trigger Code Inspector checks during the release of a ‘task’? | SAP Blogs

May 6, 2015 at 6:30 am


I succeded to do my task as follows:

DATA: LS_LOG                 TYPE SPROT_U,

        LT_LOG                 TYPE STANDARD TABLE OF SPROT_U,

        LT_LINES               TYPE TABLE OF TRLOG INITIAL SIZE 0.

* add your logs to lt_log table

CLEAR LS_LOG.

        LS_LOG–LEVEL    = ’02’.

        LS_LOG–AG       = ‘EU’.

        LS_LOG–MSGNR    = ‘901’.

        LS_LOG–NEWOBJ   = ABAP_FALSE.

        LS_LOG–LANGU    = ‘EN’.

        LS_LOG–VAR1     = ‘some important information here’

        LS_LOG–SEVERITY = ‘S’.

        APPEND LS_LOG TO LT_LOG.

*then call some transform function – I don’t know exactly what it does

CALL FUNCTION ‘TRINT_CONVERT_LOG’

      TABLES

        IT_MSGS  = LT_LOG

        ET_LINES = LT_LINES.

*and then show the error messages

CALL FUNCTION ‘TRINT_DISPLAY_LOG’

      EXPORTING

        IV_TITLEBAR            = ‘your title here.’

      TABLES

        CT_LINES               = LT_LINES

      CHANGING

        CV_WITH_LONG_TEXT_ICON = LV_WITH_LONG_TEXT_ICON

      EXCEPTIONS

        OTHERS                 = 0.

https://blogs.sap.com/2013/09/19/how-to-trigger-atc-or-code-inspector-checks-during-the-release-of-a-transport-task/ 6/10
2/5/2020 How to trigger Code Inspector checks during the release of a ‘task’? | SAP Blogs

Like (0)

Hock Lin Wong

October 26, 2016 at 2:07 am

Hi Mahadevan,

I could not nd the attachment for ‘sci_check.txt.zip‘ in your blog. Can you show me where should i get the the le?

Thanks and Regards


Wong

Like (1)

Former Member

October 31, 2016 at 7:40 am

I also could not nd the attachment for ‘sci_check.txt.zip‘ in your blog.

Like (1)

Christian Pfaller

April 3, 2017 at 1:27 pm

Hi all,

meanwhile it is also possible to release tasks/requests from Eclipse/ADT. Is there a way to integrate the CTS_REQUEST_CHECK BAdI also with ADT? I’d like to see the SCI results in Eclipse when
releasing a task/request from ADT – ideally I’d like to choose to cancel or continue the release in case of SCI messages.

Regards,

Christian

Like (1)

Suhas Saha

April 5, 2017 at 2:00 pm

The BAdI is called when you release a TR via ADT.

The ATC is integrated with the ADT and you can trigger it for a TR as well.

Context Menu > Run As > ABAP Test Cockpit

https://blogs.sap.com/2013/09/19/how-to-trigger-atc-or-code-inspector-checks-during-the-release-of-a-transport-task/ 7/10
2/5/2020 How to trigger Code Inspector checks during the release of a ‘task’? | SAP Blogs

BR,

Suhas

Like (0)

Christian Pfaller

April 7, 2017 at 3:09 pm

Yes, I’m aware of this, but I’d like to also see the Code Inspector results (from the BAdI call) when I release a task automatically in Eclipse (without separately executing ATC) – or at least a
message displaying that errors / warnings did occur. That’s the bene t when implementing the BAdI: you can enforce executing the checks on task release.

So may question is how to transfer result data from the BAdI to ADT?

Then, the second step would be to popup a dialog if the release should be continued or not.

Like (0)

Johan Bellardi

November 20, 2017 at 7:45 am

I also could not nd the attachment for ‘sci_check.txt.zip‘. Would you be so kind to indicate where this can be obtained as I have already done most work and now I am stuck at the step to add
the code to the SCI_check method.

I will be appreciated.

Like (0)

Daniel Santos Juarros

November 30, 2017 at 2:41 pm

Hi Mahadevan Venkata

Could you attach the le sci_check.txt.zip.

Regards,

Dani

Like (0)

https://blogs.sap.com/2013/09/19/how-to-trigger-atc-or-code-inspector-checks-during-the-release-of-a-transport-task/ 8/10
2/5/2020 How to trigger Code Inspector checks during the release of a ‘task’? | SAP Blogs

S. Eggberry

January 31, 2018 at 9:16 am

Hi Mahadevan Venkata

Can you please add the le sci_check.txt.zip.

Kind regards

Shanté

Like (0)

Klaus Ellinger

October 17, 2018 at 11:58 am

Hi Mahadevan Venkata

I agree with the other comments – with the attachment sci_check.txt.zip the blog would be really helpful. Can you please add the le sci_check.txt.zip?

Kind regards

Klaus

Like (0)

Rameez Khan

November 1, 2018 at 6:36 am

Isn’t it same as note: 2495410. ?

Like (1)

Mahadevan Venkata | Post author

November 5, 2018 at 3:45 pm

Hi All,

The blog is slightly outdated and further the text le containing the code got deleted during migration(to community) of the website.

However, the good news is that this feature is now available as an SAP standard.

Please read the note 2495410 to get more information on how to activate this.

Happy releasing more tasks/requests

Best Regards

Mahadevan

Like (1)

https://blogs.sap.com/2013/09/19/how-to-trigger-atc-or-code-inspector-checks-during-the-release-of-a-transport-task/ 9/10
2/5/2020 How to trigger Code Inspector checks during the release of a ‘task’? | SAP Blogs

Find us on

Privacy Terms of Use

Legal Disclosure Copyright

Trademark Cookie Preferences

Newsletter Support

https://blogs.sap.com/2013/09/19/how-to-trigger-atc-or-code-inspector-checks-during-the-release-of-a-transport-task/ 10/10

Das könnte Ihnen auch gefallen