问题标签 [hana-studio]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
1090 浏览

sap - 有没有办法使用 SQL 在 SAP HANA 工作室中的新角色的对象权限中添加表(针对特定模式)

我正在寻找一个 SQL 命令,它可以帮助我为 SAP HANA Studio 中的新角色添加对象权限中的多个表。目前我正在使用以下顺序为角色添加表。

  1. 在 SAP Hana Studio 中,我从 Security>Roles 创建了一个新角色
  2. 输入角色名称并选择架构。
  3. 选择对象权限并选择添加选项。
  4. 显示选择目录对象窗口,列出所有表(包括其他模式中的表)
0 投票
1 回答
3412 浏览

sql - How does one handle exceptions in date casting in SAP's HANA?

QUESTION SUMMARY:

What is the proper way within HANA SQL or HANA Studio in a view (Calculation, attribute or Analytic) to handle invalid data when attempting to cast to a date so a user can filter the data?

In SAP's table KONM the field KSTBM is a datatype of decimal(15,3). This field right or wrong, stores a date value in YYYYMMDDHHM.MSS format. (I'm a user not a designer of the system. Why anyone stores a date in a decimal field instead of a oh a date/time field is beyond the purview of this question.)

So valid values such as:

  • 201703290 (yep 2017 valid year 03 a valid month and 29 a valid day in that month for that year.)
  • 201703301.130 (yep 2017 valid year 03 a valid month and 30 a valid day in that month for that year along with 11:30 being a valid time)

exist and can easily be cast using a to_timestamp or daydate or similar function.

Unfortunately a few bad entries have been made into this table resulting in data that is unable to be cast to a date time such as:

  • 201702290 (Invalid day Feb didn't have 29 days in 2017)
  • 201713500 (Invalid Month 12 months not 13)
  • 201712312.400 (Invalid hour 00:00:00-23:59:59 there is no 24)
  • 201712310.060 (Invalid Minute 00:60 would be 01:00)
  • 201712310.090 (Invalid Minute 00:90 would be 01:30)

When using to_Timestamp or daydate functions on such invalid records the following error is presented:

SAP DBTech JDBC: [2048]: column store error: search table error: [6860] invalid date, time or timestamp value;

or

[303]: invalid DATE, TIME or TIMESTAMP value:

I agree those are invalid dates... and thus I know why the error is thrown.

While I would love to fix the root cause and then correct the bad data; that isn't presently an option. Different teams, different resources different priorities. So it's on their list of things to do but I have users who need the WEBI reports; and since the bad data exists... I still have to handle it.

What I'm trying to do is create a Calculated_view in HANA Studio which can handle these erroneous dates successfully. But I've not been able to find a try catch or other type of exception handling which would allow me to basically set these dates to NULL so the user still gets the other relevant data and are able to see they have some bad data in the system that the could correct.

As it stands since this error is thrown, no records are able to be returned from the universe when the WEBI report is run. I've found a few options that involve creating a date/time table with all possible times.... (I hope you can see why I don't want to do that) or creating a function (but it lacks specific directions; I'm afterall a new user to HANA and Universes and WEBI which is why the question exists)

Here's an example that could be run in HANA Studio:

Change isBad to 0 and it works; change isBad to 1 and you see the error.

Question Aspects:

  1. How can I get this query to run without error regardless of isBad being 1 or 0?
  2. Is there a method/manner to include/not include the bad data (perhaps set all bad data to NULL in the result and null data can then be included/excluded as a user's option?
  3. is there a way in a view to identify these bad records in a calculated column so we don't try and convert them if invalid and do try when valid?
  4. Is my approach simply wrong and I need to retrain my Oracle/MS SQL/MySQL brain to think differently? Other languages I'd handle exceptions, or try catch or use isdate() to check for valid before attempting to cast... I just don't see those options here (but I'm new and perhaps simply unable to use the help very well yet)

Thanks for reading my long drawn out question. Hopefully I've provided sufficient details.

I'm trying to avoid:

0 投票
1 回答
1669 浏览

sap-gui - SAP HANA Studio 更改 SAP GUI 分辨率

我无法更改 SAP GUI 分辨率,找不到选项。我已经在 Window->Preferences->SAP GUI Integration 下将字体大小缩放因子更改为 80% 的最小值,但结果几乎相同:

在此处输入图像描述

菜单和图标太大,我没有改造的全貌。如何更改分辨率?也许在一些 .ini 文件中?

0 投票
1 回答
1293 浏览

sap - 触发以更新表 SAP HANA 中的特定行

我正在尝试在 Hana Studio 上创建一个触发器,以在表“T1”中发生更新时更新给定的注册表(表“T2”中的“F2”列)。来自“T1”的行在表“T2”中通过字段“X1”引用(即,T1 中的 X1 等于 T2 上的 X2)。

我想要做的是从表“T1”(即正在更新的表)中获取字段“X1”的值,并将其用作 where 子句以了解应该在表“T2”上更新哪一行.

这是我的触发器(或者我想要它做的事情):

问题是 X1 是我更新行中的一个字段。有没有办法从我的触发器上的更新行访问数据?

0 投票
2 回答
1328 浏览

sap - Hana Studio(SQL 脚本)触发器的条件更新

我有两个示例表:

我想做的是使用 SQL 脚本在 Hana Studio 上编写一个触发器,以在表 1 中的列 B 更新为特定值(例如 100)时更新表 2 中的列 E。表 2 中的第一列 (ID) 引用了表 1 中的行。

我写了以下代码:

当我将第 1 行的 TABLE1.COLUMN_B 设置为 100 时,我希望代码将第 1 行的 TABLE2.COLUMN_E 更改为“我的新值”,但没有任何反应。谁能指出我在这里做错了什么?

0 投票
1 回答
2053 浏览

sap - SAP HANA 工作室为当前模式打开 sql 控制台

我通过单击架构从 hana studio 打开 sql 控制台,但它没有连接到数据库。如何配置它以使其以当前模式打开?

0 投票
2 回答
57 浏览

sql - 使用 SQL 脚本的条件 SQL 查询

我有两个示例表:

它们通过 ID 列相互关联。我想在 TABLE1 上执行选择,仅当 COLUMN_E 上的值为 Y 时才带上 COLUMN_B 和带上 COLUMN_C。

是否可以创建一个模拟类似以下内容的条件:“选择 column_b,并且仅当 TABLE2 中 column_e 上的值对于相同 ID 为 Y 时才选择 column_c”?

0 投票
2 回答
759 浏览

sap - HANA - 使用其他行的数据进行计算

我有一个要求,使用属性视图根据条件和值来自另一行来计算结果。

如果 KSCHL = Y 则结果将从 KBETR 设置。如果没有,Result 将由它自己的 KBETR * KBETR 从相应的密钥对(MATNR,WERKS)中设置。请参阅示例。

MATNR | 工作 | KSHL | KBETR | 预期结果

01 | 一个 | X | 10 | 200×10

01 | 一个 | 是 | 200 | 200

01 | 一个 | Z | 15 | 200×15

我正在考虑添加一个隐藏列来将值 200 存储在其他行上,然后使用它来执行倍数,或者创建一个带有参数的计算视图来保存该值。但是,我仍然没有得到该要求的正确答案。

感谢您的帮助,非常感谢

0 投票
0 回答
147 浏览

sql - Hana studio - 附加符号注释代码

我正在使用 sap hana 1.0 sps12 和 hana studio 2.3.8。

当我使用双管 '||' 作为 sql append,studio 将双管道后的代码视为注释。

例如

从假人中选择'A'||'B';

Hana 正在从假人中治疗“B”;部分作为评论。

我在哪里可以更改此设置

0 投票
1 回答
421 浏览

datatable - 从 SLT 表中删除部分数据

我需要从 SLt 表的 VBFA 表中删除数据。我们需要删除 2017 年 10 月之前的数据。我们如何才能做到这一点,因为我们拥有的唯一提交日期是 MJAHR,它是材料文档年份和创建记录的 ERDAT 日期。

我们如何在 2017 年 10 月之前删除数据