Skip to Content

Plant wise F4 Help restriction for end users in SAP S4/Hana

Dear Experts,

Our team faces a following issue, we have three plants in the company code 1001,1002 and 1003. So when a user from 1001 plant presses F4 help option anywhere in their SAP S4Hana,then it must display values corresponding only to their plant. For instance 1001 user must be able to view only their 1001 plant details like materials,production orders etc F4 help.

Client is very specific about this issue.

Kindly help me, thanks in advance.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Dec 07, 2017 at 08:30 AM

    For such requirement (filters on search help) I created once an Enhancement Implementation in function group SDSD which manages such search helps. I put my code at explicit ehnancement points at start (save maxrecords) and end (remove some records) of forms GET_VALUES_SH and GET_FALUES_FV (for search help and domain values) there I called my own BAdIs (*) with filter on search help or domain name. Then me and other Abaper can implement our own filters on most search helps implemeting those BAdI, using, for example, some authority-check or any depending filter.

    For sample: end of GET_VALUES_FV

    enhancement 3  z_sh_hide.    "active version
    * allow specific implentation of filter on search-help
      data: lo_handle type ref to z_fv_hide, " Ehn Spot defined with SE18
            lv_domname type domname.
    * Map search help name to domain name
    lv_domname = shlp-shlpname. 
    * Look for BAdI implementation and call it
    get badi lo_handle
        domname = lv_domname.
    call badi lo_handle->change_value_tab
        shlp      = shlp
        value_tab = record_tab[].
    * apply max records
    if lv_maxrows <> 0.
      add 1 to lv_maxrows.
      delete record_tab from lv_maxrows.

    As can be seen the method CHANGE_VALUE_TAB has a SHLP (SHP_DESCR_T) importing and a VALUE_TAB (DDSHRESLTS) changing parameters.

    Add comment
    10|10000 characters needed characters exceeded

    • The first implementation which 'create' the BAdI is done only once. Then created some implementation of the z-BAdI with filter values resulting in some sets of search-helps.

      You could remove the filter in get badi and create the z-BAdI without filter, so ever implementation will be called. Or you could even filter immediately the data without using any z-BAdI, all your code will be in one point, and less maintanable?