4 Replies Latest reply: Apr 14, 2011 5:52 PM by Derrick Banks RSS

Retrieve Comments / Notes from HCM P&F

Marcos S
Currently Being Moderated

Hi,

 

I am figthing with this since several days ago.

 

The issue I am facing with is to get the comments from a HR ASR Form (fields HRASR_PREVIOUS_NOTES and HRASR_CURRENT_NOTE).

 

Before posting, please do not send me the link to the blog post (http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/10037) because the solution posted there is wrong:

 

Here is the quoted answer:

 

LOGIC TO RETRIEVE COMMENTS:

 

Get "Process Route IDu201D from SCMG_T_CASE table using GUID (Check Workflow container for GUID)

Using the "PHIO_ID" field we can easily find the text from STXH table. The link table between SCMG_T_CASE and STXH will be SCMGPOIDCR_CLNT table

 

Note: To fetch the correct comments, validation should be done with the workflow runtime data like actual agent who had processed the form , with date and time details.

 

-

 

What I did was:

 

1) Get Process Object GUID from Workflow Container: field PROCESS_OBJECT.GUID

2) Access to SCMG_T_CASE table with CASE_GUID = PROCESS_OBJECT.GUID

3) You will get a single row with Record POID ID (field RECORD_PDIR, GUID 32), Note POID ID (field NOTE_PDIR, GUID 32) and Process Rout ID (field WFPTHID, NUMC 12).

4) Access to SCMGPOIDCR_CLNT table with PHIO_ID = SCMG_T_CASE-RECORD_PDIR or PHIO_ID = SCMG_T_CASE-NOTE_PDIR.

5) You will get several rows (in my case 6) with Area (field RELID, CHAR 2), Counter (field SRTF2, INT4 10), PHIO Class (field PH_CLASS, CHAR 10), Data Lenght (field CLUSTR), alphanumeric text (field CLUSTD, LRAW 256).

6) Attempt to access to STXH table, but there is no entries with SCMGPOIDCR_CLNT returned data. Field Text Name (TDNAME) is a GUID 32 key concatenated with date and time. There is no way to access to the correct entries.

 

If anyone has any knowledge about this, please help me. I coudn't find any way (neither FMs nor programs) to get the comments

 

Thanks in advance.

Marcos

  • Re: Retrieve Comments / Notes from HCM P&F
    Christopher Solomon
    Currently Being Moderated

    Actually, that information you quoted was correct....but just for previous EHP versions that the blog was written about at the time. Since then, there have been some changes. One simple question....have you even bothered to debug how the framework itself accesses and writes/reads the "comments". I would just reuse those existing classes instead of worrying over duplicating all of that logic.

    • Re: Retrieve Comments / Notes from HCM P&F
      Andre F
      Currently Being Moderated

      Hope you find this answer a little more helpful:

       

      (from a previous posting)

       

       

      CREATE OBJECT message_list.

       

                • Getting the mail attachment data ********************

      • Getting the process object by work item id

      CALL METHOD cl_hrasr00_process_utilities=>get_pobj_by_wi

      EXPORTING

      workitem_id = workitem

      IMPORTING

      return_code = return_code

      process_object_guid = pobj_guid.

       

      • Getting scenario guid

      SELECT SINGLE case_guid

      FROM t5asrscenarios

      INTO scenario_guid

      WHERE parent_process = pobj_guid

      AND scenario = scenario

      AND scenario_version = scenario_version.

       

      • Get instance of POBJ_RUNTIME

      CALL METHOD cl_hrasr00_process_runtime=>get_instance

      EXPORTING

      scenario_guid = scenario_guid

      activity = activity

      message_handler = message_list

      no_auth_check = 'X'

      IMPORTING

      instance_pobj_runtime = ref_pobj_runtime

      is_authorized = is_authorized

      is_ok = is_ok.

       

      • Getting the latest step guid

      CALL METHOD ref_pobj_runtime->get_all_steps

      EXPORTING

      message_handler = message_list

      IMPORTING

      steps = tab_steps

      is_ok = is_ok.

       

      LOOP AT tab_steps INTO wa_step.

      ENDLOOP.

       

      *Later you use below method to get the notes of the latest step.

       

      CALL METHOD ref_pobj_runtime->if_hrasr00_pobj_note~get_notes_of_step

      EXPORTING

      step_guid = wa_step

      message_handler = message_list

      IMPORTING

      notes = notes

      is_ok = is_ok.

       

      *Here wa_step is the latest step.

  • Re: Retrieve Comments / Notes from HCM P&F
    Derrick Banks
    Currently Being Moderated

    There are 2 methods in the class CL_HRASR00_PROCESS_RUNTIME that will retrieve notes for each step or for the entire scenario.

     

    IF_HRASR00_POBJ_NOTE~GET_NOTES_OF_STEP

    IF_HRASR00_POBJ_NOTE~GET_NOTES_OF_SCENARIO

     

    Thanks,

    Derrick Banks

    Banks & Company, LLC

  • Re: Retrieve Comments / Notes from HCM P&F
    Mallesh Utage
    Currently Being Moderated

    Hi Marcos,

     

    Did you got the solution for this pbm ? If yes please provide me the solution.

     

    Since I am struggling with the same issue. ( http://forums.sdn.sap.com/thread.jspa?threadID=2140485&tstart=0 )

     

    Thanks & Regards,

    Mallesh.

Actions