on 07-02-2015 10:44 AM
Hi Gurus,
Scenario:
Cost center- User selection
Based on this should dynamically select hierarchy for cost element.(there are multiple hierarchies maintained for cost element)
Also cost center to hierarchy is one to one, the relationship is maintained in DSo- 'ZXXXXX'
Eg: CostCenter1 Hierarchy1
Costcenter2 Hierarchy2
Costcenter3 Hierarchy1
Costcenter4 Hierarchy3
So during query run time, when user key in 'costcenter1' the query should pick up 'hierarchy1' and diplay.
Is it possible? how to achieve this?
Thanks in advance.
Hi Gurus,
Let me try it and then could brief on the outcome.
thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Amala,
Do you have any other attributes for each hierarchies? like version 100 for Hierarchy1 and 200 for Hierarchy2...if possible use the version attribute. Then by hierarchy node variables OR version you can fetch hierarchies easily.
Explore on this, if not Gajesh Nageshalready mentioned to write a customer exit to fetch the right hierarchy.
Thanks,
Umashankar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Create a customer Exit hierarchy variable VAR2 (NOT a hierarchy node variable)´. You do this in the hierarchy tab of the char.
Then write the user exit coding to read the variable value selected for the CC (VAR1), get the corresponding hierarchy from your lookup DSO, and parse that hierarchy value to your hierarchy variable VAR2
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Fr,
This is the code i used.
DATA :
L_S_RANGE TYPE RSR_S_RANGESID,
ls_varrange TYPE RRRANGEEXIT.
CASE I_VNAM.
WHEN 'ZXXXXX'. <hierarchy variable of cost element>
IF i_step = 2.
READ TABLE i_t_var_range INTO ls_varrange WITH KEY vnam = '(cost center variable- user entry').
CLEAR L_S_RANGE.
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
l_s_range-high = '0HIER_NODE'.<Info object name>
l_s_range-low = '1'.<node id>
APPEND l_s_range TO e_t_range.
ENDIF.
ENDCASE.
But when i try to open the query in BEX analyser, it throws error saying 'Variable has too many values'.
Based on cost center (user entry) should display related cost element hierarchy, also there are multiple hierarchies maintained for cost element.
Also i am not sure about the code also.
I don't have any experience with coding such a scenario, so i can't give you a solution, but when looking at your code i see a couple of things:
Dear Amala,
Try using a customer exit variable for where in you can get the variable value of cost center and pass this value to get the hierarchy node for cost element
Regards
Gajesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gajesh,
I am not an expert in abap.
This is the code i used.
DATA :
L_S_RANGE TYPE RSR_S_RANGESID,
ls_varrange TYPE RRRANGEEXIT.
CASE I_VNAM.
WHEN 'ZXXXXX'. <hierarchy variable of cost element>
IF i_step = 2.
READ TABLE i_t_var_range INTO ls_varrange WITH KEY vnam = '(cost center variable- user entry').
CLEAR L_S_RANGE.
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
l_s_range-high = '0HIER_NODE'.<Info object name>
l_s_range-low = '1'.<node id>
APPEND l_s_range TO e_t_range.
ENDIF.
ENDCASE.
But when i try to open the query in BEX analyser, it throws error saying 'Variable has too many values'.
Based on cost center (user entry) should display related cost element hierarchy, also there are multiple hierarchies maintained for cost element.
Also i am not sure about the code also.
need your help
User | Count |
---|---|
89 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.