on 10-21-2009 8:12 AM
Hi All,
I am basically sap consultant.
Now I have to work on java. Here i have to use rfc from sap in my java program.
I need the following help.
1) how to install the sap jco . step by step process , so that i can use rfc from sap . I just downloadded sap Jco from market place.
2) any sample program that uses sap rfc with jco connection.
So that i can build my own java program using sap jco.
Regards,
Kishan
Hi,
The below link will help you
http://help.sap.com/saphelp_nw04/Helpdata/EN/6f/1bd5c6a85b11d6b28500508b5d5211/content.htm
Regards
Suresh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Here is the sample code. Any questions are welcome
static JCO.Client mConnection;
static JCO.Repository mRepository;
public static JCO.Function createJCOFunction(String name) throws Exception
{
try
{
IFunctionTemplate ft = mRepository.getFunctionTemplate(name.toUpperCase());
if (ft == null)
return null;
return ft.getFunction();
}
catch (Exception ex)
{
throw new Exception("Problem retrieving JCO.Function object.");
}
}
public static String CallRFC() throws Exception
{
String ret = "";
String[] SAPInterfaces;
try
{
mConnection = JCO.createClient("100", "username", "password", "language", "serverip", "system");
mConnection.connect();
mRepository = new JCO.Repository("SU", mConnection);
}
catch (Exception ex)
{
ex.printStackTrace();
System.exit(1);
}
JCO.Function function = null;
JCO.Table it_wbs_element = null;
JCO.Table et_wbs_el_amounts = null;
JCO.ParameterList importParam = null;
try
{
function = createJCOFunction("ZPYO_GETACTBUDGET");
if (function == null)
{
System.out.println("ZPYO_GETACTBUDGET not found in SAP.");
System.exit(1);
}
importParam = function.getImportParameterList();
importParam.setValue(Currency, "I_WAERS");
it_wbs_element = function.getImportParameterList().getTable("IT_WBS_ELEMENT");
it_wbs_element.appendRow();
it_wbs_element.setValue(SUProjectCode, 0);
mConnection.execute(function);
mConnection.disconnect();
et_wbs_el_amounts = function.getExportParameterList().getTable("ET_WBS_EL_AMOUNTS");
for (int i = 0; i < et_wbs_el_amounts.getNumRows(); i++, et_wbs_el_amounts.nextRow()){
}
}
catch (Exception e)
{
ret = e.getLocalizedMessage();
throw e;
}
return ret;
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
These links might help you.
[Sun Java|http://developers.sun.com/docs/javacaps/designing/dotdappadptr.ggije.html]
[JCo|http://www.thespot4sap.com/Articles/SAP_Netweaver_Java_Connector.asp]
Thanks,
Venkat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.