cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with ITS login

Former Member
0 Kudos

Hi all,

I am stuck up developing an ITS application.

I want to get the user loging in by his employee number(PERNR) in the application.

Now, I want to validate the PERNR as well as to retain that Name and number in the whole application.

Ex. I am entering PERNR in the first screen, press "Submit".

Now the Welcome page appears which displays some instructions, Also I want to display the Name of Employee on the top saying "Welcome <Employee Name>".

Also I want to retain the PERNR and name in the whole application.

Can somebody please help me ?

Some sample code would be appreciated.

Reward points... Don't worry.

Thanks in advance,

Hemant.

Accepted Solutions (1)

Accepted Solutions (1)

p190355
Active Contributor
0 Kudos

Hi Hemant,

With the FM : HR_GETEMPLOYEEDATA_FROMUSER,

You can get the PERNR as well as User name.

(Besides these there are more....!!)

Say,

If my screen structure is P0001 based :

CALL FUNCTION 'HR_GETEMPLOYEEDATA_FROMUSER'

EXPORTING

username = sy-uname

IMPORTING

employeenumber = p0001-pernr

name = p0001-ename

  • return = return

EXCEPTIONS

user_not_found = 1

countrygrouping_not_found = 2

infty_not_found = 3

OTHERS = 4

.

Hope this helps.

Regards,

Remi

Answers (1)

Answers (1)

former_member228142
Active Contributor
0 Kudos

Hi Hemant,

if the username and PERNR is on the dynpro you just has to refer to the fieldname. If not you have to write this information from ABAP into ITS context, from where you can use it in your template. This can be done using the Web Transaction API http://help.sap.com/saphelp_nw04/helpdata/en/48/35d69f4abf11d18a0f0000e816ae6e/frameset.htm

At first use the macro FIELD-SET and transport the data using FIELD-TRANSPORT.

Best regards,

Klaus