Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

What are the options to place pseudo comments for code inspector findings?

BaerbelWinkler
Active Contributor
0 Kudos

As mentioned in another ATC-related question, I'm currently fine-tuning our ATC/SCI setup. One of the tasks I still need to do is to put together a "how-to" document in our development guidelines and one of the topics will be around pseudo-comments to suppress ATC/SCI-findings.

I'm already seeing lots of pseudo-comments in our current code but there doesn't seem to be a consistent pattern of where/how they are placed in relation to the statement they relate to. Looking at the SAP-Help for this, there is just one example where the pseudo comment is placed in the line where the statement starts:

SELECT d~object, h~dokldate, h~dokltime   "#EC CI_BUFFJOIN 
  FROM dokil AS d                         "Buffering is done 
       INNER JOIN dokhl AS h              "by application 
         ON h~id         = d~id     AND   "with Shared Objects 
            h~object     = d~object AND 
            h~typ        = d~typ    AND 
            h~langu      = d~langu  AND 
            h~dokversion = d~version 
  WHERE d~id     = 'SD'     AND 
        d~typ    = 'E'      AND 
        d~langu = @langu AND 
        d~object LIKE 'AB%' 
  INTO CORRESPONDING FIELDS OF TABLE @docu_tab.

But, in our own code, I have many examples where it's added after the statement:

SELECT * FROM zpdm_pmp  INTO TABLE t_zpdm_pmp
 WHERE aennr = aenr-aennr .      
                   "#EC CI_ALL_FIELDS_NEEDED (confirmed full access)

As I see this statement listed in the recent ATC-check findings, I take it that this pseudo-comment is not recognized to belong to the select-statement preceeding it.

Is this correct and would it always need to be specified like this instead?

SELECT * FROM zpdm_pmp        "#EC CI_ALL_FIELDS_NEEDED
  INTO TABLE t_zpdm_pmp       "(confirmed full access)
 WHERE aennr = aenr-aennr .  

A quick check in a sandbox system seems to confirm my hunch but I'd like to have some corroboration that this is actually the case. Placed like this, and re-running the check with "exempt findings with pseudo code" only shows it when explicitely selected and with the proper tool tip:

I'd also like to know if there already are some more examples online to where I could point our developers in case they need them. I tried finding them but wasn't really lucky with my search.

Our central ATC-system is on the latest release NW 7.52 and the satellite system is on NW 7.50/EHP 8.

Thanks much and cheers

Baerbel

1 ACCEPTED SOLUTION

pokrakam
Active Contributor

The "EC pseudocode comments can live anywhere alongside the statement - but not underneath!

I think the exact position it's a matter of style and context and wouldn't place any rules around this. In the SAP example it makes more sense at the beginning rather than at the end. But the comment relates to something at the end of a long SELECT then it makes more sense to place the pseudocode comment there.

With pragmas there is no choice.

2 REPLIES 2

pokrakam
Active Contributor

The "EC pseudocode comments can live anywhere alongside the statement - but not underneath!

I think the exact position it's a matter of style and context and wouldn't place any rules around this. In the SAP example it makes more sense at the beginning rather than at the end. But the comment relates to something at the end of a long SELECT then it makes more sense to place the pseudocode comment there.

With pragmas there is no choice.

0 Kudos

Thanks for the quick response, Mike!

I was fairly certain that this would be the case, but thought - as I didn't find anything quickly - that it wouldn't hurt to have a question here in Q&A for others to find.

Cheers

Baerbel