cancel
Showing results for 
Search instead for 
Did you mean: 

Running An Abap Transaction Through A n External Stand-Alone Java Program

Former Member
0 Kudos

Hi,

I have a requirement in which I need to run abap transactions (eg se38) from a standalone java program.I was able to connect to the SAP server through JCO with the following Code:


//Connecting to SAP
public static void main(String args[]){
		
   JCO.Client mConnection; 
  //A connection (or session) with SAP is  handled by class JCO.Client 
 
 try { 
     mConnection = 
      JCO.createClient("ABCD", // SAP client 
	 "xxxx", // userid 
	"xxxxxxx", // password 
	 "EN", // language 
	 "ip_Address", // host name 
	"SysNo"); // system number 
       
     mConnection.connect(); 
     System.out.println("Connection Successful");
  } 
  catch (Exception ex) { 
    System.out.println("Exception Occured::"+ex);
   } 
}

This code is running successfully in any SAP server and connection is also established. Now I want to run a particular SAP transaction (eg. se38) in that server.How can I call that transaction with all the required parameter (eg programme name for se38) ?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Through JCO, we have the api available where in you can execute a particular function module by providing the proper input parameters if required.

Here you cannot run any transactions or anything as such. But you can execute or invoke any BAPI/RFC and get the output parameters list in tablestructures.You can find the sample code on SDN.

Below is the reference for JCO.

[http://www.persistentsys.com/resource_center/white_papers/Java_SAP_Integration.pdf]

Regards,

KSK