zoukankan      html  css  js  c++  java
  • CRM合同转SAP订单

    insert into ZVBAK(ZCRMID,ZOPERA,ZSYSTY,ZDATE1,ZTIME1,DOC_TYPE,BUKRS,SALES_ORG,DIVISION,SALES_OFF,SALES_GRP,PSPID,PURCH_NO_C,PURCH_DATE,REQ_DATE_H,
    PMNTTRMS,
    BILL_BLOCK,
    ZFLAG,
    CFLAG,
    MANDT,
    TYPE_GROUP,
    DISTR_CHAN
    
    )
    values(${entity.FId},1,2,TO_CHAR(now(),'YYYYMMDD'),TO_CHAR(now(),'HHMMSS'),'ZS01',
    (select FCompanyId from TsDepartment
    where FId=${entity.FSalesDepartmentId}),
    (select FVkOrg from TuSalesOppt where FId=${entity.FSalesOpptId}),
    (select FIndustry from TuSalesOppt where FId=${entity.FSalesOpptId}),
    (select FVkbur from TuSalesOppt where FId=${entity.FSalesOpptId}),
    (select FVkgrp from TuSalesOppt where FId=${entity.FSalesOpptId}),
    (select FName from TuSalesOppt where FId=${entity.FSalesOpptId}),
    (select FName from TuSalesOppt where FId=${entity.FSalesOpptId}),
    TO_CHAR(now(),'YYYYMMDD'),
    TO_CHAR(now(),'YYYYMMDD'),
    'D000',
    'Z1',
    0,
    0,
    810,
    1,
    '01'
    );
    
    
    insert into ZVBPA(ZCRMID,
    ZOPERA,
    ZSYSTY,
    ZDATE1,
    ZTIME1,
    MANDT,
    ZVBAK_CRMID,
    PARTN_ROLE,
    PARTN_NUMB,
    TEXT_LINE,
    TYPE_GROUP,
    ZFLAG,
    CFLAG
    )VALUES(uuid(),
    1,
    2,
    TO_CHAR(now(),'YYYYMMDD'),
    TO_CHAR(now(),'HHMMSS'),
    810,
    ${entity.FId},
    'AG',
    ${entity.FSAPCustomerNum},
    '',
    1,
    0,
    0
    
    );
    
    
    insert into ZVBPA(ZCRMID,
    ZOPERA,
    ZSYSTY,
    ZDATE1,
    ZTIME1,
    MANDT,
    ZVBAK_CRMID,
    PARTN_ROLE,
    PARTN_NUMB,
    TEXT_LINE,
    TYPE_GROUP,
    ZFLAG,
    CFLAG
    )VALUES(uuid(),
    1,
    2,
    TO_CHAR(now(),'YYYYMMDD'),
    TO_CHAR(now(),'HHMMSS'),
    810,
    ${entity.FId},
    'VE',
    (select FLoginName from TsUser where FId=${entity.FSignedUserId}),
    '',
    1,
    0,
    0
    );

     ZVBAP部分

    insert into ZVBAP(MANDT,ZCRMID,ZOPERA,ZSYSTY,ZDATE1,ZTIME1,
    ZVBAK_CRMID,
    TYPE_GROUP,
    REQ_QTY,
    MATERIAL,
    PLANT,
    TARGET_QTY,
    COND_TYPE,
    COND_VALUE,
    ZFLAG,
    CFLAG
    )
    values
    (100,
    uuid(),
    1,
    2,
    TO_CHAR(now(),'YYYYMMDD'),
    TO_CHAR(now(),'HHMMSS'),
    ${entity.FContractId},
    1,
    1,
    (
    select 
    case FAmountType
    when to_nchar('现场') then 'S000003'
    when to_nchar('柜台') then 'S000002'
    when to_nchar('设计费') then 
    (select 
      case FProperty
      when to_nchar('Design') then 'S000019'
      else 'S000001'
      end
      from TuSalesOppt where FId=(select FSalesOpptId from TcContract where FId=${entity.FContractId})
      
    )
    else 'S000004'
    
    end
    from TcContractDetail 
    where FId='734b6013-667e-4836-a3bb-87e31969b98e'),
    (
    select FCompanyId from TsDepartment  where FId=(select FSalesDepartmentId from TcContract where FId=${entity.FContractId})),
    1,
    'ZPR0',
    ${entity.FAmount},
    0,
    0
    
    )
    java新手自学群 626070845
    java/springboot/hadoop/JVM 群 4915800
    Hadoop/mongodb(搭建/开发/运维)Q群481975850
    GOLang Q1群:6848027
    GOLang Q2群:450509103
    GOLang Q3群:436173132
    GOLang Q4群:141984758
    GOLang Q5群:215535604
    C/C++/QT群 1414577
    单片机嵌入式/电子电路入门群群 306312845
    MUD/LIB/交流群 391486684
    Electron/koa/Nodejs/express 214737701
    大前端群vue/js/ts 165150391
    操作系统研发群:15375777
    汇编/辅助/破解新手群:755783453
    本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
  • 相关阅读:
    分布式事务:Saga模式
    使用 Go 语言徒手撸一个负载均衡器
    基于agenda的Nodejs定时任务管理框架搭建
    在Node.js中使用ejsexcel输出EXCEL文件
    [译]Node.js框架对比:Express/Koa/Hapi
    基于RSA的WEB前端密码加密方案
    CSS3实现0.5px边框
    前端JS面试题汇总 Part 3 (宿主对象与原生对象/函数调用方式/call与apply/bind/document.write)
    前端JS面试题汇总 Part 2 (null与undefined/闭包/foreach与map/匿名函数/代码组织)
    前端JS面试题汇总 Part 1(事件委托/this关键字/原型链/AMD与CommonJS/自执行函数)
  • 原文地址:https://www.cnblogs.com/cfas/p/3106441.html
Copyright © 2011-2022 走看看