on 2015 Sep 23 10:56 AM
Hello Everybody,
I need your help:
I need to filter in a DTP on several Hierarchy nodes.
I have tried to do it with an OLAP Variable but it did not work.
FIRST QUESTION:
is it possible to do that with an OLAP variable? how should I set up the variable?
Since I am not a programmer, can you help me with the code - if I have to create a customer Exit variable?
SECOND QUESTION
if I can not create an OLAP VAR - shall I do it directly in the DTP? is it possible?
Can you provide me with the code pls? I need to filter on different ( 10 ) nodes of the Hierachy - I have googled it but not found any clear response
I really appreciate your help
many thanks
Manu
Request clarification before answering.
Hi Manu,
I suggest to write a routine inside the DTP filter. You can flatten the hierarchy using Function Module RSNDI_SHIE_STRUCTURE_GET3. Table e_t_nodenames is relevant to observe. If you discard all records with InfoObject 0HIER_NODE (and any compounding InfoObjects if applicable), then you will end up with the respective leaves. This can be input for composing the DTP filter.
I advise you to request help from an ABAP developer to accelerate writing the appropriate coding. It is not difficult but it requires ABAP knowledge.
Best regards,
Sander
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Manu,
Please find below a coding example I previously created to flatten a Hierarchy on 0ACCOUNT. I tried to modify the coding so that it can be used in a DTP Filter routine.
You will have to slightly adapt it to make it work in your case (e.g. InfoObject, Hierarchy name, Node names).
* Local data declaration
DATA:
l_s_hiesel TYPE rsndi_s_hiesel,
l_s_subtreesel TYPE rssh_s_nodebynamewol,
l_subrc TYPE sy-subrc,
l_t_nodenames TYPE STANDARD TABLE OF rsndi_s_nodenm,
l_s_accountrange TYPE rs_s_range,
l_t_accountrange TYPE STANDARD TABLE OF rs_s_range,
l_chaval_low TYPE rsshchavalue,
l_s_range TYPE rssdlrange.
FIELD-SYMBOLS:
<nodenames> TYPE rsndi_s_nodenm,
<accountrange> TYPE rs_s_range.
* Initialization
CLEAR:
l_s_hiesel,
l_s_subtreesel,
l_subrc.
REFRESH:
l_t_nodenames,
l_t_accountrange.
* Determine Accounts from Hierarchy Node
l_s_hiesel-objvers = rs_c_objvers-active.
l_s_hiesel-hienm = i_hienm. "<<< replace with your hierarchy
l_s_hiesel-dateto = '99991231'.
l_s_hiesel-iobjnm = '0ACCOUNT'.
l_s_subtreesel-nodename = i_nodename. "<<< replace with respective node
l_s_subtreesel-iobjnm = '0HIER_NODE'.
CALL FUNCTION 'RSNDI_SHIE_STRUCTURE_GET3'
EXPORTING
i_s_hiesel = l_s_hiesel
i_s_subtreesel = l_s_subtreesel
i_no_nodenm_table = rs_c_false
IMPORTING
e_subrc = l_subrc
TABLES
e_t_nodenames = l_t_nodenames.
IF l_subrc <> 0.
p_subrc = 4.
RETURN.
ENDIF.
DELETE l_t_nodenames WHERE iobjnm = '0HIER_NODE' OR iobjnm = '0CHRT_ACCTS'.
SORT l_t_nodenames BY nodeid fromto.
LOOP AT l_t_nodenames ASSIGNING <nodenames>.
CASE <nodenames>-fromto.
WHEN ' '. "no interval
CLEAR l_s_accountrange.
l_s_accountrange-sign = rs_c_range_sign-including.
l_s_accountrange-opt = rs_c_range_opt-equal.
l_s_accountrange-low = <nodenames>-chavalue.
APPEND l_s_accountrange TO l_t_accountrange.
WHEN '1'. "interval from-value
l_chaval_low = <nodenames>-chavalue.
WHEN '2'. "interval to-value
CLEAR l_s_accountrange.
l_s_accountrange-sign = rs_c_range_sign-including.
l_s_accountrange-opt = rs_c_range_opt-between.
l_s_accountrange-low = l_chaval_low.
l_s_accountrange-high = <nodenames>-chavalue.
APPEND l_s_accountrange TO l_t_accountrange.
CLEAR l_chaval_low.
ENDCASE.
ENDLOOP.
* Fill range
LOOP AT l_t_accountrange ASSIGNING <accountrange>.
CLEAR l_s_range.
l_s_range-fieldname = i_fieldnm.
l_s_range-sign = <accountrange>-sign.
l_s_range-option = <accountrange>-opt.
l_s_range-low = <accountrange>-low.
l_s_range-high = <accountrange>-high.
APPEND l_s_range TO l_t_range.
ENDLOOP.
* Set return code to OK
p_subrc = 0.
Best regards,
Sander
9 years later I just discovered this thread and can only say: bug thumbs up! I've used your code example in my DTP and it worked just fine. Great stuff - saved me about 4 hours of loading time. 🙂
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 18 | |
| 7 | |
| 6 | |
| 6 | |
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.