cancel
Showing results for 
Search instead for 
Did you mean: 

WBS element Hierarchy issue

former_member183113
Active Participant
0 Kudos

Hello all,

we have an issue with 0wbs element hierarchy.In bex query the values are getting doubled becz of WBS Element hierarchy nodes can also have values posted against them – so we need to exclude these and let the hierarchy automatically roll-up the values.

wbs element           value

RBID.0007          3,00,000

  RBID.0007          1,00,000

RBID.0007.001       2,00,000

  rbid.0007.001       1,00,000

RBID.0007.001.01   50,000



Here we need to exclude the nodes which are having same wbs element . ex., in the above RBID.0007.001 having two values which gives incorrect data in reporting.


any solution for this? 


regards,

Raki




Accepted Solutions (0)

Answers (1)

Answers (1)

former_member183113
Active Participant
0 Kudos

issue has been fixed using end routine... we created a char infoobject and inserted it till bex query filter. in filter the value is = X.

Below is the code.

Types: begin of st_hwbselemnt,

            hieid type RSHIEID,

           IOBJNM type RSIOBJNM,

               CHILDID type RSCHILD,

           nodename type RSSHNODENAME,

             end of st_hwbselemnt.

Data :t_hwbselemnt type hashed table of st_hwbselemnt with UNIQUE key

nodename,

w_hwbselemnt type st_hwbselemnt.

Field-symbols: <RP> TYPE _ty_s_TG_1.

CONSTANTS hier_name type /bi0/hwbs_elemt-hieid value

'xxxxxxxxxxxxxxxxxxxxx'. give u r hier id. you can get it from hierarchy table.

If RESULT_PACKAGE is not initial.

* read hierarchy table of wbs element

select hieid IOBJNM childid nodename

into table  t_hwbselemnt

from /bi0/hwbs_elemt

where

iobjnm = '0WBS_ELEMT' and

hieid = hier_name  and

objvers = 'A'.

if t_hwbselemnt is not initial.

*     delete adjacent duplicates from t_hwbselemnt comparing hieid

*     nodename.

     sort t_hwbselemnt by nodename.

endif. " t_hwbselemnt not initial

*

Loop at RESULT_PACKAGE assigning <rp>.

* read table hierarhcy and search for wbs element child node

     read table  t_hwbselemnt into w_hwbselemnt  with key nodename =

     <rp>-wbs_elemt.

*     childid = <rp>-childid

      if sy-subrc eq 0.

        if w_hwbselemnt-childid is INITIAL.

* mark display  node as X

           <rp>-/bic/ZDISP_NOD = 'X'.

     endif. " Read table

     endif.

endloop. "Result_package

*

endif. "Result package