设为首页 加入收藏

TOP

SAP,JAVA环境下RFC调用示例(二)
2014-11-24 03:08:13 来源: 作者: 【 】 浏览:7
Tags:SAP JAVA 环境 RFC 调用 示例
r_deptbyperson_new");
//读取个人配置文档
Sysdoc = SysView.getDocumentByKey(agentContext.getEffectiveUserName().toUpperCase(),true);
depkey = Sysdoc.getItemValueString("ParentCompanyNumber")+"_"+Sysdoc.getItemValueString("TXTINDEPARTMENT");
comkey = Sysdoc.getItemValueString("ParentCompanyNumber");
// System.out.println(depkey+comkey);
//读取配置数据库
Configdb = session.getDatabase(CurDb.getServer(),DbPath,true);
//读取视图
ConView = Configdb.getView("v_or_saplink_byuser");
DepView = Configdb.getView("v_or_saplink_bydep");
ComView = Configdb.getView("v_or_saplink_bycom");

//读取配置文档
SapConfigDoc = ConView.getDocumentByKey(agentContext.getEffectiveUserName().toUpperCase(), true);
if (SapConfigDoc==null){
SapConfigDoc = DepView.getDocumentByKey(depkey, true);
if (SapConfigDoc==null){
SapConfigDoc = ComView.getDocumentByKey(comkey, true);
}
}

return SapConfigDoc;
}catch(Exception e) {
e.printStackTrace();
return null;
}
}


public void DelInfo(Database db,String pobh)
{
try
{

View view=db.getView("v_key_tx");
DocumentCollection dc =view.getAllDocumentsByKey(pobh, true);
if (dc.getCount()>0){
dc.removeAll(true);
}
}
catch(Exception e)
{
System.out.println(e.getMessage());
}
}

//用关键字返回文档
public Document ReturnTypeDoc(Database db,String Key,String vname) throws Exception{

Document DateDoc = null;
View SearchSubView = null;
Vector SearchKey = new Vector();

try{
SearchSubView = db.getView(vname);
SearchSubView.refresh();
SearchKey.addElement(Key);

DateDoc = SearchSubView.getDocumentByKey(SearchKey,true);

if (SearchSubView != null){
SearchSubView.recycle();
}
SearchKey = null;

if (DateDoc != null){
return DateDoc;
}else{
return null;
}



}catch(Exception e) {
e.printStackTrace();
return null;
}
}

public Document getDoucumet(Database CurDb, Vector SapSearchKey, Session session)throws Exception{

Database Configdb = null;
Document SapConfigDoc = null;
View ConView = null;
try{
String DbPath;
DbPath = CurDb.getFilePath();
DbPath = DbPath.substring(0,DbPath.length() - CurDb.getFileName().length());
DbPath = DbPath + configDbName;

//读取配置数据库
Configdb = session.getDatabase(CurDb.getServer(),DbPath,true);
//读取视图
ConView = Configdb.getView(viewName);
//读取配置文档
SapConfigDoc = ConView.getDocumentByKey(SapSearchKey, false);
return SapConfigDoc;
}catch(Exception e) {
e.printStackTrace();

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

评论

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

·C++ 语言社区-CSDN社 (2025-12-24 17:48:24)
·CSDN问答专区社区-CS (2025-12-24 17:48:22)
·C++中`a = b = c`与` (2025-12-24 17:48:19)
·C语言结构体怎么直接 (2025-12-24 17:19:44)
·为什么指针作为c语言 (2025-12-24 17:19:41)