Get local server name at runtime

Hi all,
I am looking for a function module or a system parameter that can give me the current server name that my ABAP program runs on.
I need to export the returned server name to parameter
TARGETSERVER of function module 'JOB_CLOSE'.
Thanks for your time,
Eyal.
Message was edited by: Eyal Alsheikh
Message was edited by: Eyal Alsheikh

Hi Eyal
You can make use of following FMs
1. <b>"FIND_DB_APPLICATION_SERVER"</b> gives the server name via the export parameter <b>"SERVERNAME"</b> .
2. <b>"TH_GET_ACTIVE_SERVER"</b> gives the server name via the export parameter <b>"SERVER"</b> .
3. <b>"RFC_GET_LOCAL_SERVERS"</b> will give a list containing some info about servers, then you can use the FM <b>"TH_USER_INFO"</b> to get user's host address from the exporting parameter <b>"HOSTADDR"</b>. Then you can look-up the list you retrieved by the first FM where the first four characters at the field <b>"HOSTADR"</b> is the same with the user's. The server name is contained at the field <b>"NAME"</b> of the same row.
<i>As another thing, let me introduce you SDN forums pointing system: If you find a post helpful about solving your question, you can assign points to the post. You can do this by clicking the yellow star icon at the header of each post. You can assign;
- one 10 points (solved)
- two 6 points (very helpful answer)
- many 2 points (helpful answer)</i>
Kind regards...
*--Serdar

Similar Messages

  • How to get managed server name  in Weblogic10.2 ?

    Hi
    I want to get managed server name from a cluster in a servlet or util project class whom that one is called by ?
    Do I have to implement any interface or I have to extends a class ? Please help me to resolved.
    Thanks

    Here is a snippet of code that I use in WL10 MP1 that works fine:
    import javax.management.MBeanServer;
    import javax.management.ObjectName;
    import javax.naming.InitialContext;
    String managedServerName = null;
    InitialContext ctx = null;
    try {
    //fetch managed server name by accessing the
    //RuntimeServerMBean using the
    //MBeanServer interface
    ctx = new InitialContext();
    MBeanServer server = (MBeanServer) ctx.lookup("java:comp/env/jmx/runtime");
    ObjectName service = new ObjectName("com.bea:Name=RuntimeService,Type=weblogic.management.mbeanservers.runtime.RuntimeServiceMBean");
    managedServerName = (String) server.getAttribute(service, "ServerName");
    } catch (Exception ex) {
    //error occurred
    } finally {
    if (ctx != null) {
    try {
    ctx.close();
    } catch (Exception dontCare) {

  • How to get the Server Name in Crystal

    Hi All,
    We created a Crystal Report that pulls images from a File Location at the run time and this File Location is different for each environment (D-Q-P). We are trying to automate the file location by the server name. Is there any function in Crystal Reports that we can get the server name so we know if it is D-Q or P system?
    Thank you,

    Hi,
    There is no function in CR that can fetch the Server Name. That is something you need to provide to the formula.
    If you're loading images from a location on the Server, you can always use a Relative Path. For eg: if the images would be stored in a folder called Images, then you can write a formula on the 'Graphic Location' for the OLE object as:
    "/Images/Crystal.jpg"
    This will load the image from the folder when it is run on D, Q or P.
    Hope this helps!
    -Abhilash

  • How to get a server name through the load balancer

    Hi.
    I'd like to get the server name where is my application installed. There are some servers and clients access there throuth the load balancer. When I try to get it with request.getServerName(), I get the virtual address of the load balancer.
    Any suggestions?
    Thanks.

    Dear Sikindar;
    THanks for your cooperation, but I believe that these Tcodes will eb helpful if I know the table name, actually we don't know its name and that's what I'm asking about, how can I get the table name for the ABAPer?
    Appreciating your cooperation.
    Best Regards;
    Lobna

  • How to get the server name/hostname on which JVM is running?

    How to get the server name/hostname on which JVM is running from the Servlet or normal class?

    InetAddress.getLocalHost()

  • Getting weblogic server name

              Is there a way to get the name of the WebLogic server programmatically?
              I need to create a JSP or servlet that will display the name of the server it
              is running on.
              I am trying to create a JSP/servlet that will be deployed into a cluster. Somehow,
              each process running needs a way to determine which server they are currently
              running on. Using the server name was my first thought.
              Any thoughts?
              -Fred
              

    There are a set of Runtime mbeans that will give you this data.
              http://edocs.bea.com/wls/docs81/javadocs/weblogic/management/runtime/package-summary.html
              and
              http://edocs.bea.com/wls/docs81/jmx/
              Cheers
              mbg
              "Fred Head" <[email protected]> wrote in message
              news:3ee4c1ad$[email protected]..
              >
              > Is there a way to get the name of the WebLogic server programmatically?
              >
              > I need to create a JSP or servlet that will display the name of the server
              it
              > is running on.
              > I am trying to create a JSP/servlet that will be deployed into a cluster.
              Somehow,
              > each process running needs a way to determine which server they are
              currently
              > running on. Using the server name was my first thought.
              >
              > Any thoughts?
              >
              > -Fred
              

  • How to get the Server name only?

    Hello,
    I would like to get this part of server's URL: "http://<host_name>"
    I am familiar with the Object WDURLGenerator but I don't see a method to do that, all the methods require manipulating the received String. Is there a method to get only the part I've mentioned?
    Roy

    Hi,
    String sysname = System.getProperty("SAPSYSTEMNAME");
    String hostname = System.getProperty("j2ee.dbhost");
    will give the server name..then u can say http://<hostname>...

  • Get Application Server Name and Version

    Hello All,
    Is it possible to get the Application Server Name and Version using Java?
    To simplify my question, if I am running Weblogic, the jsp page should tell me that I am running Weblogic Version <number> or IBM WebSphere Version <number>.
    Thanks

    I get an error when I put this line in my jsp page:
    out.println(" Server Info: " +getServletContext().getServerInfo());
    Is there something I am missing?
    symbol : method getServletContext ()
    location: class jsp_servlet._jsp._mu.__showmxversion
    out.println(" Server Info: " +getServletContext().getServerInfo()); //[ /jsp/mu/showMXVersion.jsp; Line: 16]

  • Get License Server name via SDK

    Hi,
       Is there a way that an addon can get to the SAP License Server name using the DI or UI API? there is a specific requirement in one of our addons to rech out to the SAP License server.
    I can always ask the user to enter it in as a part of the addon setup but I was wondering if there was an automated way of doing this.
    Gopal

    Hi Gopal,
    You can go to the SLIC table in SBO-COMMON and see the licence-server name and (for SBO 2005) the port
    I think you should make a query for it.
    Regards,
    Ad

  • Getting cep server name

    Hi,
    I am working on a CEP Cluster. Is there a way to get the cep server name of current node in java code?

    You could probably use ConfigurationPropertyPlaceholderConfigurer to inject the setting from config into your java code.

  • How to get the infoobject name in runtime?

    Hi,
    I have a variable which is used by several queries. I can get the query name at run time through using the SAP memory (IMPORT compid = lv_compid FROM MEMORY ID 'COMPID'.).
    Now I want to get the Infoobject name in run time, is that possible through the same way?When yes, what is the memory ID?
    When no, how can I get it in RUN Time?
    best regards

    Hi,
    no, I m not using customer exit. I m using master data read class.
    When the user klick  the search help of the variable by the beginning of the query, the masterdata class will be called. I want to get the infoobject name of the variable in this class in run time 
    thanks
    best regards

  • How to get report Server Name and Environment ID in Report

    How to print report Server Name and Environment ID in Report 10G.(Through in package or others)
    I'm also using Oracle Application Server 10G.

    Hi,
    Server and envid are the parameters passed along with Reports URL call.
    These variables value can be traped in Report by defining SERVER , ENVID named user parameters.
    Once trapped, can be printed on Report.
    Just ensure that these users parameters are not exposed to Parameter page, otherwise user may end up changing it.
    Thanks

  • Getting OAS server name in oracle reports

    Hi Experts,
    I need to get the OAS name in the After parameter form trigger. Is there any built-in funtion that will return the Current OAS name? Please help me. Thanks in advance.
    Regards,
    J.P

    Hello,
    When using the Reports Servlet some "extra" parameters are passed :
    http://download.oracle.com/docs/cd/B14099_17/bi.1012/b14048/pbr_run.htm#i1009092
    If you want to read these paramaters values , you need to "declare" these parameters in your Reports
    Regards

  • Getting LDAP server name?

    How can I find the LDAP server name and port?
    I presume that the first 2 values are LDAP server name and port?
    InitialDirContext ctx = ConnectionUtil.getDefaultDirCtx("host", "port", "orcladmin", "pwd");
    Please help.
    Thanks

    Logon to Portal schema and run the below query:
    select wwsec_oid.get_oid_host "LDAP Host",wwsec_oid.get_oid_port "LDAP Port" from dual;

  • External programs get error 1006 using local server name

    I have a brand new Solution Manager EHP1 installation on Windows 2003sp2/SQL.
    The installation succeeded ok, but I cannot configure STMS.
    The reason appears to be that external commands (i.e. tp) are not working correctly.
    If I execute in SM49 the external command 'ENV' and use the default host, it fails with error 1006
    If I specify the target host and use the 'short' name of the host, e.g. SAPSMT it fails with the same error
    If I specify the target host and use the fqdn of the host e.g. SAPSMT.saproot.local it works ok.
    If I specify the target host as 'localhost' it also works ok.
    The 'HOSTNAME' command responds with SAPSMT
    There is only a single NIC, so its not anything to do with multiple NICs.
    I'm running the latest kernel and sapxpg now and it still acts the same.
    Type 3 RFC destinations to SAPSMT work ok.
    I can't really get anything else to fail: just external commands with the short name (or default) as the target.
    Has anyone seen this before and have a solution or workaround?
    I am almost sure it will be a windows configuration problem, but I can't see what it could be.
    Thanks, Andy.

    Hi Pradi,
    there are no entries in the HOSTS file related to this.
    I do think this is the right area: here is the output of niping, which is suggesting that the address lookup of the ip address goes to the fully qualified domain name rather than the hostname.
    E:\usr\sap\SMT\DVEBMGS00\exe>niping -v -H SAPSMT
    Hostname/Nodeaddr verification:
    ===============================
    Hostname of local computer: SAPSMT                        (NiMyHostName)
    Lookup of hostname: SAPSMT                                (NiHostToAddr)
        --> IP-Addr.: 10.115.227.36
    Lookup of IP-Addr.: 10.115.227.36                         (NiAddrToHost)
        --> Hostname: SAPSMT.saproot.local
    Lookup of hostname: SAPSMT                                (NiHostToAddr)
        --> IP-Addr.: 10.115.227.36
    Lookup of IP-Addr.: 10.115.227.36                         (NiAddrToHost)
        --> Hostname: SAPSMT.saproot.local
    If I add the hostname SAPSMT to the hosts file (together with the alias as you suggested), it then gives:
    E:\usr\sap\SMT\DVEBMGS00\exe>niping -v -H SAPSMT
    Hostname/Nodeaddr verification:
    ===============================
    Hostname of local computer: SAPSMT                        (NiMyHostName)
    Lookup of hostname: SAPSMT                                (NiHostToAddr)
        --> IP-Addr.: 10.115.227.36
    Lookup of IP-Addr.: 10.115.227.36                         (NiAddrToHost)
        --> Hostname: SAPSMT
    Lookup of hostname: SAPSMT                                (NiHostToAddr)
        --> IP-Addr.: 10.115.227.36
    Lookup of IP-Addr.: 10.115.227.36                         (NiAddrToHost)
        --> Hostname: SAPSMT
    However, having made this change and restarted, I still get the problem.
    Thanks for the help, by the way.
    Andy

Maybe you are looking for