私はSAP JCoで作業しています。そして、DATE '12を.16.2016' 設定しているときに例外を取得してcom.sap.conn.jco.ConversionException:(122)JCO_ERROR_CONVERSION:String to Dateフィールド
例外: com.sap.conn.jco.ConversionException:(122)JCO_ERROR_CONVERSION:'12 .16.2016' の値を変換できませんjava.lang.String型からフィールドDATEにSTRUCTUREに移動します。
私のコードは、JCO.Functionsのすべてのパラメータは文字列でなければなりません
public static void YP_ECA_VIN(String date, String plant) throws Exception {
try {
JCoDestination destination;
JCoRepository sapRepository;
destination = JCoDestinationManager.getDestination(DST1);
JCoDestinationManager.getDestination(DST1);
JCoContext.begin(destination);
sapRepository = destination.getRepository();
if (sapRepository == null) {
System.out.println("Couldn't get repository!");
JCoContext.end(destination);
System.exit(0);
}
JCoFunctionTemplate template = sapRepository.getFunctionTemplate("YP_ECA_VIN");
if (template == null) {
System.out.println("Couldn't get template for YP_ECA_VIN!");
} else {
JCoFunction function = template.getFunction();
function.getImportParameterList().setValue("DATE", "12.16.2016");
function.getImportParameterList().setValue("PLANT", plant);
function.execute(destination);
int numTRows = 0;
int numTCoulmns = 0;
JCoTable table = function.getExportParameterList().getTable("OUTPUT");
// some code
}
機能モジュールの署名も投稿します。 – vwegert