cancel
Showing results for 
Search instead for 
Did you mean: 

how to pass SAP logon information at run time

former_member205624
Contributor
0 Kudos

hi, all

Please help me out, Is it possible to pass SAP Logon information dynamically. Means for connecting R/3 to modal I have to pass information like:-

<b>single server</b>

host name----


system number-----

<b>user account</b>

client----


logon name----


password----


language----


can I pass these information at run time. so, that I can easily identified which user connect to the R/3 based on logon name and password .

Regards

Jitender kumar

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Jitender,

Use this code (taken from help.sap.com) which helps you to pass the SAP Logon information dynamically

while connecting to R/3.


import com.sap.mw.jco.*;

public class TutorialConnect1 extends Object {

   JCO.Client mConnection;

   public Connect1() {

     try {

       // Change the logon information to your own system/user

       mConnection =

          JCO.createClient("001", // SAP client

            "<userid>", // userid

            "****", // password

            null, // language

            "<hostname>", // application server host name

            "00"); // system number

       mConnection.connect();

       System.out.println(mConnection.getAttributes());

       mConnection.disconnect();

    }

    catch (Exception ex) {

      ex.printStackTrace();

      System.exit(1);

    }

  }

  public static void main (String args[]) {

    Connect1 app = new Connect1();

  }

}

Bala

former_member205624
Contributor
0 Kudos

thanks bala,

I will try this code.

Regards Jitender

Answers (0)