Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member184059
Contributor

I am writing this blog to customize the welcome message in masthead of SAP Netweaver Portal 7.0x. For example, someone wants that welcome message should come as "Welcome Firstname Lastname" in case of ABAP UME is used. Let me describe how you can achieve this:

1. First download the file "com.sap.portal.navigation.masthead.par.bak" from the given path

    /usr/sap/EPP/JC00/j2ee/cluster/server0/apps/sap.com/irj/servlet_jsp/irj/root/WEB-INF/deployment/

    It might be in pcd or temp directory also.

    System Adminstration > Support > Portal Runtime > Browse Deployment

2. Remove .bak extension and open the file "HeaderiView.jsp"

     PORTAL-INF > jsp > HeaderiView.jsp

3. Customize "GetWelcomeMsg" method as per your requirment. The customization made below will remove salutation.

private String GetWelcomeMsg(IPortalComponentRequest request, String welcomeClause)

{

    IUserContext userContext = request.getUser();

    if (userContext != null)

    {

  String firstName = userContext.getFirstName();

  String lastName = userContext.getLastName();

  String salutation = null;

// String salutation = userContext.getSalutation();

 

  if ((firstName != null) && (lastName != null))

  {

   if(salutation != null)

   {

    return java.text.MessageFormat.format(welcomeClause, new Object[] {firstName, lastName, salutation}).toString();

   }

   else

   {

    return java.text.MessageFormat.format(welcomeClause, new Object[] {firstName, lastName, " "}).toString();

   }

  }

  else if ((firstName == null) && (salutation != null))

     {

        return java.text.MessageFormat.format(welcomeClause, new Object[] {" ", lastName, salutation}).toString();

  }

  else      

  {

   return java.text.MessageFormat.format(welcomeClause, new Object[] {userContext.getDisplayName()," ", " "}).toString(); 

  }

}

    return "";

}

4. Save Changes and upload the par using Administration Console.

        System Administration > Support > Portal Runtime > Administration Console

5. Logoff and logon again.

NOTE: Apply latest patch or any upgrade might revert back the changes.

Hope the above steps helps.