Question:
Hi,
Via an Infospoke I have to extract data outside BW.
As no selection is possible for the texts of WBS Elements (table /BI0/TWBS_ELEMT), I have to use the BADI enhancement to filter data for a given Controlling Area.
ABAP OO is slightly different from ABAP/4, so I'm a bit lost.
Has anyone of you an example in ABAP OO filtering data based on certain conditions (attributes of master data)?
Regards,
Hans
Answer:
Hi,
There is no real difference between Abap OO and Abap4, instead that code is organized to create object and call methods of that object.
With Badi, the object is created for you, wich is an interface : IF_EX_OPENHUB_TRANSFORM. You have to implement this interface where you will find an internal table called E_T_DATA_OUT.
Looping on that table will allow you to put your texts. But where ? Do you have a field for that ???
Anyway, implementing Badi is more a subject for Abap Forum, than for BW forum. I am sure you will find answers there.
Good luck
_________________
Laurent THIBERT
Business Connection Amerique
Answer:
Hi,
just solved the problem!
The abap code that helped me is:
method IF_EX_OPENHUB_TRANSFORM~TRANSFORM .
data:
l_s_data_in type /BIC/CYZ9_IS_FI_WBS_T,
l_s_data_out type /BIC/CZZ9_IS_FI_WBS_T,
a_WBSELEMT type /BI0/PWBS_ELEMT.
CLEAR a_wbselemt.
clear e_t_data_out.
SELECT wbs_elemt FROM /BI0/PWBS_ELEMT
INTO A_WBSELEMT
WHERE objvers = 'A'
AND CO_AREA = 'xxxx'
AND PS_LEVEL >= '003'.
loop at i_t_data_in into l_s_data_in.
if l_s_data_in-WBS_ELEMT eq a_WBSELEMT-WBS_ELEMT.
move-corresponding l_s_data_in to l_s_data_out.
insert l_s_data_out into table e_t_data_out.
continue.
endif.
endloop.
endselect.
endmethod.
Hope this will help some of you.
Regards,
Hans.