首页 > 数据库 >【ABAP】opensql 语法错误

【ABAP】opensql 语法错误

时间:2023-06-06 11:44:36浏览次数:38  
标签:CASE dmbe2 语法错误 opensql WHEN ABAP dmbtr places bsad

在使用case对金额字段进行操作时报错

The maximum possible number of places in the expression starting with DMBTR is 34 places with 2 decimal places. There can be, however, no more than 31 places and 14 decimal places.

select CASE bsad~shkzg WHEN 'H' THEN bsad~dmbtr * -1   ELSE bsad~dmbtr END AS dmbtr,
        CASE bsad~shkzg WHEN 'H' THEN  bsad~dmbe2 * -1  ELSE bsad~dmbe2 END AS dmbe2,
from bsad.

需要使用cast进行类型转换

select CASE bsad~shkzg WHEN 'H' THEN (  CAST( bsad~dmbtr * -1  AS CURR( 23,2 ) ) ) ELSE bsad~dmbtr END AS dmbtr,
        CASE bsad~shkzg WHEN 'H' THEN (  CAST( bsad~dmbe2 * -1  AS CURR( 23,2 ) ) ) ELSE bsad~dmbe2 END AS dmbe2,
from bsad.

 

标签:CASE,dmbe2,语法错误,opensql,WHEN,ABAP,dmbtr,places,bsad
From: https://www.cnblogs.com/Lingcc/p/17460112.html

相关文章

  • 利用APIFOX对ABAP函数进行调用
    1.安装APIFOX,当然也可以使用在线版,无需下载官网地址:https://apifox.com/ 2.新建项目 3.为项目起一个名称,为相关开发测试人员授权 4.在根目录新增子目录 5.编辑开发/测试/生产环境的地址信息以及默认全局变量 6.将SAP提供的ABAPAPI地址配置进APIFOX,有关ABAP提......
  • ABAP 多线程
    Codelistingfor:ZTEST9010Description:12345*&---------------------------------------------------------------------**&ReportZTEST_ASYNC_RFC*&---------------------------------------------------------------------**&*&-----------......
  • ABAP 增强查找工具
    *&---------------------------------------------------------------------**&ReportZ_BARRY_FIND_EXIT_BADI*&---------------------------------------------------------------------**&*&---------------------------------------------------......
  • ABAP 用户批量导入
    REPORTZ_USER_IMPORT.TABLES:E070.DATA:BDCDATALIKEBDCDATAOCCURS0WITHHEADERLINE.DATA:MESSTABLIKEBDCMSGCOLLOCCURS0WITHHEADERLINE.DATA:P_SNTYPEI.****DATA:W_DOCIDTYPEDSVASDOCID,W_EXTENSIONTYPEDSVASDOCID,W......
  • ABAP 用户权限查询报表
    *&---------------------------------------------------------------------**&REPORTZUSER*&---------------------------------------------------------------------**&*&--------------------------------------------------------------------......
  • ABAP 用户角色导入
    *&---------------------------------------------------------------------**&ReportZ_USER_ROLES_IMPORT*&---------------------------------------------------------------------**&*&------------------------------------------------------......
  • ABAP 通用自建表批到
    *&---------------------------------------------------------------------**&ReportZUPLOAD_TABLE*&---------------------------------------------------------------------**&*&------------------------------------------------------------......
  • ABAP-屏幕设计-上门拜访动态切换
    *&---------------------------------------------------------------------**&ReportZHQ_01_04*&*&---------------------------------------------------------------------**&*&*&-------------------------------------------------......
  • ABAP:CO11N,CO13保存前增强
    SE18:WORKORDER_CONFIRMMETHODif_ex_workorder_confirm~at_save.DATA:s_vornrTYPERANGEOFresb-vornr.DATA:lv_vornrLIKELINEOFs_vornr.DATA:lv_gmngaTYPEafru-gmnga,lv_mengeTYPEmseg-menge,lv_menge_s......
  • ABAP新语法的坑
    1.问题描述新语法:SELECT或者READTABLE...INTODATA(变量名),直接将结果放到变量里面,不用声明变量的类型。看下面的代码,当READTABLElt_aufk没有查到值的时候,不会将空值INTO到结构变量ls_aufk2里面,ls_aufk2还是上一条记录的值。2.解决办法循环外面加上:CLEARls_aufk2."......