cancel
Showing results for 
Search instead for 
Did you mean: 

Change UI configuration in do_config_determination via dropdown box value

Former Member
0 Kudos

Hi All,

  I want to implement dynamic configuration in component BP_DATA according to dropdown box in BP_HEAD when creating customer master data.

  Step is following:

  a. implement P-get method for dropdown field in component BP_HEAD

case iv_property.

  when if_bsp_wd_model_setter_getter=>fp_server_event.

    rv_value = 'YOUR_EVENT'.

endcase.

  I dont create YOUR_EVENT event. but do_config_determine event can still be triggered.

  b. Redefine do_config_determine methof in BP_DATA

    Get dropdown field value in BP_HEAD here.

    DATA: lr_main TYPE REF TO cl_bp_data_mainwindow_impl.

    DATA: lr_com_controller TYPE REF TO cl_bp_data_bspwdcomponent_impl .

    DATA: lr_window TYPE REF TO cl_bp_data_noteswindow_impl .

    DATA: lr_entity TYPE REF TO cl_crm_bol_entity.

    lr_window ?= me->m_parent.

    IF lr_window IS BOUND.

      lr_com_controller ?= lr_window->m_parent.

      IF lr_com_controller IS BOUND.

        lr_entity ?= lr_com_controller->typed_context->partner->collection_wrapper->get_current( ).

      ENDIF.

    ENDIF.

    IF lr_entity IS BOUND.

        lv_value = lr_entity->get_property_as_string( iv_attr_name = 'DROPDOWN' ).

    ......

    now do_config_determine can be triggered if I select dropdown value .

    but lr_entity is initial if dont press enter key.

    lr_entity is correct if press enter key.

    I dont know why. I expect change configuration when dropdown item is selected.

    How to get dropdown value even though without pressing enter key.

    Thanks for your help!

Regards,

Dou

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Dou,

Please use below code and check once.

lr_entity ?= me->typed_context->partner->collection_wrapper->get_current().


IF lr_entity IS BOUND.

        lv_value = lr_entity->get_property_as_string( iv_attr_name = 'DROPDOWN' ).

Endif.


Thanks,

Anil



Former Member
0 Kudos

Hi Anil,

    thanks for your repid answer. but do_config_determination event is in BP_DATA component.

    whereas, dropdown field is in BP_HEAD component.

    your code can get BP_DATA context content, not BP_HEAD.

Former Member
0 Kudos

Hi Dou,         

          lr_window = me->get_window( ).

           lr_entity = lr_window->if_bsp_wd_history_state_descr~get_main_entity( ).

           IF NOT lr_entity IS BOUND.

             CALL METHOD cl_crm_uiu_bp_tools=>get_current_comp_attribute

               EXPORTING

                 iv_comp_controller = me->comp_controller

                 iv_node_name       = 'PARTNER'

               IMPORTING

                 ev_current         = lr_current.

             lr_entity ?= lr_current.

           ENDIF.


Could you please check if this works.


Thanks,

Anil

Former Member
0 Kudos

Hi Anil,

     thanks.

    it doesnt work.  partner node is in component control.

Answers (0)