Tips and tricks for the Java connector
2008-12-17 10:41
633 查看
if (window.name != "content")
document.write("
");
JCO.Field SalesDocumentField = jcoFunction.getImportParameterList().getField("SALESDOCUMENT");
SalesDocumentField.setValue("00006973");
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);
}
document.write("
Click here to show toolbars of the Web Online Help System: show toolbars |
Tips and tricks for the Java connector
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); // Retrieve the value of the field DOC_DATE 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 { // Get a function template from the repository IFunctionTemplate ftemplate = mRepository.getFunctionTemplate("BAPI_TRANSACTION_COMMIT"); // Create a function from the template jcoCommit = new JCO.Function(ftemplate); if ( jcoCommit == null ) // Do something..; } catch (Exception mException) { mException.printStackTrace(); } // Execute COMMIT 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);
}
相关文章推荐
- Tips and Tricks for the Visual Studio .NET IDE
- Tips and Tricks for the Visual Studio .NET IDE
- Tips and Tricks for the Visual Studio .NET IDE
- Website for the introduction to Matlab and Java
- Debugging Tips and Tricks for C++ in Visual Studio
- How to Code .NET: Tips and Tricks for Coding .NET 1.1 and .NET 2.0 Applications Effectively
- Contexts and Dependency Injection for the Java EE Platform(CDI,JSR-299)
- 学术研究的技巧Productivity tips, tricks and hacks for academics (2015 edition)
- Website for the introduction to Matlab and Java
- [论文摘要]Tips and Tricks for D3DX Effects-Based Renders
- The FreeBSD Foundation Announces Java JDK and JRE 1.5 Binaries for FreeBSD
- [Memo] Tips and Tricks for using C++ I/O.
- How to Code .NET: Tips and Tricks for Coding .NET 1.1 and .NET 2.0 Applications Effectively
- Website for the introduction to Matlab and Java
- Knoppix Hacks: Tips and Tools for Using the Linux Live CD to Hack, Repair, and Enjoy Your PC
- Google Hacks: Tips & Tools for Finding and Using the World's Information
- Oracle Internals: Tips, Tricks, and Techniques for DBAs
- Tutorial: The best tips & tricks for bash, explained | bash 入门| 极好的bash技艺
- SAP NetWeaver 7.0 - Java and ABAP Trial Version on Linux - VMware Edition - Tips & Tricks
- Development and remote installation of Java service for the Android Devices