cancel
Showing results for 
Search instead for 
Did you mean: 

PERNR_MEM_ID is missing for ASR_PERSONNEL_FILE

ali_eshaghibeni
Participant
0 Kudos

Dear All,

I spent about a week search through old discussions to find an answer for my question but results was disappointing. This is my problem:

In NWBC Web, i am trying to show Digital Personnel Files to each staff by using ASR_PERSONNEL_FILE application but i got following error "Select an employee".

i`v configured this application in my ESS role by setting following parameters:

INITIATOR_ROLE = HRASRD

PERNR_MEM_ID = ESS01

Indeed, i have checked my linked staff using report RPASRCREATEDPF against DPF to ensure this staff have a personal record.

So, after all configurations i was not able to make it run and problem is still persist.

Please Help me,

Accepted Solutions (1)

Accepted Solutions (1)

yury_sichov
Active Contributor
0 Kudos

May be it helps.

Memory Id is generating in CL_HRESS_EMPLOYEE_SERVICES=>SET_PERNR_TO_MEMORY.

And it is number not char. Why "PERNR_MEM_ID = ESS01"

CALL METHOD CL_HRESS_EMPLOYEE_SERVICES=>SET_PERNR_TO_MEMORY

   EXPORTING

     iv_pernr                  = lv_pernr

*     IV_DISP_CE_ASSIGTS_SCREEN =

*     IV_NON_EIC_MODE           =

   RECEIVING

     RV_MEM_ID                 = w_value

http://scn.sap.com/community/web-dynpro-abap/blog/2014/07/28/secure-transferring-of-parameters-betwe...

ali_eshaghibeni
Participant
0 Kudos

Dear Yurri

thanks for your prompt reply and useful blogpost. using ESS01 as parameter is not a choice in my scenario, i am using an standard application ASR_PERSONNEL_FILE and this parameter is standard parameter and suppose to find PERNR from INDX table and i am WONDERING who wrote this part of code in SAP and why they use such a method, but this is what it is.

if you take a look at source code (se80--> Webdynpro Comp-->HRASR00_PERSONNEL_FILE) you gonna find they use strange method to find PERNR and my problem is that in IDES this program is quiet same but works fine.

Regards,

Ali.

yury_sichov
Active Contributor
0 Kudos

There are two use cases of HRASR00_PERSONNEL_FILE:

- external launch

- internal launch

PERNR_MEM_ID is used only with external launch.


For example i wrote a simple program with external launch by entering pernr number.


DATA: w_url   TYPE string,
         w_value TYPE string.


   DATA lo_el_context TYPE REF TO if_wd_context_element.
   DATA ls_context TYPE wd_this->Element_context.
   DATA lv_pernr TYPE wd_this->Element_context-pernr.

* get element via lead selection
   lo_el_context = wd_context->get_element( ).
* @TODO handle not set lead selection
   IF lo_el_context IS INITIAL.
   ENDIF.


       lv_pernr = '1000800'.

  * Get the URL of the called application
   CALL METHOD cl_wd_utilities=>construct_wd_url
     EXPORTING
       application_name = 'asr_personnel_file'
     IMPORTING
       out_absolute_url = w_url.


*Export to Memory

  CALL METHOD CL_HRESS_EMPLOYEE_SERVICES=>SET_PERNR_TO_MEMORY
    EXPORTING
      iv_pernr                  = lv_pernr
*     IV_DISP_CE_ASSIGTS_SCREEN =
*     IV_NON_EIC_MODE           =
    RECEIVING
      RV_MEM_ID                 = w_value
      .

*Attach the parameters and its value with the URL that
* have to be passed to the 2nd application
   CALL METHOD cl_http_server=>append_field_url
     EXPORTING
       name  = 'PERNR_MEM_ID'
       value = w_value
     CHANGING
       url   = w_url.

* generate a popup window for the 2nd application with the above URL
   DATA lo_window_manager TYPE REF TO if_wd_window_manager.
   DATA lo_api_component  TYPE REF TO if_wd_component.
   DATA lo_window         TYPE REF TO if_wd_window.

   lo_api_component  = wd_comp_controller->wd_get_api( ).
   lo_window_manager = lo_api_component->get_window_manager( ).

   lo_window         = lo_window_manager->create_external_window(

                    url = w_url ).

   lo_window->open( )
.


And it is working!



yury_sichov
Active Contributor
0 Kudos

About internal launch.

Method HANDLEDEFAULT of Window ASR_PERSONNEL_FILE

* Get Pernr
   IF NOT pernr_mem_id IS INITIAL.  "External
     CALL FUNCTION 'HR_ASR_WDA_GET_EMPLOYEE'
       EXPORTING
         id    = pernr_mem_id
       IMPORTING
         pernr = pernr
         ename = employee_name.
   ELSE.                                          "Internal
     CALL FUNCTION 'HR_ASR_WDA_GET_EMPLOYEE'
       IMPORTING
         pernr = pernr
         ename = employee_name.
   ENDIF.



It finds users ASR_EE_sy_uname in employee_tab. How to set this i dont know.


IF id CS 'ESS' OR id CS 'MSS' OR id IS INITIAL.

     IF id IS INITIAL.
       CONCATENATE 'ASR_EE_' sy-uname INTO id_int.    "XREN1011568
     ELSE.
       CONCATENATE id '_EE_' sy-uname INTO id_int.    "XREN1011568
     ENDIF.

     IMPORT tab = employee_tab
       FROM DATABASE indx(as)
       TO indx_wa
       CLIENT sy-mandt
       ID id_int.

     CHECK indx_wa-usera = sy-uname.

ali_eshaghibeni
Participant
0 Kudos

yes yurri yes, you are definitely RIGHT, but problem is in my case i am in ESS role, i want to show staff their personnel files, my code is exactly just like yours but when i run the page if i use that ESS01 parameter it returns "Select an Employee" and if i remove it, it shows wrong personnel file, in fact it returns personnel files related to the last person who in MSS manager searched for, in short MEM_ID filled somewhere else before and it seems it does not care about current user and fill this data from neverland.

any idea?

thank you,

yury_sichov
Active Contributor
0 Kudos

I created a configuration ZASR* for application

and added parameter ESS01

It works after that!!!

Make configuration and replace it in your ESS

yury_sichov
Active Contributor
0 Kudos

Verify in Debug, message to SAP OSS.

ali_eshaghibeni
Participant
0 Kudos

HI Yurri

finally i solved my problem but in another way,  i solved this problem by creating a "Z" copy of ASR_PERSONNEL_FILE and then change part of code as below: in METHOD tab i found HANDLEDEFAULT method that obviously this is main method, there is part of code that check PERNR_MEM_ID against saint INDX table and returns PERNR and ENAME (employee name) and ...

this is the original code:


IF NOT pernr_mem_id IS INITIAL.

     CALL FUNCTION 'HR_ASR_WDA_GET_EMPLOYEE'

       EXPORTING

         id    = pernr_mem_id

       IMPORTING

         pernr = pernr

         ename = employee_name.

   ELSE.

     CALL FUNCTION 'HR_ASR_WDA_GET_EMPLOYEE'

       IMPORTING

         pernr = pernr

         ename = employee_name.

   ENDIF.

and this is my code which i replaced with SAP code:


IF NOT pernr_mem_id IS INITIAL.

MOVE sy-uname TO uname.

CALL FUNCTION 'RP_GET_PERNR_FROM_USERID'

     EXPORTING

       begda     = sy-datum

       endda     = sy-datum

       usrid     = uname

       usrty     = '0001'

     IMPORTING

       usr_pernr = pernr

     EXCEPTIONS

       retcd.

SELECT SINGLE ename FROM pa0001 INTO employee_name WHERE pernr =  pernr AND endda = '99991231'.

When im looking at this code i feel it does not violate any security of user since in a same way this code find PERNR and ENAME based on logged-in user name and nothing else is accessible from here.

I know this is very simple Yurri, but i just want to share for other people , it is not gonna solve main problem with ASR_PERSONNEL_FILE (bug or anything else) but i do believe this is a true ESS version of  this webdynpro application while the standard one is still ok for MSS role.

Hope this helps,

Ali,

Former Member
0 Kudos

Hi,

I try to activate the DPF but the message "please enter a valid url" occurs.

I use the standard link in lpd_cust so I don't understand.

Some can help me please?

Thanks !

ali_eshaghibeni
Participant
0 Kudos

Hi Marc,

I think you dont need that much of config to use DPF (other than creating Personnel records and those configs related to record model), you can use standard link in any of ESS roles in PFCG and just make it visible (like SAP_EMPLOYEE_ESS_WDA_1) you can check the standard app in the role i provided and check is it gonna work or it returns same error, you can find it under

Personnel Information--->Personnel File

i dont know why you need to go trough lpd_cust, can you provide any screenshot to understand your problem.

Regards,

ALI.

Former Member
0 Kudos

I try to display the Digital file via the HR Renewal application.

It exists a link for that (unless I think)

But When I use it

This message occurs :

ali_eshaghibeni
Participant
0 Kudos

Hi

I believe it can occur by premission or you need to activate a service in SICF. I have checked your customization in lunch pad against mine and it is same so it might not have any problem in there.

According to SAP information DPF is part of HR ADMINISTRATIVE SERVICES so you have to activate all services related to HRMSS* , you cn go to SICF and check whether all services are activated or not.

Regards,

Former Member
0 Kudos

yes you were right I have activated a service and now it's (almost) working .

The system asks me a personnel number but in my process the application is called by the hr admin so I need a way to enter the number somewhere.

Is it ringing a bell for you?

thanks again.

ali_eshaghibeni
Participant
0 Kudos

Hi Marc,

Please mark posts as correct answer if you found any of my answers helpful or the exact answer, this can help others.

In MSS normally Personnel Information is under submenu which is under main page of HR Admin, admin first choose a Personnel then all other apps under main page cache this PERNR, this means HR Admin must first choose a person then go for His/Her personnel file. As i remeber Hr Admin can do this in default page for hr admin.

You can take a look at Standard roles for HR admin and see how it works.

Regards,

ALI.

Former Member
0 Kudos

Hi,

I have tried many things but I still don't see the possibility to enter the pernr.

Even in the workforce viewer the submenu doesn't appears....

ali_eshaghibeni
Participant
0 Kudos

Hi Marc,

Take a look at role "SAP_ASR_HRADMIN_SR_HCM_CI_3" go to PFCG check menu.

You may find the submenu as INVISIBLE, you must make required page visible, then check it in NWBC/PORTAL you will see something like this:

So you can search for employees "AS a HR ADMIN" then all sub program under Personnel Information gonna catch PERNR of that Person and you will be fine.

You know what to do with roles Nah? definitely someone like HR ADMIN or HR staff should have such access to Personnel information.

Regards,

ALI.

Former Member
0 Kudos

Now the application appears in the submenu of a MSS (not what I want but...).

Unfortunately I'm facing to the same problem that you. The pernr is not filled and the memory id neither.

But compare to you, my number is not the active person but could be anyone.

ali_eshaghibeni
Participant
0 Kudos

Hi,

good to hear your issue have solved, but the memory id problem is related to ESS not MSS, i dont know which one is your problem.

what do you mean by active person, did you create Personnel Record (RPASRCREATEDPF) before test the app?

hope you solve the issue with information in this thread.

Regards.

ALI

Former Member
0 Kudos

Hi,

I'm able to see the personnel file of only one person (if I force in the parameter the pernr id).

But the person for who I want to display the personnel file must be dynamic.

By active person I mean the person who is connected to the application (ESS).

Thanks

Answers (1)

Answers (1)

ro9
Participant
0 Kudos

Hi!

We are facing the exact same problem.

We are trying to make the digital personnel file available to the employee.
I have done some debugging - and i always takes the first employee from the database.

I have also made a custom application configuration - but it doesn't change a thing.

I guess i will do my own version of the handledefault using an enhancement.
But have you heard from SAP yet?


Br

Ronni

ali_eshaghibeni
Participant
0 Kudos

HI Ronni

nothing new from SAP, as a matter of fact creating an application configuration is not working since information retrieve from INDX table and .... so i am wondering because last week we have installed IDES EHP7 and when i was working with new features suddenly i found there is same issue in DPF even in EHP7!

i recommend you to make it easy, create a new Z copy of application and change some lines of codes just like what i have post here and finish it.

Regards,

ALI.

ro9
Participant
0 Kudos

Hi Ali!

Thanks for your reply

I guess i will be doing the same hack as you did

Thanks alot.

br Ronni

ali_eshaghibeni
Participant
0 Kudos

HI Ronni

i hope you solve that issue, and this is not a hack, this is Z copy and you can customize any Z app as your requirement .

Regards,

ALI.

ro9
Participant
0 Kudos

Hi Again!


You are right!


I made it work buy creating an implicit enhancement - but the outcome was the same as yours.
However - I am actually not sure that is is an error.

If i look in the IMG - under the homepage framework - i see that there is an proxy class:

CL_HRASR00_DPF_AREAPAGE

which - if implemented correctly - should be called, and then deliver the perner + name.

So maybe this is the solution?

ali_eshaghibeni
Participant
0 Kudos

Hi Ronni

I have not checked against proxy class, but question is what is the difference?

i mean at the end, the application is not working properly and even if you find the problem in there you need to enhance SAP application using Developer Key which is not recommended, and one more thing this application is working fine with MSS and only problem is with ESS, so i created a Z copy then enhance the code in a way to Catch PERNR and resolve issue. its just like you create a ESS version of this app.

Regards,

ALI.