cancel
Showing results for 
Search instead for 
Did you mean: 

Get data from a component usage at run time in a method

0 Kudos

Hi Experts,

I want to get data from a component usage i created in a component basically a BI Report number on which I want to perform authority check in the method DETACH_STATIC_OVW_VIEWS, I have figured out we can access the component usage at run time by VIEW_AREA attribute of the class in which the method is.I can acces the component usage in the debugger using ME->VIEW_AREA.

But I am not able to figure out how to access specific field in the component view.Please can you help me in the syntax as I am a beginner in CRM.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

you can get the data of related component by using relationships.for example,you are working in BT115h_slso and you have to fetch the status of the sales order then you will get the status of sales order by thier relationship.yopu cn use genil_model_browser to see relationship of that component.

reagrds,

hem

Answers (4)

Answers (4)

0 Kudos

Hi thanks for your responses but i have figured out a way i wanted to share with you all.

*created a field symbol

FIELD-SYMBOLS <f> LIKE LINE OF view_area.

DATA: lv_viewid TYPE bsp_dlc_ovw_stat_view_attach.

LOOP AT me->view_area ASSIGNING <f>.

lv_string = <f>-appl_viewname.

*The view name contains the bi reportnumber so if have split it to attain the number

*Apllied authority check If it fails then appended to the return table of the method

if sy-subrc <> 0

lv_viewid-viewid = <f>-appl_viewname.

APPEND lv_viewid TO rt_viewid.

ENDLOOP.

I am unable to test my prog now so am not certain of its working but will update soon.

Former Member
0 Kudos

hi,

Instead of usign the vieware attribute,try this.

Get the component controller instance from the view instance using attribute me->comp_controller.

Now the component controller has a lis of all component usages,whcih u can access using the method get_component_usgae('component usage name').

Once you get this,get the context node of the compo usage using the method get_cnode.

now you can access the field of the context node which you want to.

PS: the context node to be accessed should be present in the component controller of the used component and also exposed in component interfaces in the runtime repository of the used component.

Thansk,

Suvidha

Former Member
0 Kudos

<error>

Edited by: dedeepya reddy on Apr 8, 2011 12:23 PM

Former Member
0 Kudos

Hello,

Reiterating the issue u are facing-

U need to read an attribute value from a BSP Component-A (defined under Component Usage) into BSP Componenet-B.

If so is the case,

BSP Component B

In INPUT PLUG method of the MAIN WINDOW, u have a parameter IV_COLLECTION. This param holds the data in the context node passed from COMPONENT-A(so u need to make sure ur passing the right context node collection wrapper).

Use the foll. lines to read the resp. attribute


  DATA: lv_iterator TYPE REF TO if_bol_bo_col_iterator,
             lv_property_access TYPE REF TO if_bol_bo_property_access,
             lv_value TYPE STRING.

  lv_iterator = iv_collection->get_iterator( ).
  lv_property_access = lv_iterator->get_first( ).
  WHILE lv_property_access IS BOUND.
    lv_property_access->get_property_as_value( EXPORTING iv_attr_name = 'FIELD_NAMEXYZ'
                                        IMPORTING ev_result = lv_value ).

    lv_property_access = lv_iterator->get_next( ).
  ENDWHILE.

LV_VALUE holds the attributes value.

If it suits ur requirement, hope it helps!!

Regards

Dedeepya C