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

SQL Statement error

Former Member
0 Likes
928

Hi All,

I was trying to execute a standard function module in which there is a sql statement where IN operator is used.

The no of choices given for that field by the IN operator is 1065.

The error displayed is the SQL statement generated from the SAP Open SQL statement violates a restriction imposed by the underlying database system of the ABAP system.

But when I am reducing the no of choices for that filed to 1000 the function modules executes smoothly.

Now from all these I can understand that there is some restriction imposed by underlying database for the no of choices by IN operator in select statements. I want a way to override that restriction.

The function module I was executing is 'K_PRCTR_VALUES_GET'. The error hits at line no 162 when the table t_selopt contains 1065 line items. Now this function modules gives us all the profit centers based on Profit-center group. So according to the current scenario for the respective profit-center group there are 1065 no. of profit centers. So there is no way that we can reduce the no. of profit centers for profit center group rather I have to find the other way out.

I will really appreciate the inputs. Please help me out in with this problem. Points will be awarded for good answer.

Thanks in advance.

Regards,

Piyush Kothari

1 ACCEPTED SOLUTION
Read only

Sm1tje
Active Contributor
0 Likes
868

Indeed there is a limit to the SELECT-OPTIONS / RANGES with the IN operator. But unfortunately there is no way bypass this limitation.

The only thing you can do (sort of workaround) is to call the function module several times for x-number of profit centers (if possible in your particular case).

It might be an option to talk to one of your basis administrators, perhaps they have another solution for this. But from ABAP side there is nothing you can do about it.

3 REPLIES 3
Read only

Former Member
0 Likes
868

Hi,

pls ensure that the internal table that u have declared has occurs 10000 instead of occurs 0 and give it a try.

Regards

Ajith

Read only

Sm1tje
Active Contributor
0 Likes
869

Indeed there is a limit to the SELECT-OPTIONS / RANGES with the IN operator. But unfortunately there is no way bypass this limitation.

The only thing you can do (sort of workaround) is to call the function module several times for x-number of profit centers (if possible in your particular case).

It might be an option to talk to one of your basis administrators, perhaps they have another solution for this. But from ABAP side there is nothing you can do about it.

Read only

Former Member
0 Likes
868

hi this is the good way i think....

please go to the site www.solutions.sap.com and post your error then you will get the exact answer...

regards,

venkat.