cancel
Showing results for 
Search instead for 
Did you mean: 

Viewset controll class access view context

former_member192022
Participant
0 Kudos

Hi exports

component BT111H_OPPT-->

BT111H_OPPT/OpportunityOVViewSet

control class

ZL_BT111H_O_OPPORTUNITYO0_IMPL~Zmethod

read

view BT111H_OPPT/Details context node BTSTATUS

how to do it?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

You cannot directly access the context node of details view at OpportunityOVViewSet controller class unless the context node is bound to custom controller or component controller. Instead what i would suggest you is make use of BOL entity to fetch the status and following is the sample code:

Inside your Z_method in IMPL class of OpportunityOVViewSet i.e. ZL_BT111H_O_OPPORTUNITYO0_IMPL~Zmethod

data : lr_entity type ref to cl_crm_bol_entity.
lr_entity ?= me->typed_context->btadminh->collection_wrapper->get_current( ).
lr_entity = lr_entity->get_related_enitity( 'BTHeaderStatusSet' ).     "Relation name is case sensitive

Now lr_entity would have the current oppurtunity document status enitity.

I have given you a hint here if you want more details of the status you can drill down from BTHeaderStatusSet to other entities via relations which you could find in GENIL_BOL_BROWSER/GENIL_MODEL_BROWSER.

Hope this helps you.

Regards,

Bharathy.

former_member192022
Participant
0 Kudos

solved.using customer controller share data.

Thanks god/Xie xie laotianye! your are a real export!