SQL到SQL HANA FMS转换帮助

2020-09-15 16:12发布

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

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


SQL

声明@Customer nvarchar(30)
 声明@SoldTo nvarchar(30)
 声明@Node nvarchar(30)
 声明@Discount十进制(18,2)
 声明@ItemCode nvarchar(50)
 声明@DiscountGroup nvarchar(50)
 声明@TradeCode十进制(18,2)
 声明@PotentialClass nvarchar(20)
 声明@DocDate日期
 声明@DocDateStr nvarchar(50)
 设置@ItemCode = $ [$ 38.1.0]
 设置@DiscountGroup = $ [QUT1.U_DiscGroup]
 设置@TradeCode = $ [$ U_TrdCode.0.0]
 设置@PotentialClass = $ [$ U_PotClass.0.0]
 设置@DocDateStr = $ [OQUT.TaxDate]
 设置@DocDate ='20'+右(@DocDateStr,2)+'/'+左(RIGHT(@DocDateStr,5),2)+'/'+左(@ DocDateStr,2)
  - 顾客
 设置@Customer = $ [$ 4.0.0]
 从OCRD中选择@SoldTo = OCRD.FatherCard,其中OCRD.CardCode = @Customer
 从OCRD中选择@Node = OCRD.U_NodeCustomer,其中OCRD.CardCode = @SoldTo
 设置@Discount = 0
 如果@Customer In(从OSPP选择OSPP.CardCode,其中OSPP.Valid ='Y'
 和@DocDate> = OSPP.ValidFrom和@DocDate <= OSPP.ValidTo)
 开始
 设置@Discount = 0
 选择@折扣
 结束
 设置@Discount = 0
 -4级客户特定商品折扣
 如果@ Discount = 0
 从[@CSMT_SPFC_ITEMDSCNT]中选择@Discount = isull(U_Dscnt,0),其中U_CustomerCode = @Customer和U_ItemCode = @ItemCode和@DocDate> = U_ValidFrom和@DocDate <= U_ValidTo
 如果@ Discount = 0
 从[@CSMT_SPFC_ITEMDSCNT]中选择@Discount = isull(U_Dscnt,0),其中U_CustomerCode = @SoldTo和U_ItemCode = @ItemCode和@DocDate> = U_ValidFrom和@DocDate <= U_ValidTo
 如果@ Discount = 0
 从[@CSMT_SPFC_ITEMDSCNT]中选择@Discount = isull(U_Dscnt,0),其中U_CustomerCode = @Node和U_ItemCode = @ItemCode以及@DocDate> = U_ValidFrom和@DocDate <= U_ValidTo
 -3级客户特定折扣组
 如果@Discount = 0
 从[@CSTMR_SPFC_DSCNTGRP]中选择@Discount = isull(U_Dscnt,0)其中U_CustomerCode = @Customer和U_DiscGroup = @DiscountGroup和@DocDate> = U_ValidFrom和@DocDate <= U_ValidTo
 如果@Discount = 0
 从[@CSTMR_SPFC_DSCNTGRP]中选择@Discount = isull(U_Dscnt,0)其中U_CustomerCode = @SoldTo和U_DiscGroup = @DiscountGroup和@DocDate> = U_ValidFrom和@DocDate <= U_ValidTo
 如果@Discount = 0
 从[@CSTMR_SPFC_DSCNTGRP]中选择@Discount = isull(U_Dscnt,0)其中U_CustomerCode = @Node和U_DiscGroup = @DiscountGroup和@DocDate> = U_ValidFrom和@DocDate <= U_ValidTo
 -2级特殊物品Discoun
 如果@Discount = 0
 从[@SPCL_ITEM_DSCNT]中选择@Discount = isull(U_Dscnt,0)其中(U_ItemCode = @ItemCode和U_TradeCode = @TradeCode和U_PotClass = @PotentialClass)或(U_ItemCode = @ItemCode和U_PotClass = @PotentialClass)和@DocDate> = U_ValidFrom 和@DocDate <= U_ValidTo
 -1级折扣组
 如果@Discount = 0
 从[@DISCOUNT_GROUP]中选择@Discount = isull(U_Dscnt,0)其中(U_DiscGroup = @DiscountGroup和U_TradeCode = @TradeCode
 和U_PotClass = @PotentialClass)或(U_DiscGroup = @DiscountGroup和U_PotClass = @PotentialClass)
 和@DocDate> = U_ValidFrom和@DocDate <= U_ValidTo
 选择@Discount 

HANA

需要帮助将上述sql转换为sql hana 

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

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


SQL

声明@Customer nvarchar(30)
 声明@SoldTo nvarchar(30)
 声明@Node nvarchar(30)
 声明@Discount十进制(18,2)
 声明@ItemCode nvarchar(50)
 声明@DiscountGroup nvarchar(50)
 声明@TradeCode十进制(18,2)
 声明@PotentialClass nvarchar(20)
 声明@DocDate日期
 声明@DocDateStr nvarchar(50)
 设置@ItemCode = $ [$ 38.1.0]
 设置@DiscountGroup = $ [QUT1.U_DiscGroup]
 设置@TradeCode = $ [$ U_TrdCode.0.0]
 设置@PotentialClass = $ [$ U_PotClass.0.0]
 设置@DocDateStr = $ [OQUT.TaxDate]
 设置@DocDate ='20'+右(@DocDateStr,2)+'/'+左(RIGHT(@DocDateStr,5),2)+'/'+左(@ DocDateStr,2)
  - 顾客
 设置@Customer = $ [$ 4.0.0]
 从OCRD中选择@SoldTo = OCRD.FatherCard,其中OCRD.CardCode = @Customer
 从OCRD中选择@Node = OCRD.U_NodeCustomer,其中OCRD.CardCode = @SoldTo
 设置@Discount = 0
 如果@Customer In(从OSPP选择OSPP.CardCode,其中OSPP.Valid ='Y'
 和@DocDate> = OSPP.ValidFrom和@DocDate <= OSPP.ValidTo)
 开始
 设置@Discount = 0
 选择@折扣
 结束
 设置@Discount = 0
 -4级客户特定商品折扣
 如果@ Discount = 0
 从[@CSMT_SPFC_ITEMDSCNT]中选择@Discount = isull(U_Dscnt,0),其中U_CustomerCode = @Customer和U_ItemCode = @ItemCode和@DocDate> = U_ValidFrom和@DocDate <= U_ValidTo
 如果@ Discount = 0
 从[@CSMT_SPFC_ITEMDSCNT]中选择@Discount = isull(U_Dscnt,0),其中U_CustomerCode = @SoldTo和U_ItemCode = @ItemCode和@DocDate> = U_ValidFrom和@DocDate <= U_ValidTo
 如果@ Discount = 0
 从[@CSMT_SPFC_ITEMDSCNT]中选择@Discount = isull(U_Dscnt,0),其中U_CustomerCode = @Node和U_ItemCode = @ItemCode以及@DocDate> = U_ValidFrom和@DocDate <= U_ValidTo
 -3级客户特定折扣组
 如果@Discount = 0
 从[@CSTMR_SPFC_DSCNTGRP]中选择@Discount = isull(U_Dscnt,0)其中U_CustomerCode = @Customer和U_DiscGroup = @DiscountGroup和@DocDate> = U_ValidFrom和@DocDate <= U_ValidTo
 如果@Discount = 0
 从[@CSTMR_SPFC_DSCNTGRP]中选择@Discount = isull(U_Dscnt,0)其中U_CustomerCode = @SoldTo和U_DiscGroup = @DiscountGroup和@DocDate> = U_ValidFrom和@DocDate <= U_ValidTo
 如果@Discount = 0
 从[@CSTMR_SPFC_DSCNTGRP]中选择@Discount = isull(U_Dscnt,0)其中U_CustomerCode = @Node和U_DiscGroup = @DiscountGroup和@DocDate> = U_ValidFrom和@DocDate <= U_ValidTo
 -2级特殊物品Discoun
 如果@Discount = 0
 从[@SPCL_ITEM_DSCNT]中选择@Discount = isull(U_Dscnt,0)其中(U_ItemCode = @ItemCode和U_TradeCode = @TradeCode和U_PotClass = @PotentialClass)或(U_ItemCode = @ItemCode和U_PotClass = @PotentialClass)和@DocDate> = U_ValidFrom 和@DocDate <= U_ValidTo
 -1级折扣组
 如果@Discount = 0
 从[@DISCOUNT_GROUP]中选择@Discount = isull(U_Dscnt,0)其中(U_DiscGroup = @DiscountGroup和U_TradeCode = @TradeCode
 和U_PotClass = @PotentialClass)或(U_DiscGroup = @DiscountGroup和U_PotClass = @PotentialClass)
 和@DocDate> = U_ValidFrom和@DocDate <= U_ValidTo
 选择@Discount 

HANA

需要帮助将上述sql转换为sql hana 
付费偷看设置
发送
2条回答
哎,真难
1楼-- · 2020-09-15 16:54
d56caomao
2楼-- · 2020-09-15 16:59

< rel =" nofollow" hraf=" https://people.sap.com/travkin">谢尔盖·特拉夫金

可以帮助您在过程中创建它吗,我可以作为参考,以便我知道如何创建和调用它,谢谢。

一周热门 更多>