Getting portal hostname and displaying on the portal masthead.

Dear SCN
I have some requirement, where in my portal masthead I need to display some string based on the portal hosname.
eg, if my hostname is portaldev.abc.com then in my masthead I need to display a string portal development system.
I  am new to the portal development, can somebody pls suggest me in getting the portal hostname and pls give me some code snippet on this. appreciate your help , many thanks.
Thanks
RAD

The following portal component could be used to replace your masthead iView . Basically it makes a small table which has the normal masthead plus a bit of code that works out which host you're on and puts out a message,
Make an iView from it and add it to your framework page in place of the regular masthead and you'll then get the appropriate information.
public class WhoAmI extends AbstractPortalComponent
    public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
          IPortalComponentProfile profile = request.getComponentContext().getProfile();
          StringTokenizer st = new StringTokenizer(System.getProperty("SAPMYNAME"),"_");
          String message1 = "You are on the ";
          String host = "development";
          for (int i=0;st.hasMoreElements();i++) {
               String s = st.nextElement().toString();
               if (i==0) {
                    if (s.equals("abcdef")) host = "production";
          String message2 = " server";
          response.write("<div id=\"WhoAmIArea\"><table width=\"100%\"><tr>");
          response.write("<td align=\"left\" width=\"90%\"><iframe width=\"100%\" height=\"38\" src=\"/irj/servlet/prt/portal/prtroot/com.sap.portal.navigation.masthead.default\"></iframe></td>");
          response.write("<td  align=\"right\" width=\"10%\">");
          response.write("<span class=\"urTxtStd\">"+message1+host+message2+"</span>");
          response.write("</td></tr></table></div>");

Similar Messages

  • Problem in Retrieve Image from DB and display in the JSP page

    Hi All,
    I did one JSP Program for retriveing image from DB and display in the JSP Page. But when i run this i m getting "String Value" output. Here i have given my Program and the output. Please any one help to this issue.
    Database Used : MS Access
    DSN Name : image
    Table Name: image
    Image Format: bmp
    Output : 1973956
    Sample Program:_
    <%@ page contentType="text/html;charset=windows-1252"%>
    <%@ page import="java.io.*" %>
    <%
         try{
              Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              Connection conn = DriverManager.getConnection("jdbc:odbc:image");
              Statement st = conn.createStatement();
              ResultSet rs = st.executeQuery("SELECT images FROM image");
              String imgLen="";
              if(rs.next()){
                   imgLen = rs.getString(1);
                   out.println(imgLen.length());
              if(rs.next()){
                   int len = imgLen.length();
                   byte [] rb = new byte[len];
                   InputStream readImg = rs.getBinaryStream(1);
                   int index=readImg.read(rb, 0, len);
                   System.out.println("index"+index);
                   st.close();
                   response.reset();
                   response.setContentType("image/jpg");
                   response.getOutputStream().write(rb,0,len);
                   response.getOutputStream().flush();
         }catch(Exception ee){
              out.println(ee);
    %>
    Thanks,
    Senthilkumar S

    vishruta wrote:
    <%
    %>Using scriptlets is asking for trouble. Java code belongs in Java classes. Use a Servlet.
                   out.println(imgLen.length());Your JSP was supposed to write an image to the output and you wrote some irrelevant strings to the output before? This will corrupt the image. It's like opening the image in a text editor and adding some characters before to it.
                   byte [] rb = new byte[len];Memory hogging. Don't do that.
              out.println(ee);You should be throwing exceptions and at least printing its trace, not sending its toString() to the output.
    You may find this article useful to get an idea how this kind of stuff ought to work: [http://balusc.blogspot.com/2007/04/imageservlet.html].

  • How to get customer number and name from the SD document

    Hi All,
    Can you please let me know how to get Customer Number and Name from the SD Document?
    Thanks a lot....
    Anil

    Hi,
    It will be displayed in the SD (BIlling document) itself,  you clikc on the VF03. The customer name and number will also appear in the SO document also Tcode VA03
    regards,
    radhika
    Edited by: kolipara radhika on Jul 10, 2009 5:32 AM

  • Is there a way to open Excell file from the server and display in the UI and save it back on to the

    Hello there,
    Is there a way to open Excell file from the server and display in the UI and save it back on to the server? (like showing xell file as a datagrid - add rows, columns etc.)

    Hi Mike,
    Welcome you to the forum.
    You may try:
    SELECT * FROM MyDBNameHere.dbo.OUSR T0
    Thanks,
    Gordon

  • My performance is very slow when I run graphs. How do I increase the speed at which I can do other things while the data is being updated and displayed on the graphs?

    I am doing an an aquisition and displaying the data on graphs. When I run the program it is slow. I think because I have the number of scans to read associated with my scan rate. It takes the number of seconds I want to display on the chart times the scan rate and feeds that into the number of samples to read at a time from the AI read. The problem is that it stalls until the data points are aquired and displayed so I cannot click or change values on the front panel until the updates occur on the graph. What can I do to be able to help this?

    On Fri, 15 Aug 2003 11:55:03 -0500 (CDT), HAL wrote:
    >My performance is very slow when I run graphs. How do I increase the
    >speed at which I can do other things while the data is being updated
    >and displayed on the graphs?
    >
    >I am doing an an aquisition and displaying the data on graphs. When I
    >run the program it is slow. I think because I have the number of
    >scans to read associated with my scan rate. It takes the number of
    >seconds I want to display on the chart times the scan rate and feeds
    >that into the number of samples to read at a time from the AI read.
    >The problem is that it stalls until the data points are aquired and
    >displayed so I cannot click or change values on the front panel until
    >the updates occur on the graph. What can I do to be a
    ble to help
    >this?
    It may also be your graphics card. LabVIEW can max the CPU and you
    screen may not be refreshing very fast.
    --Ray
    "There are very few problems that cannot be solved by
    orders ending with 'or die.' " -Alistair J.R Young

  • Problem in the code while fetching records and displaying in the screen

    Hi,
       I have developed a screen which is having various fields, all the records are stored in a ztable,when i enter the records into various i/o fields and press submit pushbutton they are stored in the table now, what i wont is when i enter one record the (primary one) and press enter the corresponding records of that record should be shown in the i/o fields means they should be fetched back from the d/b table and displayed on the screen. For this i Have written a code please see it once.
    TABLES : ZFISALDT.
    DATA ITAB LIKE ZFISALDT OCCURS 0 WITH HEADER LINE.
    ZFISALDT-BILLINGDOCU = ITAB-BILLINGDOCU.
    ZFISALDT-SALESDOCU = ITAB-SALESDOCU.
    ZFISALDT-FORM402 = ITAB-FORM402.
    ZFISALDT-SALESTAXFORM = ITAB-SALESTAXFORM.
    ZFISALDT-FREIGHTDOCNO = ITAB-FREIGHTDOCNO.
    ZFISALDT-FPARTYNAME = ITAB-FPARTYNAME.
    *&      Module  STATUS_5555  OUTPUT
          text
    MODULE STATUS_5555 OUTPUT.
      SET PF-STATUS 'SALALL'.
      SET TITLEBAR 'SAL'.
    ENDMODULE.                 " STATUS_5555  OUTPUT
    *&      Module  USER_COMMAND_5555  INPUT
          text
    MODULE USER_COMMAND_5555 INPUT.
    CASE SY-UCOMM.
    WHEN 'BACK'.
    LEAVE TO SCREEN 0.
    WHEN 'SUB'.
    IF ZFISALDT-BILLINGDOCU = ' '
    OR ZFISALDT-SALESDOCU = ' '.
    MESSAGE 'PLEASE FIRST SUBMIT THE BILLING DOCUMENT NO AND SALES DOCUMENT NO' TYPE 'E'.
    ENDIF.
    ZFISALDT-BILLINGDOCU = ZFISALDT-BILLINGDOCU.
    ZFISALDT-SALESDOCU = ZFISALDT-SALESDOCU.
    ZFISALDT-FORM402 = ZFISALDT-FORM402.
    ZFISALDT-SALESTAXFORM = ZFISALDT-SALESTAXFORM.
    *ZFISALDT-FREIGHTDOCNO = ZFISALDT-FREIGHTDOCNO.
    *ZFISALDT-FPARTYNAME = ZFISALDT-FPARTYNAME.
    *SUBMIT ITAB.
    WHEN ' '.   (THIS THE PART OF CODE WHICH IS NOT WORKING)
    SELECT * FROM ZFISALDT INTO corresponding fields of TABLE ITAB WHERE BILLINGDOCU = ZFISALDT-BILLINGDOCU.
    ITAB-BILLINGDOCU = ZFISALDT-BILLINGDOCU.
    ITAB-SALESDOCU = ZFISALDT-SALESDOCU.
    ITAB-FORM402 = ZFISALDT-FORM402.
    *ZFISALDT-BILLINGDOCU = ITAB-BILLINGDOCU.
    *ZFISALDT-BILLINGDOCU = ITAB-BILLINGDOCU.
    *ZFISALDT-SALESDOCU = ITAB-SALESDOCU.
    *ZFISALDT-FORM402 = ITAB-FORM402.
    *ZFISALDT-SALESTAXFORM = ITAB-SALESTAXFORM.
    append ITAB.                                                      (ALSO USED INSERT BUT NOT WORKING)
    WHEN 'ENTER'.
    IF ZFISALDT-BILLINGDOCU = ' '
    OR ZFISALDT-SALESDOCU = ' '.
    MESSAGE 'PLEASE FIRST SUBMIT THE BILLING DOCUMENT NO AND SALES DOCUMENT NO' TYPE 'E'.
    ENDIF.
    ZFISALDT-FREIGHTDOCNO = ZFISALDT-FREIGHTDOCNO.
    ZFISALDT-FPARTYNAME = ZFISALDT-FPARTYNAME.
    ZFISALDT-FREIGHTBILLNO = ZFISALDT-FREIGHTBILLNO.
    ZFISALDT-FREIGHTDATE = ZFISALDT-FREIGHTDATE.
    ZFISALDT-TRUCKNO = ZFISALDT-TRUCKNO.
    ZFISALDT-FREIGHTAMOUNT = ZFISALDT-FREIGHTAMOUNT.
    ZFISALDT-COMNAGBILL = ZFISALDT-COMNAGBILL.
    ZFISALDT-AGENTNAME = ZFISALDT-AGENTNAME.
    ZFISALDT-CAGDATE = ZFISALDT-CAGDATE.
    ZFISALDT-CMNAGAMOUNT = ZFISALDT-CMNAGAMOUNT.
    ZFISALDT-SHIPMENTNAME = ZFISALDT-SHIPMENTNAME.
    ZFISALDT-SHIPDOCUNO = ZFISALDT-SHIPDOCUNO.
    ZFISALDT-SHIPBILLNO = ZFISALDT-SHIPBILLNO.
    ZFISALDT-SHIPBILLDATE = ZFISALDT-SHIPBILLDATE.
    ZFISALDT-BLNOGOV = ZFISALDT-BLNOGOV.
    ZFISALDT-CHAAGENTNAME = ZFISALDT-CHAAGENTNAME.
    ZFISALDT-CHABILL = ZFISALDT-CHABILL.
    ZFISALDT-CHADATE = ZFISALDT-CHADATE.
    ZFISALDT-CHAAMOUNT = ZFISALDT-CHAAMOUNT.
    ZFISALDT-B_L_NO = ZFISALDT-B_L_NO.
    ZFISALDT-B_L_NODATE = ZFISALDT-B_L_NODATE.
    ZFISALDT-DEPBLICNO = ZFISALDT-DEPBLICNO.
    ZFISALDT-LICENCE_DATE = ZFISALDT-LICENCE_DATE.
    ZFISALDT-FOC_VALUE = ZFISALDT-FOC_VALUE.
    ZFISALDT-DEPB_VALUE = ZFISALDT-DEPB_VALUE.
    INSERT ZFISALDT.
    CLEAR ZFISALDT.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_5555  INPUT
    This is the code please check it once.
    Thanks in advance.

    Hi Sumeet.
    WHEN ' '.  " (THIS THE PART OF CODE WHICH IS NOT WORKING)
    SELECT * FROM ZFISALDT INTO corresponding fields of TABLE ITAB WHERE BILLINGDOCU = ZFISALDT-BILLINGDOCU.     
    " here in where condition u r checking with ZFISALDT-BILLINGDOCU, i guess there is no value in that, Once check in debugging mode and proceed further.
    Regards,
    Aby

  • I'm on a windows laptop using iTunes sharing through the family to connect with Apple TV. After choosing the folder of photos to be shared and displayed on the appletv and when I choose to show on screen, they are not shown in the order they are in the or

    I'm on a windows laptop using iTunes sharing through the family to connect with Apple TV.
    After choosing the folder of photos to be shared and displayed on the appletv and when I choose to show on screen, they are not shown in the order they are in the original folder.
    How to pair show in a certain order, for example, sorted by name.
    grateful
    Julio Cesar

    Not that I'm aware of. You just export JPEG copies to a folder that you can point iTunes to. For instance, I have created a folder in my Pictures folder called Apple TV. And within that folder I have other folders of pictures that I can choose from in iTunes to share with Apple TV. But there doesn't seem to be any way to share a Lightroom slideshow. If you have laid to create a video file that would probably work. Apple TV is a little clunky in my opinion. Some things are a little more difficult to do now than they were a while back. I probably haven't provided you with much help, but just keep experimenting and I think you will figure it out.

  • BSP for Creation and change and display of the documents in SAP R/3.

    Dear All,
    In SAP R/3 system, the documents can be maintained using the T-Codes CV01N, CV02N, CV03N for creation, change and display of the documents. Users is allowed to access to these transaction using the BSP application. The BSP page would be used to enable access the T-Code CV01N, CV02N, CV03N and allow uses to carryout the functionalities of check in and checkout of the document and the object links.
    do i need to replicate all these T-Codes in BSP application?
    If anybody hv done this...pl suggest me and give me the code.
    Thanks & Regards
    Pradeep
    Message was edited by:
            Pradeep Reddy

    if you want this out of BSP, yes you have to code all of them there is not easy way.
    but if the idea is to webenable these transaction and you dont have much time/resource to do it , easiest way is to go with ITS. downside of this is that you dont have much control over look and feel.
    If you are on WAS6.40 or above your application server comes with integrated ITS and enabling the same is quiet simple.
    Regards
    Raja

  • I have completely lost my safari.  I was getting an error and I lost the address bar.  I tried to fix it by changing the home page on the preferences.  I don't know what to put in the home page now.  How do I get safari back?

    I have completely lost my safari.  I was getting an error and I lost the address bar.  I tried to fix it by changing the home page on the preferences.  I don't know what to put in the home page now.  How do I get safari back?

    I tried editing my first post but couldn't get there...
    If you can open Safari go to the top of your screen, click Safari / Preferences then select the General stab. You can type in the web address for your Home page there.

  • When I try to restore my iPod touch 4G I get error 3194 and I have the latest version of iTunes

    When I try to restore my iPod touch 4G I get error 3194 and I have the latest version of iTunes

    Error 3194: Resolve error 3194 by updating to the latest version of iTunes. "This device is not eligible for the requested build" in the updater logs confirms this is the root of the issue. For more Error 3194 steps see: This device is not eligible for the requested build above.
    Are you trying to restore to a PC or an Mac?  Either way, I'd remove iTunes, empty the trash, restart, and download/install the latest version.  Also, check the versions of OS that the latest build of iTunes will work with.

  • The LCD for my macbook air model number MC965LL/A (purchased 2011) is broken , where  can I get new one and what is the part number for it ?

    The LCD for my macbook air model number MC965LL/A (purchased 2011) is broken , where  can I get new one and what is the part number for it ?

    You can find them at vendors like ifixit and instructions to install.
    http://www.ifixit.com/Mac-Parts/MacBook-Air-13%22-Mid-2011

  • Query for getting all function and procedure inside the packages

    hi All
    Please provide me Query for getting all function and procedure inside the packages
    thanks

    As Todd said, you can use user_arguments data dictionary or you can join user_objects and user_procedures like below to get the name of the packaged function and procedure names.
    If you are looking for the packaged procedures and functions source then use user_source data dictionary
    select a.object_name,a.procedure_name from user_procedures a,
                  user_objects b
    where a.object_name is not null
    and a.procedure_name is not null
    and b.object_type='PACKAGE'        
    and a.object_name=b.object_name

  • Help! Read raw Image data from a file and display on the JPanel or JFrame.

    PLEASE HELP, I want to Read Binary(Raw Image)data (16 bit integer) from a file and display on the JPanel or JFrame.

    Hey,
    I need to do the same thing. Did you find a way to do that?
    Could you sent me the code?
    It's urgent, please.
    My e-mail is [email protected]

  • HT1752 MY IPOD HAS DIED AND APPLE WILL NO LONGER SERVICE IT. WHERE DO I GO TO GET IT SERVICED AND REPAIRED IN THE UK

    MY IPOD HAS DIED AND APPLE WILL NO LONGER SERVICE IT. WHERE DO I GO TO GET IT SERVICED AND REPAIRED IN THE UK

    Well first you locate your Caps Lock key. It is located above shift, and below tab. Now you press it, and take a deep breath. If your iPod is outside of its service, have you looked into other options like local repair shops? Sometimes they still service older products.
    -Alkaid

  • Why won't my MacBook run on battery and display on the monitor?      Runs fine if power cord is plugged in.                                                                                      I have to be plugged in to see the monitor display.  Any ideas

    Why won't my laptop run on battery and display on the monitor?  If it is plugged in to power it works fine but the monitor goes blank if the power cord is removed.  Any ideas?

    Nothing is wrong.  what your're seeing is by design.

Maybe you are looking for

  • How to get parents data from a leaf in a recursive table

    I want to get a list of all parents data related to a leaf in a table. The table has 3 rows id, description, parent. if I have the id of one of this items I want to get all his parents, is there a way to get this with a select or with connect by prio

  • User exit / BADI on creation WBS

    Hi all, I'm looking for a way to access the fields of a WBS before displaying. The field project type is filled in by default, and I would like to clear this. I looked for a user exit / BADI but wasn't able to find one whic allows me to do what I wan

  • Help: Enforce phone number format through DB trigger

    Hi, I am trying to create a trigger in DB that will alter any phone number insert or update into a standard format as (xxx) xxx-xxxx. For example, 1. if user attempts to insert 123-456-7890, the trigger will alter it as (123) 456-7890 2. if user atte

  • Sorting in Folder block of customer entry form

    In Customer Entry form, the folder block ORG_NS_FIND_FOLDER is being sorted on org_per_number,customer_number. We are customising this form and would like to override the default sorting and use our sort columns. Can anyone please let me know where i

  • Are ERP Sales Orders supported for B2C Web Channel Scenario in CRM 7.0?

    Hi Experts, We are on CRM 7.0 with ECC 6.0 as backend system. I just want to know whether the third party tax system (Vertex or Taxware) is mandatory for B2C WEB Channel implementation?? Without using a third party tax system, how can we configure ta