Skip to Content
avatar image
Former Member

search on customer

Dear Frinds

i have requirement that each SAP user should see his customer which assign to his related company only when he search on customer on any SAP screen .

In another way when open any customer search on the system we need to limit the search list based on the user company code wich assign in the user parameter and display only customer which assigned to the same company code .

is there is away to handle in standard way and if custom ABAP how to fix .

your replays will be appreciated

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Jan 03, 2017 at 09:49 PM

    But why? What horrible things would happen if a user sees the customer number and name (because that's as far as they would get without authorization) for another company? Also - on any SAP screen? What about sales screens that use sales area instead of the company code? Or any custom programs that might have custom search helps?

    I'm afraid this is just another one of those paranoid requirements that cause more harm than good. What you are asking already exists in SAP, essentially, as a convenience for the users. For example, if I use the Sold-to dropdown in VA01 then there is "Customers per sales group" tab where Sales Org is already populated with the appropriate value. And the dropdown opens on this tab next time I use it.

    Same thing in XD03 - on the tab "Customers by company code" the company code already pre-filled from the profile. The users would really have to go out of their way to see something else. If they have nothing better to do with their time then it's a different problem.

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 03, 2017 at 08:03 AM

    AFAIK no such filter rule exist (?) For this kind of requirement I use implicit enhancement options in the standard search help to add my own BAdI:

    Program     Enhancement Implementation Type   Enhancement Implementation Point/Section
    SAPLSDSD Dynamic Enhancement Point/Section \PR:SAPLSDSD\FO:GET_VALUES_SH\SE:END\EI 
    SAPLSDSD Static Enhancement Point/Section  \PR:SAPLSDSD\FO:GET_VALUES_FV\SE:BEGIN\EI 
    SAPLSDSD Dynamic Enhancement Point/Section \PR:SAPLSDSD\FO:GET_VALUES_FV\SE:END\EI 
    

    e.g.

    Logical Position:    \PR:SAPLSDSD\FO:GET_VALUES_FV\SE:END\EI
    * Filter data on F4
      data: lo_handle type ref to zdfs_fv_hide,
            lv_domname type domname.
    lv_domname = shlp-shlpname.
    GET BADI lo_handle
      FILTERS
        domname = lv_domname.
    CALL BADI lo_handle->change_value_tab
      EXPORTING
        shlp      = shlp
      CHANGING
        value_tab = record_tab[].
    IF lv_maxrows <> 0.
      ADD 1 TO lv_maxrows.
      DELETE record_tab FROM lv_maxrows.
    ENDIF.
    

    There I can add any implementation with filter on search-help or domain, and remove some unwanted/unauthorized records depending on context.

    Regards,
    Raymond

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 03, 2017 at 08:14 AM

    And how do you make sure that no duplicate customers get created if a user can only see the customers that are created for his own company code? And there might also be customers (ship-to ) which do not have a company code at all.

    Add comment
    10|10000 characters needed characters exceeded