cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to access custom tables from the scripts in SAP advanced workflow

debtechno
Discoverer
0 Kudos
517

I'm building an application using SAP advanced workflow. I have created a custom table from which I can load the options in the drop downs of the application using select queries. My application creates insurance plans which I want to store in the same custom table. But when I'm trying to access the custom table from a groovy script using a select query then I'm getting the following error - nested exception is com.sap.db.jdbc.exceptions.JDBCDriverException: SAP DBTech JDBC: [259] (at 181): invalid table name: Could not find table/view.

I'm able to access the EXT tables using select query from the script by specifying EXT.,<Table_Name>. So, I think the custom tables are also stored in some schema which I don't know the name of. As I'm not specifying the schema name in the query so the custom tables are not found. If anyone can help me with the schema name where custom tables are stored then this query will probably work.

Accepted Solutions (0)

Answers (1)

Answers (1)

Lana
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

Table which you create in EXT schema is a table inside Incentive Management application. For SAP Advanced Workflow application, those are 'external tables'. And those can be accessed from Workflow scripts by using dbConnect method. See more on Example of Using SQL on External Database

Tables which you create inside SAP Advanced Workflow (when you go to Setup->Development->Custom tables), are Workflow custom tables and those are stored in a Workflow's database schema. You can access those custom tables only on Custom Tables page in SAP Advanced Workflow and from scripts in SAP Advanced Workflow.

To run a query on a custom table from a script in SAP Advanced Workflow, you need to use methods from ScriptCustomTableManager, for example like this:

 def ctResults = resp.customTable.findAll("select columnA, columnB, columnC from myCustomTable);

Please see in our online help which different methods exist for working with custom tables and if needed, how to bind parameters in queries with custom tables.

Best regards

Lana

(Product Owner of SAP Advanced Workflow)