cancel
Showing results for 
Search instead for 
Did you mean: 

How can I add additional information in noting section

0 Kudos

Hi,

Is it possible to additional information such as department details in the noting section?

Regards,

Vineeti

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

The standard system displays the agent (user) details based on the workflow. For example, if a position is added in the workflow, the position name and the name of the user holding the position is shown in the noting section. Similarly, if a user is added, the name of the user is displayed.

However, you can display additional information such as department details, user id etc. by following the below approach.

First create a Z Service redefining the standard service /PSINDS/FILES_SRV. In the Z Service redefine the methods FILE_NOTING_ES_GET_ENTITYSET, FILE_NOTING_ES_CREATE_ENTITY.

The Sample code of the redefined method is shown below. Here the assumption is only Positions are added in the workflow

method file_noting_es_create_entity.

  data: lv_uname type sy-uname,

        lv_pernr type p0105-pernr,

        lv_plvar type plvar,

        lv_caseguid type scmg_case_guid,

        lv_date type begda,

        lv_oid type char12,

        lt_pernr type pernr_us_tab,

        lv_position type stext,

        ls_pernr type pernr_us,

        lt_proutedet type /psinds/t_detprstatus,

        lt_result_tab type tswhactor,

        lt_result_objec type objec_t,

        lt_result_struc type struc_t,

        ls_result_objec type objec.

  data: lv_slen type i,

      lv_obj type otype,

      lv_user type char12,

      lv_cy type sy-uname,

      lv_puser type realo,

      lv_found type boolean,

      l_plvar type plvar,

      lv_prnr type persno,

      ls_proutedet type /psinds/s_detprstatus,

      lv_temp_usr type sy-uname.

  data: lv_orgunit type t527x-orgtx,

        begin of ls_org,

          ename type pa0001-ename,

          plans type pa0001-plans,

          orgtx type t527x-orgtx,

        end of ls_org.

  data :   ls_noting type /psinds/cl_files_srv_mpc=>ts_file_noting_et.

  io_data_provider->read_entry_data(

    importing

      es_data = ls_noting

  ).

  lv_caseguid = ls_noting-caseguid.

  try.

      call method super->file_noting_es_create_entity

        exporting

          iv_entity_name          = iv_entity_name

          iv_entity_set_name      = iv_entity_set_name

          iv_source_name          = iv_source_name

          it_key_tab              = it_key_tab

          io_tech_request_context = io_tech_request_context

          it_navigation_path      = it_navigation_path

          io_data_provider        = io_data_provider

        importing

          er_entity               = er_entity.

    catch /iwbep/cx_mgw_busi_exception .

    catch /iwbep/cx_mgw_tech_exception .

  endtry.

  lv_uname = cl_abap_syst=>get_user_name( ).

  lv_date = sy-datum.

  call function 'RH_GET_ACTIVE_WF_PLVAR'

    exporting

      set_default_plvar = 'X'

    importing

      act_plvar         = lv_plvar

    exceptions

      no_active_plvar   = 1

      others            = 2.

  if sy-subrc <> 0.

    return.

  endif.

    lv_prnr = lv_uname.

    select single a~plans b~orgtx into corresponding fields of ls_org from pa0001 as a inner join t527x as b on a~orgeh = b~orgeh where a~pernr = lv_prnr and a~begda <= sy-datum and a~endda >= sy-datum.

    if sy-subrc eq 0.

      select single plstx into lv_position from t528t where sprsl = sy-langu and otype = 'S' and plans = ls_org-plans and begda <= sy-datum and endda >= sy-datum.

      concatenate er_entity-name lv_position ls_org-orgtx into er_entity-name separated by ', '.

    endif.

*  fill organisation for private noting

  if er_entity-rmrkid is not initial.

    clear: ls_org.

    select single a~ename b~orgtx into corresponding fields of ls_org from pa0001 as a inner join t527x as b on a~orgeh = b~orgeh where a~plans = er_entity-rmrkid and a~begda <= sy-datum and a~endda >= sy-datum.

    if sy-subrc eq 0.

      concatenate ls_org-ename er_entity-rmrkto ls_org-orgtx into er_entity-rmrkto separated by ', '.

    endif.

  endif.

  clear er_entity-createdby.

endmethod.

method file_noting_es_get_entityset.

  try.

      call method super->file_noting_es_get_entityset

        exporting

          iv_entity_name           = iv_entity_name

          iv_entity_set_name       = iv_entity_set_name

          iv_source_name           = iv_source_name

          it_filter_select_options = it_filter_select_options

          is_paging                = is_paging

          it_key_tab               = it_key_tab

          it_navigation_path       = it_navigation_path

          it_order                 = it_order

          iv_filter_string         = iv_filter_string

          iv_search_string         = iv_search_string

          io_tech_request_context  = io_tech_request_context

        importing

          et_entityset             = et_entityset

          es_response_context      = es_response_context.

    catch /iwbep/cx_mgw_busi_exception .

    catch /iwbep/cx_mgw_tech_exception .

  endtry.

  data: lt_noting type /psinds/cl_files_srv_mpc=>tt_file_noting_et,

        lv_str type string,

        lv_date type sy-datum,

        lv_user type char14,

        lv_slen type i,

        l_plvar type plvar,

        lv_oid type char12,

        lv_sid type sysid,

        lt_result_tab type tswhactor,

        lt_result_objec type objec_t,

        lt_result_struc type struc_t,

        ls_result_objec type objec,

        lv_obj type char2,

        lv_pernr type persno,

        lv_pos type plans,

        lv_prnr type persno,

        lv_position type stext,

        ls_noting type /psinds/cl_files_srv_mpc=>ts_file_noting_et.

  data: lv_orgunit type t527x-orgtx,

        begin of ls_org,

          ename type pa0001-ename,

          plans type pa0001-plans,

          orgtx type t527x-orgtx,

        end of ls_org.

  lt_noting = et_entityset.

  call function 'RH_GET_ACTIVE_WF_PLVAR'

    exporting

      set_default_plvar = 'X'

    importing

      act_plvar         = l_plvar

    exceptions

      no_active_plvar   = 1

      others            = 2.

  loop at lt_noting into ls_noting.

    clear: ls_noting-createdby,lv_date,lv_user,lv_str,lv_slen,lt_result_tab,lt_result_objec,lt_result_objec.

    lv_str = ls_noting-comments.

    split lv_str at '::' into lv_user lv_date.

    lv_prnr = lv_user.

    select single a~plans b~orgtx into corresponding fields of ls_org from pa0001 as a inner join t527x as b on a~orgeh = b~orgeh where a~pernr = lv_prnr and a~begda <= lv_date and a~endda >= lv_date.

    if sy-subrc eq 0.

      select single plstx into lv_position from t528t where sprsl = sy-langu and otype = 'S' and plans = ls_org-plans and begda <= lv_date and endda >= lv_date.

      concatenate ls_noting-name lv_position ls_org-orgtx into ls_noting-name separated by ', '.

    endif.

    if ls_noting-rmrkid is not initial.

      select single a~ename b~orgtx into corresponding fields of ls_org from pa0001 as a inner join t527x as b on a~orgeh = b~orgeh where a~plans = ls_noting-rmrkid and a~begda <= lv_date and a~endda >= lv_date.

      if sy-subrc eq 0.

        concatenate ls_org-ename ls_noting-rmrkto ls_org-orgtx into ls_noting-rmrkto separated by ', '.

      endif.

    endif.

    modify lt_noting from ls_noting transporting createdby name comments rmrkid rmrkto.

  endloop.

  clear  et_entityset.

  et_entityset = lt_noting .

endmethod.

Regards,

Karthik