SAP CRM数据库表CRMD_CUMULAT_H的设计原理
Recently I am working in a project and the prerequisite is to understand how table CRMD_CUMULAT_H works. As I could not find enough material in SCN, I make some self study on it and list my learning in this blog. Let me use one record for example to illustrate how its GROSS WEIGHT 400 KG is determined.
As the table name “cumulate” indicates, certain fields in this table are cumulated. I write a small API to demonstrate the logic, it will generate the same Gross Weight amount: 400
DATA: lt_order_i TYPE TABLE OF crmd_orderadm_i-guid,
lt_product_i TYPE TABLE OF crmd_product_i.
SELECT guid INTO TABLE lt_order_i FROM crmd_orderadm_i
WHERE header = iv_guid.
CHECK sy-subrc = 0.
SELECT guid gross_weight INTO CORRESPONDING FIELDS OF TABLE lt_product_i FROM crmd_product_i
FOR ALL ENTRIES IN lt_order_i WHERE guid = lt_order_i-table_line.
LOOP AT lt_product_i ASSIGNING FIELD-SYMBOL(<product>).
rv_gross_weight = rv_gross_weight + <product>-gross_weight.
ENDLOOP.
In order to better explain the calculation logic, I draw a picture below.
Where is gross weight in CRMD_PRODUCT_I.GROSS_WEIGHT coming from
The next question is: how is the value of field GROSS_WEIGHT in table CRMD_PRODUCT_I populated? When we log on WebClient UI, we can only see the quantity 4 ST in each line item. Why 4 ST of product has gross weight 200 KG?
First get product IMU’s guid from table COMM_PRODUCT:
00163EA71FFC1EE1A7CCADA1477A9164 Then query table COMM_PR_UNIT with this guid, and we can know from there that 1 ST = 50 KG, so 4 ST = 200 KG.
When I change the quantity of first item from 4 to 3,
the updated gross weight ( 3 * 50 = 150 KG ) is persisted to database via update function module:
- Elasticsearch增删改查 之 —— mget多文档查询
- Elasticsearch 之 数据索引
- AngularJS 国际化——Angular-translate
- MFC中注释含义
- Elasticsearch Span Query跨度查询
- 2017年重写人类两端时长的科技大事记
- Elasticsearch DSL中Query与Filter的不同
- Elasticsearch 文件目录解释
- MFC常用基本数据类型
- 很全很全的 前端 本地存储方式讲解
- static用法详解
- Elasticsearch 数据搜索篇·【入门级干货】
- 简单文本编辑器制作--windows程序设计雏形
- AngularJS 使用$sce控制代码安全检查
- JavaScript 教程
- JavaScript 编辑工具
- JavaScript 与HTML
- JavaScript 与Java
- JavaScript 数据结构
- JavaScript 基本数据类型
- JavaScript 特殊数据类型
- JavaScript 运算符
- JavaScript typeof 运算符
- JavaScript 表达式
- JavaScript 类型转换
- JavaScript 基本语法
- JavaScript 注释
- Javascript 基本处理流程
- Javascript 选择结构
- Javascript if 语句
- Javascript if 语句的嵌套
- Javascript switch 语句
- Javascript 循环结构
- Javascript 循环结构实例
- Javascript 跳转语句
- Javascript 控制语句总结
- Javascript 函数介绍
- Javascript 函数的定义
- Javascript 函数调用
- Javascript 几种特殊的函数
- JavaScript 内置函数简介
- Javascript eval() 函数
- Javascript isFinite() 函数
- Javascript isNaN() 函数
- parseInt() 与 parseFloat()
- escape() 与 unescape()
- Javascript 字符串介绍
- Javascript length属性
- javascript 字符串函数
- Javascript 日期对象简介
- Javascript 日期对象用途
- Date 对象属性和方法
- Javascript 数组是什么
- Javascript 创建数组
- Javascript 数组赋值与取值
- Javascript 数组属性和方法
- Go defer 会有性能损耗,尽量不要用?
- 带入gRPC:分布式链路追踪 gRPC + Opentracing + Zipkin
- 聊聊Golang逃逸分析
- 结构型设计模式:适配器模式和门面模式
- 结构型设计模式:代理模式
- kubernete中的原子调度单位:pod
- mybatis-generator在命令行及IEAD中的使用
- mybatis-generator在命令行及IDEA中的使用
- 70-STM32+ESP8266+AIR202基本控制篇-移植使用-移植单片机MQTT底层包到自己的工程项目
- springboot研究:springboot自带监控actuator
- springboot研究:springboot使用swagger自动构建api
- numpy/pandas瞎搞系列(一):OLS,WLS的numpy实现
- redis实战第三篇 redis sentinel安装和部署
- 后浪,谈谈你对jvm性能调优的理解
- Homer预测共表达基因的motif