cancel
Showing results for 
Search instead for 
Did you mean: 

Use Of "#EC CI_EXECSQL in ABAP with EXEC SQL. Statement giving Syntax Error

former_member191434
Participant
0 Kudos

Dear Gurus,

I have encountered an issue while trying to remove warning for using Native SQL statement using pseudo comment "#EC CI_EXECSQL

The thing is like this -- i have used follwing native sql command in abap.

EXEC SQL.
    CONNECT TO 'SURROUND_DB'
  ENDEXEC.

Now when i am checking this code in code inspector it is showing a warning with information below

CA CL_CI_TEST_CRITICAL_STATEMENTS0006
____________________________________________________
Code Inspector
Critical Statements

Use of Native SQL

Authorization checks cannot be appropriately run using EXEC SQL and should be carried out at program level.

The message can be hidden using the pseudo-comment "#EC CI_EXECSQL

Use of exceptin handling section for that warning showing me to use :

The message can be hidden using pseudo
comment      "#EC CI_EXECSQL

Now when I am using "#EC CI_EXECSQL in the abap like below :

EXEC SQL. "#EC CI_EXECSQL
    CONNECT TO 'SURROUND_DB'
  ENDEXEC.

It is giving syntax error

The text literal ""#EC CI_EXECSQL        " is longer than 255
characters.Check whether it ends correctly.

Please provide the guideline to resolve this issue.

Thanks & regards

Saifur Rahaman.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

Hi Saifur,

You can remove the warning using the following syntax:


EXEC "#EC CI_EXECSQL
  SQL.
    CONNECT TO 'SURROUND_DB'
  ENDEXEC.

At least, it worked fine for me when using OPEN CURSOR, SELECT, FETCH and so on statements.

The way to use the pseudo comment is not very intuitive, but at least for my examples worked fine.

I hope this may help you.

Best regards,

Edgardo G. König

former_member191434
Participant
0 Kudos

Let me try it. will inform as soon as i check it

former_member191434
Participant
0 Kudos

Dear Edgardo Koenig It worked out Man!!!!!!!!!!!!!

You r genious..

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Try:

EXEC SQL. #EC CI_EXECSQL

....

bye

yk

former_member191434
Participant
0 Kudos

Syntax error is not coming if i am using of #EC CI_EXECSQL instead of "#EC CI_EXECSQL .

but in code inspector the warning remains the same..

so what to do with that.

My main motive is to remove that warning what is coming in SCID.

Thanks & regards

Saifur Rahaman

Edited by: Saifur Rahaman on Oct 27, 2009 5:03 PM