zoukankan      html  css  js  c++  java
  • JCO事务管理

    /*
    * 标准对账单过账
    * @account 标准对账单号
    * @year 年度
    */
    public List<String> doAccountStatmentPost(String account,String year) throws JCoException{
    JCoDestination destination = JCOUtil.getDestination();
    JCoFunction function = destination.getRepository().getFunction("BAPI_INCOMINGINVOICE_POST");
    if (function == null) {
    throw new RuntimeException("BAPI_INCOMINGINVOICE_POST not found in SAP.");
    }
    //设置参数-对账单号
    function.getImportParameterList().setValue("INVOICEDOCNUMBER", account);
    //设置参数-年度
    function.getImportParameterList().setValue("FISCALYEAR", year);
    //<开始SESSION>
    JCoContext.begin(destination);
    //调用函数
    function.execute(destination);
    JCoTable jcoTable1 = function.getTableParameterList().getTable("RETURN");
    List<String> errorMessages = new ArrayList<String>();
    for (int i = 0; i < jcoTable1.getNumRows(); i++) {
    jcoTable1.setRow(i);
    errorMessages.add("TYPE:"+jcoTable1.getString("TYPE")+" MESSAGE:"+jcoTable1.getString("MESSAGE"));
    }
    if(jcoTable1.getNumRows()==0){
    JCoFunction function2 = destination.getRepository().getFunction("BAPI_TRANSACTION_COMMIT");
    function2.getImportParameterList().setValue("WAIT", "X");
    function2.execute(destination);
    }
    //<结束SESSION>
    JCoContext.end(destination);
    return errorMessages;
    }
    /*

  • 相关阅读:
    【转载自酷壳】编程能力与编程年龄
    xcode中的nslog数据格式
    xcode 的 pch 预编译头文件
    获取App的Documents路径
    使用gdb调试app
    收集的一些OC知识点
    收集到的几篇看雪学院文章
    【转】iOS平台的应用程序调试与分析
    前端技术开发的一些建议
    UIImage的两种加载方式
  • 原文地址:https://www.cnblogs.com/zfswff/p/5671150.html
Copyright © 2011-2022 走看看