Skip to Content

Removing salutation in Welcome Message of masthead of sap netweaver portal 7.0x

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.

Be the first to leave a comment
You must be Logged on to comment or reply to a post.