on 05-13-2013 6:59 AM
Hi Guys,
my requirement is in standard, the feild billing block fileld having 10 dropdown values.
I want to set one deault value from dropdown values based on condition for that field.
for that i have enhance the corrosponding component and view.
But in that view, the context node class is not getting enhance(inherit). but the drop down values are filling by get_v method.
for this, can any body suggest me how to set default value.
Regards,
Suresh.
Hi Suresh,
You can set default value in DO_PREPARE_OUTPUT method, but with one condition.
IF iv_first_time = 'X'.
* Set your default value
ENDIF.
If you don't check for this condition, then at each server round trip, your selected value in the list box gets replaced with the default value so you may get incorrect values.
DATA: l_entity TYPE REF TO cl_crm_bol_entity.
IF iv_first_time = 'X'.
*** If you want you can check other conditions also here.
l_entity ?= me->typed_context->your_context_node->collection_wrapper->get_current( ).
l_entity->set_property_as_string( iv_attr_name = 'your_attr_name'
iv_value = 'your_value' ).
ENDIF.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Suresh,
Write your code in DO_PREPARE_OUTPUT or DO_INIT_CONTEXT.
eg. Try this code
method DO_INIT_CONTEXT.
CALL METHOD SUPER->DO_INIT_CONTEXT.
data : lr_entity type ref to CL_CRM_BOL_ENTITY.
lr_entity ?= me->typed_context->context_node->collection_wrapper->get_current( ).
IF lr_entity is bound.
call method lr_entity->SET_PROPERTY
exporting
IV_ATTR_NAME = ‘ATTR_NAME’
IV_VALUE = ‘VALUE’.
ENDIF.
endmethod.
GET_ATTR_NAME method
DATA: current TYPE REF TO if_bol_bo_property_access.
DATA: dref TYPE REF TO data.
if iterator is bound.
current = iterator->get_current( ).
else.
current = collection_wrapper->get_current( ).
endif.
IF current is bound.
Value = ‘N’.
ENDIF.
endmethod.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Suresh,
In DO_PREPARE_OUTPUT method you can use set_property_as_string for that attribute with one of the key values in drop down based on your condition.
Regards,
Karthik.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
7 | |
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.