cancel
Showing results for 
Search instead for 
Did you mean: 

SAP note 1640759 and schema based procedures

mcubilloso
Employee
Employee
0 Kudos

Hi,

I have been working for several days with a schema-based procedure.

create PROCEDURE "Y7CH"."PR_D_REG_ALL"

( IN P_MANDT VARCHAR (3),

IN p_bukrs VARCHAR (4),

IN P_BRANCH VARCHAR (4),

IN P_DATE_FROM VARCHAR (8),

IN P_DATE_TO VARCHAR (8),

OUT P_D_ALL "Y7CH"."TT_D_REG_ALL"

)

language sqlscript reads sql data

with result view CV_PR_D_REG_ALL

as

every time I need to update it, I need to DROP it and then CREATE it again. This was working fine until last friday, when I got the following message:

Could not execute 'create PROCEDURE "Y7CH"."PR_D_REG_ALL" ( IN P_MANDT VARCHAR (3), IN p_bukrs VARCHAR (4), IN ...'

SAP DBTech JDBC: [2048] (at 17): column store error: [2019] failed to save calculation scenario : The following errors occured: Index name conflicts with existing index name (2019)

I look into the notes, and found 1640759, that stands that sometimes, the calculation scenario does not get deleted, which matches perfectly with my error message, and the solution was to run:

drop calculation scenario "_SYS_BIC"."package/VIEW";

so I run two different exmples

drop calculation scenario "_SYS_BIC"."PR_D_REG_ALL"; -- procedure name

drop calculation scenario "_SYS_BIC"."CV_PR_D_REG_ALL"; -- view

But, When I do so, I get the message

SAP DBTech JDBC: [2048]: column store error: fail to drop scenario: [2007] Index does not exist

does the solution works only for package-based calculation views?

is there a table or view that I can check, looking for the existing calculation scenarios, so I can find the correct name?

thanks for the help

Mauricio

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Mauricio,

For checking calculation scenarios information, you can check the following SYS views:

1. SYS.M_CE_CALCSCENARIOS - to list all available calculation scenarios.

2. SYS.M_CE_CALCVIEW_DEPENDENCIES - to list all views referencing to a calculation scenario

Regards,

Ferry

mcubilloso
Employee
Employee
0 Kudos

Thanks Ferry,

I am checking this with the administrator, but I queried it and I can see the Scenario.

Now I need to see what is the correct way to write the DROP statement.

I'll let you know when its done

Again, thanks,

Mauricio

Former Member
0 Kudos

Hi Mauricio,

If you query "SYS"."M_CE_CALCVIEW_DEPENDENCIES" view, you should see the SCENARIO_NAME column.

For example:

I created a test calculation view "CALCULATION_VIEW" under TEST user, using "testing" package:

When I query SYS.M_CE_CALCVIEW_DEPENDENCIES view, the SCENARIO_NAME column returns me this value:

SYSBIC:testing/CALCULATION_VIEW_01

You will get authorization error if you try running DROP CALCULATION SCENARIO command (Default = CASCADE):

> DROP CALCULATION SCENARIO "_SYS_BIC"."testing/CALCULATION_VIEW_01" CASCADE

Could not execute 'DROP CALCULATION SCENARIO "_SYS_BIC"."testing/CALCULATION_VIEW_01" CASCADE'

SAP DBTech JDBC: [258]: insufficient privilege: Not authorized

If you want to drop the CALCULATION VIEW, you would need to use HANA Studio, connect to your HANA instance with the schema user, under Content folder > choose your package > Calculation Views > {Your Calculation View} > Right Click > Delete.

Using my example above, I would do the following steps to drop "CALCULATION_VIEW_01":

1. Connect to my HANA instance as "TEST" user.

2. Under Content folder > testing (package) > Calculation Views > CALCULATION_VIEW_01 > Right click and Delete.

3. Re-run the select on view "SYS".M_CE_CALCVIEW_DEPENDENCIES", to ensure that there's no entry for the Calculation View "testing.CALCULATION_VIEW_01".

HTH,

Ferry

Answers (0)