cancel
Showing results for 
Search instead for 
Did you mean: 

Modifying Masthead - Add fields from Infotypes

Former Member
0 Kudos

Hi ,

I need to make some changes on welcome message, in portal.

I already identify the par file that i need to change (com.sap.portal.navigation.masthead), and the JSP file (HeaderiView.jsp).

The questions are:

1- How can i add some fields to the welcome message, with information from Infotypes (R/3)? Can i "control" the connection to the R/3 in this HeaderiView.jsp?

2- Can i acess to the code of "com.sapportals.portal.prt.session.IUserContext", that is imported in HeaderiView.jsp, in order to know which methods this class has and use them?

Thanks in advance,

Regards

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

> 1- How can i add some fields to the welcome message, with information from Infotypes (R/3)? Can i "control" the connection to the R/3 in this HeaderiView.jsp?

You can control the connection to R3 using either Jco or Connector framework API's. They are simple; search them on sdn for more. But you can only retrieve data from R/3 if the same is exposed via a RFC/BAPI.

> 2- Can i acess to the code of "com.sapportals.portal.prt.session.IUserContext", that is imported in HeaderiView.jsp, in order to know which methods this class has and use them?

You will need to make an object of class IUserContext in order to access any methods

Former Member
0 Kudos

Hi,

Thanks for your replies.

Prem Mascarenhas, about the 2nd answer... Yes, creating an object of that class i can use methods of it, but can i know which methods this class has?

For example, it has the methods getFirstName() and getLastName() of a user, because i can see them on the code. But i would like to know if there is any method called getPERNR(), for example;

So, can i acess to a list of methods of this class?

Thanks a lot!

Luis

Former Member
0 Kudos

Over here https://help.sap.com/javadocs/NW04S/current/ep/index.html

But I dont think theres anything like getPERNR...

Hope this helps.

Former Member
0 Kudos

Yes, it helped...

You are right, there is not method getPERNR() on this class.

I need a method like this to add the pernr from an employee to the Welcome Message in portal. I suppose that should exist one, probably in other class right?

Thanks

Former Member
0 Kudos

It wont exist. You will have to fetch it yourself.

Because the class refers to a portal login and not the backend ECC login. You will have to find a rfc that fetches it and as someone already pointed out, its a bit heavy on the first page to do that.

Former Member
0 Kudos

Humm, i see...so i will have to implement that functionality myself, through a RFC ... i am new working with RFCs, i will try to search something useful here in SDN...

Anyway, if you know some post or link with examples of RFC implementation, please tell me.

Thanks a lot,

Luis

Former Member
0 Kudos

look at this function module to get the pernr of the person who logged in

CRIF_GET_EMPLOYEE_FOR_USER

and below link to use that function module in your jsp file

https://forums.sdn.sap.com/click.jspa?searchID=7862295&messageID=4388980

reward points if helpful

Former Member
0 Kudos

Thanks Bala,

This can be useful for me, the FM and the link. Just a question, the connection pool with username and password is always necessary in order to communicate with SAP?

Thanks,

Regards

Former Member
0 Kudos

yes it is necessary .but i dont know the exact reason

Answers (1)

Answers (1)

former_member182598
Active Contributor
0 Kudos

Hi Louis,

I am afraid your solution will effect the response time and it can create lot of issues. The Masthead will be loaded in the first call, and if you are trying to access the R3 during this your response time will be very high. Another thing is any problem in your R3 side(like network failure, R3 down time etc) will cause your Masthead code to crash, It can even stop the user from logging off, and will not be a very pleasant situation. You may need to rethink your solution.

As far as adding custom fields are concerned, you can always do that. Why you need to do it through the IUserContext i couldn't make out. Its a jsp file and you can put whatever you feel like !!.

regards

Prashant