Github Copilot
编程相关应用,建议使用GPT-4模型以提升编程能力。自定义一个应用,模型选择GPT-4,然后从训练里复制提示词到新应用里。



import com.sap.conn.jco.*;
public class SapConnector {
public static void main(String[] args) {
try {
JCoDestination destination = JCoDestinationManager.getDestination("mySAPSystem");
JCoFunction function = destination.getRepository().getFunction("BAPI_COMPANY_GETLIST");
if(function != null) {
function.getImportParameterList().setValue("COMPANYNAME", "myCompany");
function.execute(destination);
JCoStructure returnStructure = function.getExportParameterList().getStructure("RETURN");
String type = returnStructure.getString("TYPE");
if ((type == null) || (type.isEmpty()) || (type.equals("S")) || (type.equals("W"))) {
// Success
} else {
// Error handling
}
}
} catch (JCoException e) {
e.printStackTrace();
}
}
}