2005 Jun 09 12:36 PM
Hi Guys,
I am calling a bapi from a java application using Jco. I have one doubt like do we need to maintain TCP/IP connection from SAP to that java application.
Because in jco coding itself we can give the login details of sap.
Thanks in advance.
Rgds,
Ram Sri
2005 Jun 09 5:12 PM
I don't think you need to do anything extra but yes java application should be able to access SAP system ( within the network ).
TCP/IP is a protocal and also a base for other protocals like RFC. You are already providing the RFC Connection details.
Cheers,
Ram
Hi Guys,
I am calling a bapi from a java application using Jco. I have one doubt like do we need to maintain TCP/IP connection from SAP to that java application.
Because in jco coding itself we can give the login details of sap.
Thanks in advance.
Rgds,
Ram Sri
2005 Jun 09 12:42 PM
2005 Jun 09 5:12 PM
I don't think you need to do anything extra but yes java application should be able to access SAP system ( within the network ).
TCP/IP is a protocal and also a base for other protocals like RFC. You are already providing the RFC Connection details.
Cheers,
Ram
2005 Jun 10 6:54 AM
Hi Ram,
If i am calling a Bapi from java application, i am giving sap logon details in jco programming like clinet, user id, password, hostname and system number.
But i am not maintaining any TCP/IP connection from SAP side? Then still it works???
Secondly how to handle the errors from both java application side and sap side if any error occurs?
Thanks in advancd.
Rgds,
Ram Sri
2005 Jun 10 7:48 PM
The way I think the connection is opened from your program. I am sure you must have created a connection and passing the login details from your program.
But I think you should search "JCO Connection" on sdn search to find more.
BAPI's will return you messages through it's BAPIRETURN parameter that you need to capture in your application.
Use the commit BAPI if it's successful ( No error messages in BAPIRETURN ).
Sorry I don't know much about JCO.
Cheers,
Ram
2005 Jun 10 9:11 PM
Ram,
If your Java application is always going to be the client, then you don't need to do anything on the SAP side. The logon parameters which you give in JCO is good enough. The connection is as good as you logging on to SAP using the GUI, except for the fact that there is no GUI in JCO.
Since you Java application is the client, it makes sense to handle all errors and logging in your application. Since you are using BAPI, your communication is syncronous and hence based on return parameter from the BAPI you can handle errors and write suitable logs.
TCP/IP connection in SM59 is required only if SAP is going to be the client and java application the server. That is, if your java application is to be made visible in SAP.
Hope this helps.
Thanks
KK
2005 Jun 11 2:06 PM
HI ,
To use JCo to connect to SAP,
U don't have to do do anything on SAP side.
In NetWeaver devloper studio , create a java project.
In that, create new->other>sap_connectivity --sap enterprise connector
Give package name and a name for class
then on next screen , under tab single server give
host name
system number
client
logon name
password
language
This will lead to a screen where u can select the BAPI or function module which u want to use.
After selecting it will create the classes and methods required for Input , Port and Output .
In your program also you have to establish connection using Port Class , pass Input to the method and then get the OutPut.
Hence you don't have to do anytjing on the SDAP side as u are in a way logging on to SAP giving all the details like system , userid ,password
Regards,
Siddhartha
2005 Jun 14 10:02 AM
Hi Folks,
While giving sap logon parameters whatkind of user id should i give., i.e dialog, communication or service user id? Can somebody help me?
Rgds,
Ramgopal
2005 Jun 15 2:32 AM
Ram-
Use a Service user. Just make sure that RFC authorizations are available for this user. SAP provides standard profiles for RFC authorizations.
KK
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |