Skip to Content
0

[Help] - APPLY_FILTER error

May 05, 2017 at 08:52 AM

52

avatar image
Former Member

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";
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

avatar image
Former Member May 15, 2017 at 02:43 PM
0

Anyone who already tried this?

Share
10 |10000 characters needed characters left characters exceeded
Srujan Gannamaneni Mar 14 at 03:57 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded