Skip to Content
FIN Globalization Services

FAQ - SAP File Lifecycle Management


About the solution:

SAP File Lifecycle Management aims at providing a simple and digitized solution for the movement of files in the public sector, municipal bodies and other large organizations. In these organizations assessment and feasibility studies for of any project is done by seeking the expertise and approval at multiple levels across the organization. These reviews and approvals take place through the movement of files. The solution addresses the file tracking needs of these organizations.

About the document:

This FAQ is the central source of information for the technical implementation of add-onSAP File Lifecycle Management, based on Netweaver 7.31 SP 6.You can use this FAQ to get an overview of SAP File Lifecycle Management and its software units from a technical perspective. The FAQ is a planning tool that helps you to design your system landscape and support the installation and operation of SAP File Lifecycle Management.

Installation information:

  • What is the Netweaver release dependency for FLM?
    FLM is a non modifiable addon on NW731 SP09.
    For the latest component version and patch level requirements, see the SAP File Lifecycle Management Installation Note 1751590.

  • What are the prerequisite software components that are required for installing FLM App?
    You need to install SP06 of component PSINDS from SWP to get the basic version of FLM . Along with this you require UI5 and Netweaver Gateway components for setting up your system.

  • What is the front end software component for FLM?
    FLM does not have a separate front end or UI component. Both the backend and UI objects are delivered as a part of SWC – PSINDS.

  • What is the component for reporting customer incidents ?
    The component for reporting customer incidents is XX-CSC-IN-FLM

  • Where can I find the release strategy and information regarding support packages for SAP File Lifecycle Management
    The release strategy and support package relevant information is available in SAP Note 1751589.

Custom implementation:

  • How to show more user information such as positions, user id, department details for noting

In the standard application, the agent details are provided by default. i.e for e.g.  If a position is  added in the workflow, the position name and the name of the user holding the position is shown, In case if a user is added, only the name of the user is displayed. If there is a need to display for more information such as Department details, user id etc. then follow 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.

  • How to trigger notification when user sends a file/ or sets a substitute?

Notifications can be sent as message in SBWP [SAP Business Workplace].

For Sending notification after setting or activating substitute-

First create a Z Service redefining the standard service /PSINDS/FILES_SRV.
The Sample code for sending notification is below

Create a Function Module 'ZFLM_SUBST_MAIL’ with below code. This function module accepts the content , agent and the dates to generate and send the mail notification

function zflm_subst_mail.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     REFERENCE(IV_AGENT) TYPE  SY-UNAME
*"     REFERENCE(IV_BDATE) TYPE  SY-DATUM
*"     REFERENCE(IV_EDATE) TYPE  SY-DATUM
*"     REFERENCE(IV_REASON) TYPE  /PSINDS/SBUREASTXT
*"----------------------------------------------------------------------
  types:
  begin of  ty_rec,
    email type ad_smtpadr,
    name type string ,
  end of ty_rec .
  types:
  tt_rec type table of ty_rec .
  data : lv_sub type so_obj_des,
         lv_pernr type persno,
         lv_oid type char12,
         l_plvar type plvar,
         lt_result_tab type tswhactor,
         lt_result_objec type objec_t,
         lt_result_struc type struc_t,
         ls_result_objec type objec,
         lv_name type string,
         lv_id type string,
         lv_body type string,
         lv_bdate type sy-datum,
         lv_edate type sy-datum,
         lv_date type char2,
         lv_year type char4,
         lv_count type i,
         lv_month type char2,
         lv_from type string,
         lv_to type string,
         ls_docid type soodk,
         ls_folid type soodk,
         lv_agent type char14,
         lv_un type char12,
         lv_addr type bapiaddr3,
         lt_rec type tt_rec,
         lv_pos type plans,
         lv_slen type i,
         begin of ls_userdetails,
           orgtx type orgtx,
           ename type emnam,
         end of ls_userdetails,
         ls_rec like line of lt_rec,
         lit_return type table of bapiret2,
         lv_reason type /psinds/sbureastxt,
         lv_uname type sy-uname.

  lv_agent = iv_agent.
  lv_bdate = iv_bdate.
  lv_edate = iv_edate.
  lv_reason = iv_reason.
  call function 'RH_GET_ACTIVE_WF_PLVAR'
    exporting
      set_default_plvar = 'X'
    importing
      act_plvar         = l_plvar
    exceptions
      no_active_plvar   = 1
      others            = 2.
  lv_uname = cl_abap_syst=>get_user_name( ).
  lv_pernr = lv_uname.
  select single plans from pa0001 into lv_pos where pernr = lv_pernr and begda <= sy-datum and endda >= sy-datum.
  select single orgtx ename into corresponding fields of ls_userdetails from pa0001 as a join t527x as b on a~orgeh = b~orgeh where a~pernr = lv_pernr.
  lv_oid = lv_pos.
  call function 'RH_STRUC_GET'
    exporting
      act_otype    = 'S'
      act_objid    = lv_oid
      act_wegid    = 'WF_ORGUS'
      act_plvar    = l_plvar
    tables
      result_tab   = lt_result_tab
      result_objec = lt_result_objec
      result_struc = lt_result_struc.
  lv_name = ls_userdetails-ename.
  read table lt_result_objec into ls_result_objec with key otype = 'S'.
  concatenate lv_name ls_result_objec-stext ls_userdetails-orgtx into lv_name separated by '-'.
  lv_sub = 'FLM Substitution Alert'.
  lv_body = 'You have been substituted by'.
  concatenate lv_body lv_name 'From' into lv_name separated by ' '.
  lv_year = lv_bdate+0(4).
  lv_month = lv_bdate+4(2).
  lv_date = lv_bdate+6(2).
  concatenate lv_date lv_month lv_year into lv_from separated by '.'.
  lv_year = lv_edate+0(4).
  lv_month = lv_edate+4(2).
  lv_date = lv_edate+6(2).
  concatenate lv_date lv_month lv_year into lv_to separated by '.'.
  concatenate lv_name lv_from 'To' lv_to into lv_name separated by ' '.
  if lv_reason is not initial.
    concatenate lv_name '...Reason:' lv_reason into lv_name.
  endif.
  call method /psinds/cl_bl_mail=>save_mail_as_draft
    exporting
      iv_subject = lv_sub
      iv_body    = lv_name
*     iv_docid   =
    importing
      es_docid   = ls_docid
      es_folid   = ls_folid.
  lv_slen = strlen( lv_agent ).
  if lv_slen >= 3.
    lv_slen = lv_slen - 2.
    lv_un = lv_agent+2(lv_slen).
  endif.
  call function 'BAPI_USER_GET_DETAIL'
    exporting
      username = lv_un
    importing
      address  = lv_addr
    tables
      return   = lit_return.
  ls_rec-name = lv_addr-fullname.
  ls_rec-email = lv_un.
  append ls_rec to lt_rec.
  call method /psinds/cl_bl_mail=>/psinds/if_bl_mail~send_mail
    exporting
      it_rec     = lt_rec
      iv_subject = lv_sub
      it_content = lv_name.

endfunction.

Redefine the method /IWBEP/IF_MGW_APPL_SRV_RUNTIME~EXECUTE_ACTION.

method /iwbep/if_mgw_appl_srv_runtime~execute_action.

    data : ls_param1 type /iwbep/s_mgw_name_value_pair,
        ls_msg type bapiret2,
        ls_param2 type /iwbep/s_mgw_name_value_pair,
        ls_param3 type /iwbep/s_mgw_name_value_pair,
        ls_param4 type /iwbep/s_mgw_name_value_pair,
        ls_param5 type /iwbep/s_mgw_name_value_pair,
        ls_param6 type /iwbep/s_mgw_name_value_pair,
        ls_param7 type /iwbep/s_mgw_name_value_pair,
        lv_msg type bapiret2-message,
        wa_es_data type /psinds/cl_files_srv_mpc=>ts_fi_response_et,
        lt_msg type bapiret2_t,
        lv_agent type sy-uname,
        lv_bdate type sy-datum,
        lv_edate type sy-datum,
              lv_reason type /psinds/sbureastxt,
        ls_subst type /psinds/cl_files_srv_mpc=>ts_file_subst_op_et.
               
  read table it_parameter into ls_param1 with key name = 'param_1'.
  read table it_parameter into ls_param2 with key name = 'param_2'.
  read table it_parameter into ls_param3 with key name = 'param_3'.
  read table it_parameter into ls_param4 with key name = 'param_4'.
  read table it_parameter into ls_param5 with key name = 'param_5'.
  read table it_parameter into ls_param6 with key name = 'param_6'.
  read table it_parameter into ls_param7 with key name = 'param_7'.

  field-symbols : <fs_et_data> type standard table,
                 <fs_sr_data> type standard table,
                 <fs_dc_data> type standard table.
  case iv_action_name.

    when 'FILES_FI'.
      create data er_data type table of /psinds/cl_files_srv_mpc=>ts_fi_response_et.

      assign er_data->* to <fs_et_data>.
      if ls_param1-value = 'AC'.
        ls_subst-otype = 'US'.
        ls_subst-objid = ls_param2-value.
        ls_subst-date_begin = ls_param3-value.
        ls_subst-date_end = ls_param4-value.
        ls_subst-reason = ls_param5-value.
        call method /psinds/cl_helper_file=>personnel_setting_options
          exporting
            iv_option       = 'AC'
            is_subst        = ls_subst
          importing
            ct_msg          = lt_msg
            ev_subst_status = wa_es_data-add_info.
        read table lt_msg into ls_msg with key type = 'E'.
        if sy-subrc = 0.
          clear wa_es_data.
          wa_es_data-msg_id = ls_msg-number.
          wa_es_data-msg_type = 'E'.
          call function 'BAPI_MESSAGE_GETDETAIL'
            exporting
              id         = ls_msg-id
              number     = ls_msg-number
              textformat = 'HTM'
            importing
              message    = lv_msg.
          wa_es_data-msg_text = lv_msg.
        else.
          lv_agent = ls_subst-objid.
          lv_bdate = ls_subst-date_begin.
          lv_edate = ls_subst-date_end.
          lv_reason = ls_subst-reason.
          call function 'ZFLM_SUBST_MAIL'
            exporting
              iv_agent  = lv_agent
              iv_bdate  = lv_bdate
              iv_edate  = lv_edate
              iv_reason = lv_reason.
        endif.
        append wa_es_data to <fs_et_data>.
      elseif ls_param1-value = 'AS'.

        if ls_param6-value = 'X'.
          ls_subst-otype = 'US'.
          ls_subst-objid = ls_param2-value.
          ls_subst-date_begin = ls_param3-value.
          ls_subst-date_end = ls_param4-value.
          ls_subst-profile = ls_param5-value.
          ls_subst-active = ls_param6-value.
          ls_subst-reason = ls_param7-value.
          call method /psinds/cl_helper_file=>personnel_setting_options
            exporting
              iv_option       = 'AS'
              is_subst        = ls_subst
            importing  
              ct_msg          = lt_msg
              ev_subst_status = wa_es_data-add_info.
          read table lt_msg into ls_msg with key type = 'E'.
          if sy-subrc = 0.
            clear wa_es_data.
            wa_es_data-msg_id = ls_msg-number.
            wa_es_data-msg_type = 'E'.
            call function 'BAPI_MESSAGE_GETDETAIL'
              exporting
                id         = ls_msg-id
                number     = ls_msg-number
                textformat = 'HTM'
              importing
                message    = lv_msg.
            wa_es_data-msg_text = lv_msg.
          else.
            lv_agent = ls_subst-objid.
            lv_bdate = ls_subst-date_begin.
            lv_edate = ls_subst-date_end.
            lv_reason = ls_subst-reason.
            call function 'ZFLM_SUBST_MAIL'
              exporting
                iv_agent  = lv_agent
                iv_bdate  = lv_bdate
                iv_edate  = lv_edate
                iv_reason = lv_reason.
          endif.
          append wa_es_data to <fs_et_data>.
        else.
          try.
              call method super->/iwbep/if_mgw_appl_srv_runtime~execute_action
                exporting
                  iv_action_name          = iv_action_name
                  it_parameter            = it_parameter
                  io_tech_request_context = io_tech_request_context
                importing
                  er_data                 = er_data.
            catch /iwbep/cx_mgw_busi_exception .
            catch /iwbep/cx_mgw_tech_exception .
          endtry.
        endif.

      else.
        try.
            call method super->/iwbep/if_mgw_appl_srv_runtime~execute_action
              exporting
                iv_action_name          = iv_action_name
                it_parameter            = it_parameter
                io_tech_request_context = io_tech_request_context
              importing
                er_data                 = er_data.
          catch /iwbep/cx_mgw_busi_exception .
          catch /iwbep/cx_mgw_tech_exception .
        endtry.
      endif.
when others.
      try.
          call method super->/iwbep/if_mgw_appl_srv_runtime~execute_action
            exporting
              iv_action_name          = iv_action_name
              it_parameter            = it_parameter
              io_tech_request_context = io_tech_request_context
            importing
              er_data                 = er_data.
        catch /iwbep/cx_mgw_busi_exception .
        catch /iwbep/cx_mgw_tech_exception .
      endtry. 
endcase.
endmethod.

For triggering notification after sending a file-

Follow the same approach as above… Check the condition in the Execute Action method for sending the file and redefine it by adding the Mail Triggering Functionality to the standard code after successful file send.

  • How to handle User Transfer scenario in FLM?

User transfers are common in all Organizations. In such cases the Files held by the Users needs to be transferred to the new User who replaces the current one. The advantage of adding positions instead of users in the workflow is, in case of transfers the current user holding the position only will get the file and not the user who got transferred. But for the Files which have already been held/processed by the transferred user, needs to be moved to the new user.

Every user will have 7 tabs where the files can reside. When the user gets transferred, it is recommended that all the tabs are cleared/handled before the transfer happens. Out of the 7 tabs  Sent items will remain unchanged and Intray files needs to be transferred to the new user. Draft, Substitute, Shared, Cabinet and Tracked are up to the organization’s decision. If the User still wants to process these entries they can go ahead and retain them, if not each item entries have to be handled individually.

    • Draft Items can be set to in process by adding the workflow and sending the file or these files can be closed by a Z Program to close all the files which are in draft of this user.
    • Substitute Items can be removed by deleting the Substitution set for this user.
    • All the Shared Items can be sent back to the user who had shared them
    • All the Cabinet Items can be moved to Intray. Check the condition in Execute Action method for moving the files from cabinet to intray and create a Z Program to handle the mass movement of Cabinet files to Intray for a User.
    • Tracked Items can be untracked by a Z Program to untrack all the files that are tracked by the user. The Table for the tracked files is /PSINDS/A_TRACKR
    • Sent Items remain unchanged
    • Intray files needs to be moved to new user. Below is a sample implementation to handle the mass transfer of Intray files to the new user.

Create a Program with 2 fields, From User and To User. Once they enter these entries and execute, retrieve all the files in Intray from the From User.  This can done with the below code
      DATA : lt_msg TYPE bapiret2_t,
        lt_entity TYPE /psinds/cl_files_srv_mpc=>tt_file_intray_et.

  CALL METHOD /psinds/cl_helper_file=>get_intry_items
    EXPORTING
      iv_type  = 'IN'              “Intray Entries
    IMPORTING
      et_items = lt_entity
      ct_msg   = lt_msg.

“Once you have all the Intray entries, use the below code to move the files to the new user


      data :ls_search type fpmgb_s_search_criteria,
        lt_search type fpmgb_t_search_criteria,
        ls_msg type bapiret2,
        lt_search_files type /psinds/cl_files_srv_mpc=>tt_file_search_et,
        ls_search_files type /psinds/cl_files_srv_mpc=>ts_file_search_et,
        ls_case_attr type bapiproptb,
        lt_case_attr type table of bapiproptb,
        lv_timestmp type tzntstmps,
        lv_str type string,
        lt_msg type bapiret2_t,
        lv_msg type bapiret2-message,
        wa_es_data type /psinds/cl_files_srv_mpc=>ts_fi_response_et ,
        it_es_data like table of wa_es_data,
        return type bapiret2,
        l_flag type xfeld,
        ls_file type /psinds/s_inbox_powl,
        lt_texttab type  table of char_132,
        ls_tline   type tline,
        admin_rsn type ref to /psinds/cl_bl_filenotings_op ,
        lt_tline type tlinetab,
        ls_texttab like line of lt_texttab,
        lv_uname type sy-uname,
        lo_ref_overdue type ref to /psinds/cl_bl_overduelog,
        lo_proute   type ref to /psinds/cl_bl_process_rt ,
        lv_pathid   type srmwfpthid ,
        lv_agent type sy-uname,
        lv_wiid  type sww_wiid,
        ls_bmsg     type bapiret2,
        lt_bmsg type bapiret2_t,
        lv_filetype type scmgcase_type,
        lt_sendto_details type /psinds/cl_bl_process_rt=>tt_sendto_data,
        ls_sendto_details like line of lt_sendto_details,
        l_adminreasstrng type string,
        lv_slen       type i,
        lv_obj        type otype,
        lv_user       type char12,
        l_plvar       type plvar,
        lt_result_tab type tswhactor,
        lt_result_objec type objec_t,
        lt_result_struc type struc_t,
        ls_result_objec  type objec,
        lv_ufname        type sy-uname,
        lt_inbox         type table of  swr_wihdr,
        lt_worklist_attr type table of swr_wiaddattr,
        ls_inbox type swr_wihdr,
        lss_inbox     type /psinds/s_inbox_powl,
        lv_retcode    type sy-subrc,
        lv_type(10)   type c,
        lv_found      type boolean,
        lv_guid       type scmg_case_guid ,
        ls_ainbox     type /psinds/s_inbox_powl,
        ls_param4 type /iwbep/s_mgw_name_value_pair,
        ls_file_intray type /psinds/cl_files_srv_mpc=>ts_file_intray_et
  .
data : lv_date(16) type c ,
        lv_time(5) type c.
  field-symbols : <fs_et_data> type standard table,
                  <fs_sr_data> type standard table,
                  <fs_dc_data> type standard table.
  data : begin of wa_wfpthid ,
           case_guid type scmg_t_case-case_guid ,
           wfpthid   type scmg_t_case-wfpthid ,
         end of wa_wfpthid ,
         it_wfpthid like table of wa_wfpthid with key case_guid.

  data : begin of wa_agent_wiid ,
           pathid     type srmwfpthps-pathid ,
           agent      type srmwfpthps-agent  ,
           posid_wiid type srmwfpthps-posid_wiid ,
           activity   type srmwfpthps-activity   ,
         end of wa_agent_wiid ,
         it_agent_wiid like table of wa_agent_wiid with key pathid .

  if it_items[] is not initial.
    select case_guid wfpthid
      into table it_wfpthid
      from scmg_t_case
      for all entries in it_items
      where case_guid = it_items-case_guid.
    if sy-subrc = 0.
      select  pathid agent posid_wiid activity
        into table it_agent_wiid
        from srmwfpthps
        for all entries in it_wfpthid
        where actarea = 'SCMG'
        and   pathid  =  it_wfpthid-wfpthid
        and   pospast = 'I'
        and   delflag = '' .
    endif.
  endif.

  lv_ufname = s_pernr1.                     “s_pernr1 is the From User
  loop at it_items into wa_items.
    clear : ls_file_intray ,  lv_msg , lt_inbox , wa_items_i , lt_sendto_details .
    ls_file_intray-case_guid = wa_items-case_guid .

    if ls_param4-value is initial.
      ls_param4-value = '00000000'.
    endif.
    ls_file_intray-latest_end_date = '00000000'.

    ls_file_intray-substitutefor = p_to_user_posid.       “p_to_user_posid is the position id of the To User. This position id would be inserted in the workflow    
    concatenate sy-datum+6(2) '.' sy-datum+4(2) '.' sy-datum+0(4) into lv_date.
    concatenate sy-uzeit+0(2) ':' sy-uzeit+2(2) into lv_time.
    concatenate lv_date lv_time into lv_date separated by space.
    concatenate  'This file is transferred by administrator('sy-uname') through mass transfer on '
       lv_date into ls_file_intray-subst_rsn separated by space.
    clear wa_wfpthid.
    read table it_wfpthid into wa_wfpthid
      with table key  case_guid = ls_file_intray-case_guid.

    read table it_agent_wiid into wa_agent_wiid
      with table key pathid = wa_wfpthid-wfpthid.
    if sy-subrc = 0.
      read table it_items_i into wa_items_i
        with table key case_guid = wa_items-case_guid.
      if wa_items_i is not initial.
        ls_file_intray-actdc = wa_agent_wiid-activity.

      endif.
    else.
      ls_msg-id = '/PSINDS/FLM'.
      ls_msg-number = 239.
      ls_search_files-msgtype = 'E'.

*          CLEAR lt_search_files.
      ls_search_files-msgid = ls_msg-number.
      ls_search_files-msgtype = 'E'.

      call function 'BAPI_MESSAGE_GETDETAIL'
        exporting
          id         = ls_msg-id
          number     = ls_msg-number
          textformat = 'HTM'
        importing
          message    = lv_msg.


      ls_search_files-msgtext = lv_msg.
      append ls_search_files to lt_search_files.

      if lv_msg is not initial.
        wa_files-remarks = lv_msg.
        modify it_files from wa_files transporting remarks
          where case_guid = wa_items-case_guid.
        clear lv_msg.
        continue.
      endif.
    endif.
    create object lo_proute
      exporting
        iv_pathid          = wa_wfpthid-wfpthid "  lv_pathid
      exceptions
        ex_pathid_notfound = 1.

    read table it_agent_wiid into wa_agent_wiid
      with table key pathid = wa_wfpthid-wfpthid .

    if sy-subrc = 0.
*        lv_agent = ls_position-agent.
      lv_slen = strlen( wa_agent_wiid-agent ).
      lv_slen = lv_slen - 2.
      lv_obj  = wa_agent_wiid-agent+0(2).
      lv_user = wa_agent_wiid-agent+2(lv_slen).
      call function 'CONVERSION_EXIT_ALPHA_OUTPUT'
        exporting
          input  = lv_user
        importing
          output = lv_user.

      lv_wiid = wa_agent_wiid-posid_wiid.
*     
        if lv_msg is not initial.
          wa_files-remarks = lv_msg.
          modify it_files from wa_files transporting remarks
            where case_guid = wa_items-case_guid.
          clear lv_msg.
          continue.
        endif.
        "Write the reason for the approval in the notes and also capture the overdue log
        l_flag = /psinds/cl_bl_overduelog=>get_logging_state( ).
        if l_flag is not initial.
          create object lo_ref_overdue
            exporting
              iv_user      = lv_uname
              iv_logenable = l_flag.
          if ls_file-wi_id is not initial.
            call method lo_ref_overdue->check_log_wi_overdue_data
              exporting
                iv_wiid = lv_wiid.
          endif.
        endif.
        l_adminreasstrng = ls_file_intray-subst_rsn.
        clear lt_texttab.
        call method cl_swf_utl_convert_xstring=>xstring_to_table
          exporting
            i_stream      = l_adminreasstrng
          importing
            e_table       = lt_texttab
          exceptions
            invalid_input = 1
            invalid_table = 2
            others        = 3.
        if sy-subrc <> 0.
          ls_msg-id = '/PSINDS/FLM'.
          ls_msg-number = 344.
          ls_search_files-msgtype = 'E'.

*          CLEAR lt_search_files.
          ls_search_files-msgid = ls_msg-number.
          ls_search_files-msgtype = 'E'.
          call function 'BAPI_MESSAGE_GETDETAIL'
            exporting
              id         = ls_msg-id
              number     = ls_msg-number
              textformat = 'HTM'
            importing
              message    = lv_msg.

          message lv_msg type ls_search_files-msgtype.

          ls_search_files-msgtext = lv_msg.
          append ls_search_files to lt_search_files.
        endif.
        if lv_msg is not initial.
          wa_files-remarks = lv_msg.
          modify it_files from wa_files transporting remarks
            where case_guid = wa_items-case_guid.
          clear lv_msg.
          continue.
        endif.
        lv_guid = wa_items-case_guid.
        clear lt_tline[].
        loop at lt_texttab into ls_texttab.
          ls_tline-tdformat = '*'.
          ls_tline-tdline = ls_texttab.
          append ls_tline to lt_tline.
        endloop.
        create object admin_rsn
          exporting
            asst_flag       = ' '
            im_case_guid    = wa_items-case_guid "  lv_guid
          exceptions
            open_file_error = 1
            open_note_error = 2
            others          = 3.
        if sy-subrc <> 0.
          ls_msg-id = '/PSINDS/FLM'.
          ls_msg-number = 352.
          ls_search_files-msgtype = 'E'.

          ls_search_files-msgid = ls_msg-number.
          ls_search_files-msgtype = 'E'.
          call function 'BAPI_MESSAGE_GETDETAIL'
            exporting
              id         = ls_msg-id
              number     = ls_msg-number
              textformat = 'HTM'
            importing
              message    = lv_msg.

          message lv_msg type ls_search_files-msgtype.
          ls_search_files-msgtext = lv_msg.
          append ls_search_files to lt_search_files.

        endif.
        if lv_msg is not initial.
          wa_files-remarks = lv_msg.
          modify it_files from wa_files transporting remarks
            where case_guid = wa_items-case_guid.
          clear lv_msg.
          continue.
        endif.

        call method admin_rsn->/psinds/if_bl_ofcr_op~save
          exporting
            im_case_guid = lv_guid
            im_text_id   = '0006'
            im_text_tab  = lt_tline
            im_wfid      = lv_wiid.
*          changing
*             ct_msg                 = ct_msg.

        concatenate 'S' ls_file_intray-substitutefor into
          ls_sendto_details-agent separated by space.

        ls_sendto_details-activity = wa_agent_wiid-activity. " ls_file_intray-actdc. SFSDFSDF
        if ls_file_intray-latest_end_date is initial.
          ls_file_intray-latest_end_date = '00000000'.
        endif.
        ls_sendto_details-posid_led = ls_file_intray-latest_end_date.
        ls_sendto_details-duedays = ls_file_intray-duedate.

        append ls_sendto_details to lt_sendto_details.
        call method lo_proute->send_to_wrapper
          exporting
            iv_wi_id          = lv_wiid    " Work item ID
            it_sendto_data    = lt_sendto_details    " Structure for Creating Process Route Items
            iv_flag_on_compwi = 'X'     " Boolean Variable (X=True, -=False, Space=Unknown)
          changing
            ct_msg            = lt_bmsg.

        loop at lt_bmsg into ls_bmsg where type = 'E'.

          ls_msg-id = ls_bmsg-id .
          ls_msg-number = ls_bmsg-number.
          ls_search_files-msgtype = ls_bmsg-type.
          call function 'BAPI_MESSAGE_GETDETAIL'
            exporting
              id         = ls_msg-id
              number     = ls_msg-number
              textformat = 'HTM'
            importing
              message    = lv_msg.

          message lv_msg type ls_search_files-msgtype.
          ls_search_files-msgtext = lv_msg.
          append ls_search_files to lt_search_files.
          exit.

        endloop.
        if lv_msg is not initial.
          wa_files-remarks = lv_msg.
          modify it_files from wa_files transporting remarks
            where case_guid = wa_items-case_guid.
          clear lv_msg.
          continue.
        endif.

        ls_ainbox-case_guid = lv_guid.
        call method /psinds/cl_bl_ofcr_file_op=>delete_from_sst_inbox
          exporting
            iv_username  = lv_ufname    " Created by
            is_inbox     = ls_ainbox    " DS:Structure for In Tray
            iv_filetype  = lv_filetype    " Case Type
            iv_case_guid = lv_guid    " Technical Case Key (Case GUID)
            iv_search    = 'X'
          changing
            cs_msg       = ls_bmsg.
        if ls_msg is not initial.
*          append ls_bmsg to ct_msg.
          ls_msg-id = ls_bmsg-id .
          ls_msg-number = ls_bmsg-number.
          ls_search_files-msgtype = ls_bmsg-type.
          call function 'BAPI_MESSAGE_GETDETAIL'
            exporting
              id         = ls_msg-id
              number     = ls_msg-number
              textformat = 'HTM'
            importing
              message    = lv_msg.

          message lv_msg type ls_search_files-msgtype.
          ls_search_files-msgtext = lv_msg.
          append ls_search_files to lt_search_files.

        endif.
        if lv_msg is not initial.
          wa_files-remarks = lv_msg.
          modify it_files from wa_files transporting remarks
            where case_guid = wa_items-case_guid.
          clear lv_msg.
          continue.
        endif.
        call method /psinds/cl_bl_ofcr_file_op=>delete_attach_file
          exporting
            iv_cfile    = lv_guid   " Technical Case Key (Case GUID)
*           iv_afile    =     " Technical Case Key (Case GUID)
            iv_wfid     = lv_wiid     " Work item ID
            iv_isdelete = ''   " Single-Character Flag
          importing
            es_msg      = ls_bmsg.     " Return Parameter
        if ls_bmsg-type = 'E'.
*          append ls_bmsg to ct_msg.
          ls_msg-id = ls_bmsg-id .
          ls_msg-number = ls_bmsg-number.
          ls_search_files-msgtype = ls_bmsg-type.

          call function 'BAPI_MESSAGE_GETDETAIL'
            exporting
              id         = ls_msg-id
              number     = ls_msg-number
              textformat = 'HTM'
            importing
              message    = lv_msg.
*

          if lv_msg is not initial.
            wa_files-remarks = lv_msg.
            modify it_files from wa_files transporting remarks
              where case_guid = wa_items-case_guid.
            clear lv_msg.
            continue.
          endif.
        endif.
        if lt_search_files is initial.
          ls_case_attr-name = 'CHANGED_BY'.
          ls_case_attr-value = lv_uname.
          append ls_case_attr to lt_case_attr.
          ls_case_attr-name = 'CHANGE_TIME'.
          clear lv_str.
          concatenate sy-datum sy-uzeit into lv_str.
          lv_timestmp = lv_str.
          ls_case_attr-value = lv_timestmp.
          append ls_case_attr to lt_case_attr.
          call function 'BAPI_CASE_CHANGEATTRIBUTES'
            exporting
              guid            = lv_guid
            importing
              return          = return
            tables
              case_attributes = lt_case_attr.
        endif.

        read table lt_msg into ls_msg with key type = 'E'.
        if sy-subrc = 0.
          wa_es_data-msg_id = ls_msg-number.
          wa_es_data-msg_type = 'E'.
          call function 'BAPI_MESSAGE_GETDETAIL'
            exporting
              id         = ls_msg-id
              number     = ls_msg-number
              textformat = 'HTM'
            importing
              message    = lv_msg.
          wa_es_data-msg_text = lv_msg.


          if lv_msg is not initial.
            wa_files-remarks = lv_msg.
            modify it_files from wa_files transporting remarks
              where case_guid = wa_items-case_guid.
            clear lv_msg.
            continue.
          endif.
        else.
          wa_es_data-msg_id = 107.
          wa_es_data-msg_type = 'S'.
          call function 'BAPI_MESSAGE_GETDETAIL'
            exporting
              id         = '/PSINDS/FLM'
              number     = 107
              textformat = 'HTM'
            importing
              message    = lv_msg.
          message lv_msg type wa_es_data-msg_type.
          wa_es_data-msg_text = lv_msg.
          append wa_es_data to it_es_data.
          if lv_msg is not initial.
            wa_files-remarks = lv_msg.
            modify it_files from wa_files transporting remarks
              where case_guid = wa_items-case_guid.
            clear lv_msg.
            continue.
          endif.
        endif.

    endif.
  endloop.   

             

                       

  • How to restrict access to FLM entries from SBWP?

All the FLM entries can be accessed through SBWP, therefore it is very much necessary to restrict this access. This can be done by implementing a BADI.  Below are the details of implementing it

WF_BWP_SELECT_FILTER - BAdI Definition Name
IF_EX_WF_BWP_SELECT_FILTER~APPLY_FILTER – Method

Sample code: In this method all the tasks that are linked to FLM needs to be hardcoded and sent to the Exporting parameter

data: lr_task type range of sww_task.
  data: ls_task like line of lr_task.
  data: lt_worklist type swrtwihdr.
  data: lt_worklist_random type swrtwihdr.
  data: lt_task type standard table of sww_task.
  data: l_task type sww_task.
  data: l_task1 type sww_task.
  data: l_count type sytabix.
  data: l_max_ready type sytabix.
  data: l_min_threshold type sytabix.
  data: l_lines type sytabix.
  data: l_seed type i.
  data: lh_excp type ref to cx_abap_random.                 "#EC NEEDED
  data: lh_random type ref to cl_abap_random_int.
  data: l_max type i.
  data: l_index type sytabix.
  field-symbols: <swr_wihdr> type swr_wihdr.

  l_max_ready = 5.
  l_min_threshold = l_max_ready.
  l_task = 'TS78907914'.
  l_task1 = 'TS78907915'.

  if l_max_ready is initial or l_min_threshold is initial or l_task is initial or l_task1 is initial.
    re_worklist = im_worklist.
  else.
    append l_task to lt_task.
    append l_task1 to lt_task.
    clear l_task.
    clear l_task1.
*- get all entries which are not involved and move this entries
*- to the export worklist
    clear lr_task.
    ls_task-sign = 'I'.
    ls_task-option = 'EQ'.
    loop at lt_task into l_task.
      ls_task-low = l_task.
      append ls_task to lr_task.
    endloop.
    lt_worklist = im_worklist.
    delete lt_worklist where wi_rh_task in lr_task.
    re_worklist = lt_worklist.  endif.

  • How to Hide unwanted buttons on the File screen?

The Visibility of all the buttons on the File Screen have been handle through the Service. So based on the customer need, specific buttons visibility can be hidden.
For this, redefine the method FILE_BUTTONS_ES_GET_ENTITY in the Z Service and clear entry for the buttons which are not necessary in the exporting parameter ER_ENTITY.

  • How to handle authorization while searching the file?

Authorizations for accessing files from search can be controlled through a BADI.
/PSINDS/BADI_FILESEND - BAdI Definition Name
               /PSINDS/IF_FILESEND~ SEARCH_FILE_AUTHORIZATION– Method
               This method accepts File details and returns a return code for specifying the authorization to access the file.

  • How to perform checks before sending the file?

Any checks/validations before sending the File can be done using a BADI.
/PSINDS/BADI_FILESEND - BAdI Definition Name
               /PSINDS/IF_FILESEND~ FILESEND_VERIFICATION– Method
               This method accepts File details and returns a return code for sending the file.

  • How to change the print layout?

In print, there are 2 options i.e. Coverpage and Noting print.

Layout of the Cover page is read from customizing which can be defined by the customer.  The customizing for print layout can be found under SAP Netweaver-> Application Server->SAP File Lifecycle Management->Basic Setting-> Print Settings

Noting print layout Can be changed through a BADI.

         /PSINDS/BADI_FILESEND- BAdI Definition Name

          /PSINDS/IF_FILESEND~ GET_HTML_PRINT_DATA– Method

         This method accepts File details and returns an HTML content of the Noting.

  • How to perform Attribute value validation?

Any validation on the data entered by the user in the File Attributes can be validated using a BADI.

/PSINDS/BADI_FILESEND - BAdI Definition Name
/PSINDS/IF_FILESEND~ ATTRIBUTE_VALUE_VERIFICATION– Method
This method accepts Attribute details and returns an Error if required.

  • How to perform File number validation?

Any validation on the data entered by the user in the File Number can be validated using a BADI.

/PSINDS/BADI_FILESEND - BAdI Definition Name
/PSINDS/IF_FILESEND~ FILE_NUMBER_VALIDATION– Method
This method accepts File Number details and returns an Error if required. How to enable parallel scenario?

Only specific users can be given authorizations to modify the workflow of a file.  A BADI needs to be implemented for the same.

/PSINDS/BADI_FILESEND - BAdI Definition Name
/PSINDS/IF_FILESEND~ IS_SUPER_USESR – Method
  This method accepts the File Details and returns the parameter CV_PARALLEL which needs to   be set for enabling parallel workflow

  • How to provide authorization to change the workflow?

Only specific users can be given authorizations to modify the workflow of a file.  A BADI needs to be implemented for the same.

/PSINDS/BADI_FILESEND- BAdI Definition Name
               /PSINDS/IF_FILESEND~ IS_SUPER_USESR– Method
This method accepts the File Details and returns the parameter CV_ISSUPER_USER which needs to be set for providing authorization to change workflow

  • How to add a photo against the noting and workflow detail?

Photo of the users processing the File can be shown against their note and in the workflow. A BADI needs to be implemented for the same.

/PSINDS/BADI_AGENTPHOTO - BAdI Definition Name
/PSINDS/IF_GETPHOTO~GET_PHOTO– Method
This method accepts the Agent Name and returns the URL of the photo

Extensibility

  • What are the features customers can extend in FLM?
    Following features can be extended in FLM
    • Change the layout of Display File view on initial load of application
    • Change the layout of Create File view on initial load of application
    • Add and remove criteria for Search File
    • Add and remove criteria for Search Documents
    • Add and hide fields in different tabs of initial Intray view
    • Add new actions in footer of Intray, Display and Create views
    • Add Digital Signature and other functionality while Sending File
    • Change the header of Note information and add new action at Note footer

  • How to add more actions in footer different views?
    Following extension points are provided to add new actions in footer:
    • extIntrayFooterActions : to add new actions in Intray view
    • extFileFooterActions: to add new actions in Display File view
    • extDraftFooterActions: to add new actions in Create File view
    • extDaakFooterActions: to add new actions in Daak view

  • How to change the layout of views on initial load of application?
    Following UI controller hooks has been provided to modify the layout on initial load, check the “controller.js” files for corresponding views to find these hooks:
    • customInitializeData : Intray view
    • customInitializeData: Display File view
    • customInitializeData: Create File view
    • customInitializeData: Search File

  • What are the Extension Points and UI controller Hooks provided in FLM

          For information about the extension points, click here.

ERP Integration

  • Is it possible to integrate FLM Files with ERP/HR Entities?

In FLM, there is a framework where any Standard SAP Object or a Custom Z Object from an SAP system can be linked to Files. For e.g. in Purchase Scenarios, Purchase Orders or RFQ’s may be required to attach to a File, similarly for Personnel Files  HR related objects such as Personnel Records may be attached. This can be achieved through a bit of customizing and Z development for each individual object that needs to be linked to a File.

Digital Signature

  • Is it possible to Digitally Sign content in FLM application?
    Yes, a controller hook “customDigitalSignData” has been provided to enhance FLM for digital signature.

  • How to develop digital signature functionality in FLM?
    Digital signature enables the user to Sign the content along with time-stamp. It depends on the customer to whether to use this functionality or not. If implemented, the user will be asked to sign the content while sending the file.
    Steps to implement digital signature:
    • Include the “component.js” and digital signature (.jar) file in the extended application
    • Invoke the digital signature file during initial load of application
    • Include the “component.js” file in the “controller.js” file of the view where digital signature is being used.
    • Implement the controller hook function (customDigitalSignData) to implement the functionality which will be called while Sending the file
    • Call the function from “component.js” file to Sign the required content return the “sendCallBack” flag to check success or failure of Signing content
      For more information, refer to the Implementation Guide for Digital Signature.

  • Do you have any example of implementation of Digital Signature

For more information, see the Administration Guide for Digital Signature.

No comments