zoukankan      html  css  js  c++  java
  • 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:


    要获取更多Jerry的原创文章,请关注公众号"汪子熙":

  • 相关阅读:
    centos 搭建ftp服务器
    一种让超大banner图片不拉伸、全屏宽、居中显示的方法
    使用.Htaccess文件实现301重定向常用的七种方法
    Memcached和Memcache安装(64位win7)
    WDCP各种停止重启命令
    php面向对象之构造函数作用与方法
    Yii2.0 rules验证规则大全
    Yii2.0怎么设置时区?
    如何安装PHPstorm并配置php运行环境运行php项
    linux 装composer的出现的问题
  • 原文地址:https://www.cnblogs.com/sap-jerry/p/13568138.html
Copyright © 2011-2022 走看看