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
592

newly updated ! newly updated ! newly updated !newly updated !newly updated !

Hierarchy input Parameter f4 selection user customized solution searched
===========================================================
Summary:
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 Hierarchy Tree:
+-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-1730903050530.png

 

Current Query Design:

Martin_4_1-1730903050532.png

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

Current– Customer Exit F4 Input Variable Design:

Martin_4_2-1730903050534.png

 

Current F4 Customers Exit Parameter Result:

 

Martin_4_3-1730903050540.png
Sample Desired Result:
A User with  these Values  Country = DE, Region=BER, Company Codes 5070, 5150, 5160 should result in this F4:

Martin_4_4-1730903050544.png
Suggested Solution With Badi RSR_VARIABLE_F4_RESTRICT

Filtervalues:

Martin_4_5-1730903050547.png

Using Class Method IF_RSR_VARIABLE_F4_RESTRICT~GET_RESTRICTION_NODE

With a Custome Class with the Method  IF_RSR_VARIABLE_F4_RESTRICT~GET_RESTRICTION_NODE

???????Right Method ???????
???????But how to fill the Structures  properly ??????
???????This wont do it

method IF_RSR_VARIABLE_F4_RESTRICT~GET_RESTRICTION_NODE.

DATA: l_s_node LIKE LINE OF c_t_node,
      l_s_hier LIKE LINE OF c_t_hierarchy.
*
#CASE i_vnam.
**
 WHEN 'ZCOMPCODE_HIERNODE_CUST_MULTI'.

 

* ZMO_COMPANY_HIERARCHIE_SAC is the flat view containing the
* Assigments Country Region – BUKR and via an Autorization CDS
* the right BUKrs
* GROUP By is only used to have only 1 BUKRS in the SELECT result set.
    SELECT     BUKRS
    FROM       ZMO_COMPANY_HIERARCHIE_SAC
    GROUP BY   BUKRS
    INTO @DATA(BUKRS).


       clear l_s_node.
       l_s_node-niobjnm  = 'ZMO_CCODE'. l_s_node-nodename = BUKRS.

       APPEND l_s_node  TO c_t_node.

    ENDSELECT.

    SELECT     country
    FROM       ZMO_COMPANY_HIERARCHIE_SAC
    GROUP BY   country
    INTO @DATA(country).
       clear l_s_node.
       l_s_node-niobjnm  = 'ZMO_CNTRY'.
       l_s_node-nodename = country.

       APPEND l_s_node  TO c_t_node.

    ENDSELECT.

    SELECT     region
    FROM       ZMO_COMPANY_HIERARCHIE_SAC
    GROUP BY   region
    INTO @DATA(region).
       clear l_s_node.
       l_s_node-niobjnm  = 'ZMO_REGIO'.
       l_s_node-nodename = region.
       APPEND l_s_node  TO c_t_node.



ENDCASE.

endmethod.

5 Comments
Labels in this area