- 1、本文档共11页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
2.3.3 - 通过java语言进行bapi调用(2.3.3 - Bapi calls through the Java language)
2.3.3 - 通过java语言进行bapi调用(2.3.3 - Bapi calls through the Java language)
/ / 载入所需的类库:
import com.sap.rfc. *;
import com.sap.rfc.exception. *;
import com.ibm.sap.bapi. *;
import com.ibm.sap.bapi.generated. *;
/ / 连接sap系统
private static irfcconnection establishconnection (middlewareinfo amiddlewareinfo)
throws jrfcremoteexception
{
irfcconnection aconnection = null;
connectinfo aconnectinfo = null;
userinfo auserinfo = null;
amiddlewareinfo.getorbservername orbservername = (string);
boolean badjusted = true;
if (! badjusted)
{
throw (new jrfcrfcconnectionexception (
please adjust the connection parameters to your needs -! )) ;
}
/ / 连接信息: 调整为所需要输入的值
aconnectinfo connectinfo (= new
3, / / int rfc模式 3 or 2 / 3 = r = r / 2
null, / / string rfc目标
9.7.12.7 / / string 主机名 (ip地址)
0, / / int 系统编号
null, / / string 网关主机
null, / / string 网关服务
null, / / string 系统名
null, / / string 服务器组名
null, / / string 消息服务器
负载平衡选项 boolean false, / /
true); / / boolean 权限检查选项
/ / 用户信息
auserinfo userinfo (= new
muster, / / string 用户名
ides / / string 密码
800, / / string 集团
the e / / string 登录语言
代码页 int); / / 1103
/ / technical conversion for the selected middleware;
/ / 打开连接open connection:
irfcconnectionfactory aconnectionfactory =
factorymanager.getsingleinstance.getrfcconnectionfactory () ();
aconnection = aconnectionfactory.createrfcconnection (aconnectinfo, auserinfo);
aconnection.open ();
/ / 返回连接
aconnection return;
}
/ / 调用main方法
public static void main (java.lang.string args [])
/ / 通过所指定的中间件设定连接选项
{
middlewareinfo amiddlewareinfo = new middlewareinfo (args);
factorymanager afactorymanager = factorymanager.getsingleinstance ();
afactorymanager.setmiddlewareinfo (amiddlewareinfo);
/ / 初始化连接连接对象
irfcconnection aconnection = null;
try
{
aconnection = establishconnection (amiddlewareinfo);
}
catch (exception ex)
{
system.out.println (error: could not create connection: + ex);
system.exit (- 1);
}
system.out.println (connection established.);
/ / - - - 测试代码段开始 ------------------------------------
您可能关注的文档
- (txt版本的)2010-2011学年第一学期形势与政策课免费答案((txt version) free answer for the first semester of the 2010-2011 academic year).doc
- (pmu专稿)援外工程项目施工监理((PMU) construction supervision of foreign aid project).doc
- (广州)检测技术有限公司-岛津_2011830324120051((Guangzhou) Testing Technology Co., Ltd. - SHIMADZU _2011830324120051).doc
- (必读)图片简介((required) picture introduction).doc
- (二)以顾客满意为目标,完善服务质量的管理((two) with customer satisfaction as the goal, improve the quality of service management).doc
- (新版)轮胎翻新技术制造工艺专利大全全文文集((New Edition) tire retreading technology, manufacturing technology patent, Daquan, full text).doc
- (扩词)识字1—课文26((expansion) literacy 1 - text 26).doc
- (二)、人物故事((two) character stories).doc
- (世袭金银财富金银争霸)如何做一名成功的黄金操盘手((hereditary gold and silver wealth, gold and silver contend for hegemony) how to be a successful gold trader).doc
- (精)麦肯锡提案标准流程((standard) McKinsey proposal standard process).doc
- 12条守则 让你成功创业当老板(The 12 rule allows you to succeed in business and be a boss).doc
- 12条守则让你成功当老板(The 12 rule will make you a successful boss).doc
- 2.4g干扰(2.4G interference).doc
- 2002年国家司法考试大纲—刑法(Outline of the national judicial examination in 2002 - Criminal Law).doc
- 1个人礼仪必须以个人修养为基础(1 personal etiquette must be based on personal accomplishment).doc
- 2003学年第二学期四年级语文期末试卷(2003 academic year, second term, grade four, final examination paper).doc
- 2003年北大考古通论考研(2003 North general theory of archaeology graduate).doc
- 2004学年第二学期五年级数学升级考试模拟试卷(2004 academic year second semester five grade mathematics promotion test simulation test paper).doc
- 2004—2005学年周秦汉唐文明史考题标准答案及评分标准(Standard answers and scoring criteria for Zhou Qinhan's history of civilization in 2004 - 2005 academic year).doc
- 2.3.4精简列表(2.3.4 streamline list).doc
文档评论(0)