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

Dynamic SQL Qeury.

Former Member
0 Likes
345

If the SELECT query has dynamic WHERE clause then in CRM side it fails if the number of records are more than 13000 in table from where we are picking up the values. We have used it many a place in whole application. Is there any way to handle it by configuring System level change rather than changing the code? We have problems in changing the code as it is used in multiple locations in whole custom application.

Example1:

DELETE FROM <table1> WHERE <field1> IN ( SELECT <field1> FROM <table2>

WHERE <field2> = <var2> ).

<table1> has more than 13000 records.

Thank you.

Cheers,

Ashish

2 REPLIES 2
Read only

Former Member
0 Likes
313

Hi ,

Incase u changes code ,better use modular programming ,include the code in form

,so that you dont have to face such problem again.

Regards,

Kiran

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
313

Hello Asish,

This is b'coz the SQL statement you've coded exceeds maximum length of the SQL statement for your SAP release.(Search for relevant OSS Notes, you can check ABAP forums as well i remember a discussion on this 1-2 weeks back)

The Open SQL statement with the range (after the 'IN' keyword) is parsed before being forwarded to the DB layer & if your range contains too many recs your DELETE stmt will result in a runtime error.

BR,

Suhas