07-18-2008 3:45 PM
Dear All,
i got a problem with dynamic select statement.i.e i written a select statement in that i included a where condition.the code for the where condition is as fallows.
DATA : STR_LINE TYPE EDPLINE,
STR_WHERE TYPE TABLE OF EDPLINE.
AND in STR_LINE i appended the condition values like as fallows
" industry = 'telecom' and apparea = 'r/3' and ....."
like above i've total 8 values. So Based on my requirement i may give all the 8 values or some of them.
my problem is iam able to get the where condition upto 72 char only ,cause edpline holds only 72 chars.So after i got the values into str_line iam appending that value into STR_WHERE,but when i used STR_WHERE condition in select statement it gives a dump error like in correct format of where condition.
And i tried STR_LINE type as STRING and also STR_WHERE as String and at that time also iam getting same kind of error.
MY WHERE CONDITION HOLDS APPROX., OF 200 CHAR OF LENGTH pls remeber this .
can u people pls give the solution for this,
Thanks in advance to u all,
Ajay Kumar K,
9908979994.
07-18-2008 3:53 PM
Hi Ajay,
Check this links for dynamic select statements,
http://www.itp-consulting.com/dynamic%20SQL%20in%20SAP.pdf
http://help.sap.com/saphelp_nw70/helpdata/en/67/93b80914a911d2953c0000e8353423/content.htm
Regards
Adil
07-18-2008 3:52 PM
Hi,
I believe the error is not related to the length of the string...if you have an internal table for which the each row of length 72...that should be good enough...
It is related to building the where clause....put a break-point before the SQL...and then check what exactly is the value in the internal table ...you might be missing..some operators like AND...
Thanks
Naren
07-18-2008 3:53 PM
Hi Ajay,
Check this links for dynamic select statements,
http://www.itp-consulting.com/dynamic%20SQL%20in%20SAP.pdf
http://help.sap.com/saphelp_nw70/helpdata/en/67/93b80914a911d2953c0000e8353423/content.htm
Regards
Adil
07-18-2008 3:54 PM
You need to put the conditions in ( ) as follows:
TABLES: zlmlead.
DATA : STR_LINE TYPE EDPLINE,
STR_WHERE TYPE TABLE OF EDPLINE.
START-OF-SELECTION.
STR_LINE = 'leadid eq 1'. append STR_LINE to str_where.
SELECT SINGLE * FROM zlmlead
WHERE (str_where). "<== note where you need to change
BREAK-POINT.
07-18-2008 3:58 PM
Hi,
Actually it is a bit confusing. Can you provide us with your select statement and what you are trying to do actually.I think we can solve the problem.
Regards,
Swarna Munukoti.