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

CX_SY_GEN_SOURCE_TOO_WIDE - Native SQL

Former Member
0 Likes
563

I have a function that runs a native sql statement in a generated subroutine ( based on an example posted by Rich Heilman here ==> ).

When l_statement (my native sql statement) is greater than 255 characters, I get the following error ==> CX_SY_GEN_SOURCE_TOO_WIDE ... however, if the sql is <= 255, I do not get an error.

I have modified many of the char variables in the function to be string variables, and I'm still receiving getting the same error. Is there a limitation on the length of a native sql statement ? If so, can someone recommend a possible work around ?

Thanks !

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
528

Yes there is a limitation on as to how long an ABAP statement can be and that is 255 as you found out.

What you have to do is to have your native sql statement on separate lines instead of one long line. For instance,

you can have each AND/OR where conditions on seperate lines(different records in the itab containing the code for the subroutine).

Srinivas

I have a function that runs a native sql statement in a generated subroutine ( based on an example posted by Rich Heilman here ==> ).

When l_statement (my native sql statement) is greater than 255 characters, I get the following error ==> CX_SY_GEN_SOURCE_TOO_WIDE ... however, if the sql is <= 255, I do not get an error.

I have modified many of the char variables in the function to be string variables, and I'm still receiving getting the same error. Is there a limitation on the length of a native sql statement ? If so, can someone recommend a possible work around ?

Thanks !

2 REPLIES 2
Read only

Former Member
0 Likes
529

Yes there is a limitation on as to how long an ABAP statement can be and that is 255 as you found out.

What you have to do is to have your native sql statement on separate lines instead of one long line. For instance,

you can have each AND/OR where conditions on seperate lines(different records in the itab containing the code for the subroutine).

Srinivas

Read only

0 Likes
528

Thanks Srinivas.

This gets me going in the right direction. I need to figure out how to continue a string across 2 lines within a db2 sql statement, but I should be able to answer that with some more google searching.