Tips and tricks for the Java connector

if (window.name != "content") document.write("

Click here to show toolbars of the Web Online Help System: show toolbars

"); <!-- !chm2web! -->

Tips and tricks for the Java connector

How to set and import parameter - Field
How to handle an import parameter - Table
How to handle an import parameter - Structure
How to handle an export parameter - Table
How to handle BAPI return table
Using COMMIT

How to set and import parameter - Field

Give the import parameter SALESDOCUMENT the value "00006973":

JCO.Field SalesDocumentField = jcoFunction.getImportParameterList().getField("SALESDOCUMENT");
SalesDocumentField.setValue("00006973");

How to handle an import parameter - Table

JCO.Table ORDER_PARTNERS = jcoFunction.getTableParameterList().getTable("ORDER_PARTNERS");
ORDER_PARTNERS.appendRow();
ORDER_PARTNERS.setValue("AG","PARTN_ROLE");
ORDER_PARTNERS.setValue("0000001032","PARTN_NUMB");

How to handle an import parameter - Structure

JCO.Structure order_header_inx = jcoFunction.getImportParameterList().getStructure("ORDER_HEADER_INX");
order_header_inx.setValue("I","UPDATEFLAG");
order_header_inx.setValue("X","DOC_TYPE");

How to handle an export parameter - Table

JCO.Table myTable = jcoFunction.getTableParameterList().getTable("STATUSINFO");

for (int i=0; i < myTable.getNumRows(); i++)
  myTable.setRow(i);

  oDocDate = myTable.getField("DOC_DATE").getValue();

How to handle BAPI return table

Meesage type and message is stored in vector bapiReturn.
Vector bapiReturn;
JCO.Table jcoReturn = jcoFunction.getTableParameterList().getTable("RETURN");
    for (int i = 0; i < jcoReturn.getNumRows(); i++)
    { jcoReturn.setRow(i);
      String Message = jcoReturn.getField("TYPE").getValue() + " " +
                       jcoReturn.getField("MESSAGE").getValue();

      bapiReturn.setSize(i + 1);
      bapiReturn.setElementAt(new String(Message),i );
    }

Using COMMIT

    try
     { 
       IFunctionTemplate ftemplate = mRepository.getFunctionTemplate("BAPI_TRANSACTION_COMMIT");

       
       jcoCommit = new JCO.Function(ftemplate);

       if ( jcoCommit == null )

     }
    catch (Exception mException)
     {  mException.printStackTrace(); }


    try
     { sapConnection1.mConnection.execute(jcoCommit);
     }
    catch (Exception mException)
     { mException.printStackTrace(); }
var fe = FindFrame("toc", top); if ((fe != null) && (chmtop.c2wtopf.jstree != null)) { if (chmtop.c2wtopf.FITEMS[chmtop.c2wtopf.pagenum] != chmtop.c2wtopf.pageid) chmtop.c2wtopf.jstree.OpenTreeNode("" + chmtop.c2wtopf.pageid); } <!-- CHM2WEB --><!-- DO NOT DELETE OR MODIFY THIS CODE WITHOUT WRITTEN PERMISSION OF A!K RESEARCH LABS -->
<!-- /CHM2WEB -->
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值