on 08-25-2015 3:49 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
6 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.