Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Martin_4
Participant
0 Kudos
366

Desired result is, that a SAP User with defined access rights can see and choose in the  query input only those hierachie trees and leaves which he is authorized for.

The authorization rights  for each single SAP User are available in a flat view consisting of  (SAP User- Country -Region -- Company Code).

Current design Hierachy Tree:

A Hierachy Tree of 0HIER_NODE (Root=Betriebe Gesamt =  All Plants), ZMO_CNTRY (Country Node = DE, AT), ZMO REGION (Region Node: BER, FRO), ZMO_CCODE (Company Code Leave=5070, 8000):

Martin_4_0-1730387442314.png

Current design - Query input:
The current input parameter allows the user to chose among any Country, Regions, Company Codes, if he is authorized or no. If the SAP User is not authorized, this results in a Autorization Access error, which is not desires.

Martin_4_1-1730387442316.png

Current design - Query result:
This visualizes the  AfO result for a SAP User which is authorized for all countries, regions, company codes:

Martin_4_10-1730387574404.png

Current design – Query line:This is the design of the filter in the query, which brings the hierachy

Martin_4_2-1730387442317.png

Current design – above Query filter for multi entry selection:

Martin_4_3-1730387442318.png

Hierachy node, Mulit entry, input ready  variable of the filter which allows the multibed entry

Martin_4_4-1730387442319.png

Current design – Authorization filter:

Authorization Variable which limits the user only to the authorized Country Region Company code

Martin_4_5-1730387442319.png

Martin_4_6-1730387442320.png
The Analysis authorization object  ZMO_CODE  is defined and this pulls out  via an Badi Exit  $ZMO_VAR_COMPCODE02 dynamically, user dependant  the relevant Company code authorizations, what brings if violated, if he requests in the tree Countries, regions or company codes he*s not assigned to the AfO the “…not authorized message…”

Further more ZMO_CNTRY , ZMO REGION  (and ZMO_CCODE)  is authorization relevant and have the same methods, antries in the authorization objects and variables like  $ZMO_VAR_COMPCODE02 applied

Martin_4_7-1730387442322.png

----->>>>>
What now the mult millon $ design to have in the AfO Input Parameters only the tree compontents a user is authorized for ?
<<<<---------------
For example a user is just Autorized for Country = DE, Region=BER, Company Codes 5070, 5150, 5160 this result:

Martin_4_8-1730387442322.png
…and not this:

Martin_4_9-1730387442324.png

What are the customization to be used to have in an input Parameter a customized list, according to authorizations ?

Thank You !

Best Martin

 

4 Comments
nachtaktiv
Participant
0 Kudos

Did you check the possibilities of the BAdI RSR_VARIABLE_F4_RESTRICT
to filter the F4-help to individual values ?

Martin_4
Participant
0 Kudos

Cant plug this together.
SAP F4 Badi Help is not to helpfull, better fractional  at all.

You have a sample ?
What Variable,  needs what type of exit ?

This is more magical work with much guessing, try and error than computer sience.

I set up a Badi, guessed that ~GET_RESTRICTION_FLAT could do it,
and an exit but in RSRT debug  the query even does not go to the BREAK-POINT, why so ever:

method IF_RSR_VARIABLE_F4_RESTRICT~GET_RESTRICTION_FLAT.

DATAls_range LIKE LINE of c_t_range,
lt_values_ZMO_REGIO TYPE /BIC/OIZMO_REGIO,
lt_values_ZMO_CNTRY TYPE /BIC/OIZMO_CNTRY.

BREAK-POINT.

CASE i_vnam.

  WHEN 'ZMO_VAR_COMPCODE07_NODE_RESTR'.

    SELECT     country
* CDS joined to an Authorization CDS containing the Fieldvalues needed:
    FROM       ZMO_COMPANY_HIERARCHIE_SAC
    GROUP BY   country
    INTO @DATA(CNTRY).

    CLEAR ls_range.
    ls_range-iobjnm 'ZMO_CNTRY'.
    ls_range-sign   'I'.
    ls_range-option 'EQ'.
    ls_range-low    CNTRY.
    APPEND ls_range  TO c_t_range.

    ENDSELECT.

ENDCASE.

 

andrea_previati
Contributor
0 Kudos

Hi

the topic regarding auth on F4 seems to be an eternal return of the same for every BW project

regarding rsr-variable-f4-restrict-badi you can check this detailed how to: 

https://community.sap.com/t5/technology-blogs-by-members/rsr-variable-f4-restrict-badi-with-compound...

the main criticality in that scenario is to maintain a DSO  ( usually loaded by CSv) with the Country, Region, Company,  authorizations for each user. These data will be retreived by the badi methods and displayed in the F4

Hope it helps

Andreas

 

 

 

andrea_previati
Contributor
Labels in this area