cancel
Showing results for 
Search instead for 
Did you mean: 

DO_CONFIG_DETERMINATION and different Components

Former Member
0 Kudos

Hi all,

I have to work on DO_CONFIG_DETERMINATION method for a component GSTEXT where I load the right configuration based on ORDER status. I'm not able to reach through the context and BOL model the BTADMINH to read the status attribute.

This is my big problem.

Because:in the component context ( CL_GSTEXT_BSPWDCOMPONENT_CONTEXT ) there are the following attributes:

OWNER

ATTR

ATTR1

TEXT

nothing about the parent.

In the custom controllers context ( CL_GSTEXT_CUSTCO_CTXT there aren't attribute to reach the node BTADMINH.

So ... if I start from BT115H_SLSO (main component of the BT) I see a custom controller BT115H_SLSO/CUGSText that should work for my case.

Can I set the right configuration for the component GSTEXT from DO_CONFIG_DETERMINATION of the view BT115H_SLSO/details?

Otherwise where is the error?

Starting from DO_CONFIG_DETERMINATION of the view BT115H_SLSO/details I have the following statements:

lr_coco ?= me->get_custom_controller( controller_id = 'BT155H_SLSO/CUGSText' ).
lr_node = lr_coco->typed_context->BTTEXTH->collection_wrapper->get_current()
lr_gstext = lr_node->get_related_entity ( iv_relation_name = 'BTTextHAll').

In this case the node (lr_gstext) is initial.

Then the problem should be .... how can I invoke the set_config_keys when I am on node of the model?

May you help me? Regards, Roberto

Edited by: Roberto Fattore on Oct 8, 2009 1:29 PM

Edited by: Roberto Fattore on Oct 8, 2009 1:29 PM

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

I try to explain in different way.

I'm working on component: GSTEXT

Component: GSTEXT

View Controller: CL_GSTEXT_LIST_IMPL

View Context: CL_GSTEXT_LIST_CTXT

Method: DO_CONFIG_DETERMINATION to set new configuration throughs the metthod SET_CONFIG_KEY

I need to read the BTADMINH node to obtain some data related to that entity.

How can I do?

Roberto

Former Member
0 Kudos

hi,

try below code to get main component controller in do_config_determination method of GSTEXT.


data: lr_gstext type ref to CL_GSTEXT_LIST_IMPL,
         lr_bt115h_controller type ref to cl_bsp_wd_controller.

    CHECK owner IS BOUND.
    TRY.
        lr_gstext ?= owner.
        lr_bt115h_controller ?= lr_gstext->m_parent.

      CATCH cx_root.
    ENDTRY.

regards

Ismail

Former Member
0 Kudos

Hi Ismail,

thank you for your suggestion but I'm on problem related to "owner". What does it mean?

Is the "owner" like self-reference "me"?

I know that within the implementation of every instance method, an implicitly created local reference variable called me is available. But this variable is not available in my case.

Can you explain better this point?

Regards, Roberto

Former Member
0 Kudos

hi,

the code mentioned in my previous message used in context class. So here owner is controller class. I think you need to use 'me' variable as you are using do_config_determination method from controller class.

please check using debug, if you get any connection to host view.(window controller, comp controller)

regards

Ismail

Former Member
0 Kudos

Hi Ismail,

yes you are right. I'm on controller class so I used the "me" instance variable. Here's the code that solve the problem. Perhaps there was another solution (more elegance) but it's working fine.

I called m_parent attribute two times to go to the 'btadminh'


lr_gstext_cuco ?= me->get_custom_controller( controller_id = 'GSTEXT/CustCo' ).
   CHECK lr_gstext_cuco IS BOUND.
   CHECK me->m_parent IS BOUND.
    TRY.
        lr_parent ?= lr_gstext_cuco->m_parent.
        CHECK lr_parent IS BOUND.
        frame_controller ?= lr_parent->m_parent.
        CHECK frame_controller IS BOUND.
        bt115h_slso ?= frame_controller->get_controller( controller_id = 'c21' ).
        CHECK bt115h_slso IS BOUND.
        check bt115h_slso->APPLICATION_NAME = 'bt115h_slso'.
        lr_adminh ?= bt115h_slso->typed_context->btadminh->collection_wrapper->get_current( ).
        CHECK lr_adminh IS BOUND.
        CATCH cx_root.
    ENDTRY.

Thanks for all ... roberto