Application Development and Automation 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: 
Read only

How to skip non executeable sql stmts?

Former Member
0 Likes
871

Hi people,

in my program, I have some SQL Stmts that can not be executed because the table is missing in the system. I have got many stmts in my program. I would not like to check each stmt in my program.

If I would like to test the program, I get the message that the corresponding table is missing.

How can I skip this?

If I generate and run the program, how can I skip stmts that are not executable because of missing tables?

Is there any possibility?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
838

Holger - I assume this is related to your earlier question. I think your only option is to create the program using the generate statement. But now, before generating an SQL statement for a table, you have to check its existence in table DD02L.

Rob

8 REPLIES 8
Read only

Former Member
0 Likes
838

hi,

we can use CATCH ... Exceptions , but your case its not helpful, you can simply comment it and execute the report

cheers,

sasi

Read only

0 Likes
838

but I will have to comment all the stmts manually. If there are thousand of stmts, this will take a long time.

Or do you mean that there is any possiblity to comment if automatically?

If one of the stmts does can not be executed, I would like to continue with the next one.

The program should not stop if an invalid stmt is tried to be executed...

Read only

0 Likes
838

hi,

I thing there is no single statement used like if any error execute next one

using sy-subrc you can validate some statements, but that also we should do manually

comment is the only option

select bulk of lines then use Ctrl+< ( it will comment all the selected lines

cheers,

sasi

Read only

0 Likes
838

Hi Holger ,

I guess you are trying to execute a program which has syntax errors ( like database table does not exist ). This is not possible unless you fix the program and make in syntax error free.

Also there is no other way than manual to comment out the individual lines .

I am wondering where did you get such a program on your system which does not have the referenced tables in the database / data dictionary.

Cheers.

Read only

0 Likes
838

I would do some tests in a test system. I got the SQL stmts in a productive system. The test system does not have all data that exist in the productive system or rather the content of the tables may differ.

but a transport would solve the problem...

Read only

Former Member
0 Likes
838

why would u need sql statements for tables that do not exist in the Database/DDIC.

The program will throw a syntax error saying that the corresponding table name speficied is not a table or a view....u must comment such statements and then proceed.

rgds,

PJ

Read only

Former Member
0 Likes
838

Holger,

If you prefer, you can do this from the Editor. Go to Program -> Check -> Extended Program Check. In the next screen, Checks -> Standard Check.

Then from the follwing screen you can double click the 'Error Column' and change/comment out the code from there. The advantage of this is you can see all your syntax errors at one place. You also have the option to correct from the editor one-by-one by doing Syntax Check.

Cheers,

Syd.

Read only

Former Member
0 Likes
839

Holger - I assume this is related to your earlier question. I think your only option is to create the program using the generate statement. But now, before generating an SQL statement for a table, you have to check its existence in table DD02L.

Rob