设为首页 加入收藏

TOP

SAP,JAVA环境下RFC调用示例(四)
2014-11-24 03:08:13 来源: 作者: 【 】 浏览:11
Tags:SAP JAVA 环境 RFC 调用 示例
AP的日志end
//---------------------------------------------------------------------

}catch(Exception e){
System.out.println(e.getMessage());
}
}



public void NotesMain() {
System.out.println("修改物料主数据(BOM创建录入产品规格)");
Session session = null;
AgentContext agentContext = null;
IRepository repository=null;
Document doc = null;
Document tempdoc = null;
Document tempdoc1 = null;
Document tempdochxm = null;
JCO.Client client = null;
PrintWriter pw;
String clientnew ="";



String mp="";
String mr="";
mp = "<script>";
mp = mp + "var m='';";


try {
session = getSession();
agentContext = session.getAgentContext();


doc = agentContext.getDocumentContext();

Database db = agentContext.getCurrentDatabase();
Database CurDb = agentContext.getCurrentDatabase();
Document CurDoc = agentContext.getDocumentContext();

Vector SapKey = new Vector();
Vector dd = new Vector();
SapKey.addElement("dev");


String writetime = null;

DateTime dt1 = session.createDateTime("Today");
dt1.setNow();
writetime = dt1.getLocalTime();
Document ConfigDoc = getDoucumet(agentContext.getCurrentDatabase(),SapKey,session);
//Document ConfigDoc = getDoucumet1(db,session,agentContext);
if (ConfigDoc == null){
System.out.println("SAP连接配置文档不存在!");
}else{
clientnew = ConfigDoc.getItemValueString("Client");
this.SAP_Client = ConfigDoc.getItemValueString("Client");
this.user_Id = ConfigDoc.getItemValueString("User");
this.password = ConfigDoc.getItemValueString("Password");
this.language = ConfigDoc.getItemValueString("Language");
this.sysnr = ConfigDoc.getItemValueString("SYSTEM");
this.host_Name = ConfigDoc.getItemValueString("HostName");
//System.out.println("SAP主机:" + this.host_Name);
//System.out.println("用户:" + this.user_Id);
//System.out.println("密码:" + this.password);
/////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////////////////




DateTime dt = session.createDateTime("Today");
dt.setNow();
//System.out.println("开始连接" + dt);


client = JCO.createClient(this.SAP_Client, // SAP client
this.user_Id, // userid
this.password, // password
this.language, // language
this.host_Name, // host name
this.sysnr); // system number

// Open the connection
client.connect();
dt.setNow();
//System.out.println("连接成功" + dt);
repository = JCO.createRepository("MYRepository", client);


IFunctionTemplate ftemplate;


首页 上一页 1 2 3 4 下一页 尾页 4/4/4
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇Spring+Quartz实现定时任务的配置.. 下一篇Linux QT开发随笔

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·哈希表 - 菜鸟教程 (2025-12-24 20:18:55)
·MySQL存储引擎InnoDB (2025-12-24 20:18:53)
·索引堆及其优化 - 菜 (2025-12-24 20:18:50)
·Shell 中各种括号的 (2025-12-24 19:50:39)
·Shell 变量 - 菜鸟教 (2025-12-24 19:50:37)