使用 JCo 从 SAP 系统读取表

我正在尝试从 SAP 系统读取表,但总是收到此错误:


Exception in thread "main" com.sap.conn.jco.JCoRuntimeException: (127) 

JCO_ERROR_FIELD_NOT_FOUND: Field EMPLOYEE is not a member of INPUT

at com.sap.conn.jco.rt.AbstractMetaData.indexOf(AbstractMetaData.java:404)

at com.sap.conn.jco.rt.AbstractRecord.setValue(AbstractRecord.java:4074)

at testConf.StepServer.main(StepServer.java:50)

这是我的代码:


public static void main(String[] args) {


  // This will create a file called mySAPSystem.jcoDestination

  System.out.println("executing");

  String DESTINATION_NAME1 = "mySAPSystem";


  Properties connectProperties = new Properties();

  connectProperties.setProperty(DestinationDataProvider.JCO_ASHOST, "xxx.xxx.x.xxx");

  connectProperties.setProperty(DestinationDataProvider.JCO_SYSNR,  "xx");

  connectProperties.setProperty(DestinationDataProvider.JCO_CLIENT, "xxx");

  connectProperties.setProperty(DestinationDataProvider.JCO_USER,   "username");

  connectProperties.setProperty(DestinationDataProvider.JCO_PASSWD, "test");

  connectProperties.setProperty(DestinationDataProvider.JCO_LANG,   "en");

  createDestinationDataFile(DESTINATION_NAME1, connectProperties);


  // This will use that destination file to connect to SAP

  try {

      JCoDestination destination = JCoDestinationManager.getDestination("mySAPSystem");

      System.out.println("Attributes:");

      System.out.println(destination.getAttributes());

      System.out.println();

      destination.ping();

  } catch (JCoException e) {

      e.printStackTrace();

  }



当它说JCO_ERROR_FIELD_NOT_FOUND时错误很明显:字段 EMPLOYEE 不是 INPUT 的成员,但员工是我表中的一个字段。

http://img3.mukewang.com/613188d300011ce408260357.jpg

皈依舞
浏览 1081回答 2
2回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java