on 05-05-2017 9:52 AM - last edited on 02-03-2024 10:06 PM by postmig_api_4
Hi experts, I'm doing dynamic filtering in SAP B1 version for HANA. I'm reading this article APPLY_FILTER but I cannot get it.
I'm receiving this error:
Could not execute 'CALL "SBODEMOAU"."TEST1" ()'
SAP DBTech JDBC: [257]: sql syntax error: SQLScript APPLY_FILTER: condition in filter variable is incorrect: 'WHERE "ItemCode" = 'OS0001''
Below is my sample query:
CREATE PROCEDURE "SBODEMOAU"."TEST1" ()
AS
BEGIN
DECLARE oWHERE varchar(50);
oWHERE := ' WHERE "ItemCode" = ''OS0001'' ';
lt_test = SELECT "ItemCode", "ItemName" FROM "OITM" ;
proc = APPLY_FILTER(:lt_test, :oWHERE);
END;
CALL "SBODEMOAU"."TEST1" ();
DROP PROCEDURE "SBODEMOAU"."TEST1";
Hi Bryan
Greetings!!!
You don't need to write "where" in your string while passing it in to APPLY_FILTER. Just simply mention
oWHERE := 'ItemCode = ''OS0001''';
Please include a select statement from :proc after APPLY_FILTER statement.
Say,
SELECT * FROM :proc;
That should give you the output.
Best Regards
Srujan Gannamaneni
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Anyone who already tried this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
103 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.