如何在SAP HANA中为变量分配列值

2020-09-28 12:13发布

点击此处---> 群内免费提供SAP练习系统(在群公告中)加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)嗨, 在这里,我尝试根据使用过...

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


嗨,

在这里,我尝试根据使用过程订购的数量给予折扣。 但是我不知道如何在过程中将column的值分配给变量。

这是我的代码:

创建列表" KABIL_PRACTICE"。" SALES_IF_ELSE"
 (
 " SALES_ID"整数,
 " PRODUCT_ID"整数,
 " QTY"整数,
 " DISCOUNT"整数,
 " SALES_AMOUNT"双
 );

 " SALES_IF_ELSE"(" SALES_ID"," PRODUCT_ID"," QTY"," SALES_AMOUNT")值(1,101,15,1500)插入到" KABIL_PRACTICE"中;
 " SALES_IF_ELSE"(" SALES_ID"," PRODUCT_ID"," QTY"," SALES_AMOUNT")值(2,102,25,2500);将其插入" KABIL_PRACTICE"。
 值" 3,103,35,3500";" SALES_IF_ELSE"(" SALES_ID"," PRODUCT_ID"," QTY"," SALES_AMOUNT")值插入到" KABIL_PRACTICE"中;
 值" 4,104,40,4000"中的" SALES_IF_ELSE"(" SALES_ID"," PRODUCT_ID"," QTY"," SALES_AMOUNT")插入到" KABIL_PRACTICE"中;
 " SALES_IF_ELSE"(" SALES_ID"," PRODUCT_ID"," QTY"," SALES_AMOUNT")值(5,105,27,2700);将其插入" KABIL_PRACTICE"。
 " SALES_IF_ELSE"(" SALES_ID"," PRODUCT_ID"," QTY"," SALES_AMOUNT")值(6,106,32,3200)插入;并插入" KABIL_PRACTICE"中。
 值(7,107,19,1900);" SALES_IF_ELSE"(" SALES_ID"," PRODUCT_ID"," QTY"," SALES_AMOUNT")值插入到" KABIL_PRACTICE"中;


 创建过程" KABIL_PRACTICE"。" IF_ELSE_DISC"
  语言sqlscript
  一开始
   声明QTY整数;
    " SALES_IF_ELSE":=数量;从" KABIL_PRACTICE"中选择"数量"。
  如果(数量> 25)
  然后
  更新" KABIL_PRACTICE"。" SALES_IF_ELSE"设置为" DISCOUNT" = 5;
  否则,如果
  更新" KABIL_PRACTICE"。" SALES_IF_ELSE"设置为" DISCOUNT" = 1;
  万一;
  万一;
  结束;
 

有人帮助我。...

3条回答
Tong__Ming
2020-09-28 12:47

嗨弗洛里安,

我只想知道如何将列值分配给在此声明为" QTY"的变量...

一周热门 更多>