Hi All,
I have a requirement to update "Planned Start Date" dynamically in the variant created for Marketing->campaign.
I have added below logic in CPGAS_ADVSEARCH->ASCampaign(View)->DO_INIT_CONTEXT.
data: lr_qs TYPE REF TO cl_crm_bol_dquery_service,
* l_selection_parameter type ref to if_bol_bo_property_access,
lr_col_params TYPE REF TO if_bol_bo_col,
l_selection_parameter type ref to if_bol_bo_property_access,
l_cnode type ref to cl_bsp_wd_context_node_asp,
l_date type string,
l_name type ref to NAME_KOMP.
FIELD-SYMBOLS : <gs_name> type any.
me->set_init_qs( abap_true )."Initialise the query
l_cnode = get_dquery_cnode( ).
lr_qs ?= l_cnode->collection_wrapper->get_first( ).
if lr_qs is not bound.
* add empty QS in order to allow application to prefill values
assign l_cnode->('BASE_ENTITY_NAME') to <gs_name>.
lr_qs = cl_crm_bol_dquery_service=>get_instance( <gs_name> ).
l_cnode->collection_wrapper->add( lr_qs ).
endif.
lr_col_params = lr_qs->get_selection_params( ).
l_selection_parameter = lr_col_params->get_first( ).
while l_selection_parameter is bound.
eh_onclear( ).
l_name ?= l_selection_parameter->get_property( 'ATTR_NAME' ).
if l_name->* = 'PLANSTARTDATE'.
lr_col_params->remove( l_selection_parameter ).
l_selection_parameter = lr_col_params->get_current( ).
else.
l_selection_parameter = lr_col_params->get_next( ).
endif.
endwhile.
l_date = sy-datum.
lr_qs->ADD_SELECTION_PARAM( iv_attr_name = 'PLANSTARTDATE'
iv_sign = 'I'
iv_option = 'EQ'
iv_low = l_date ).
Above logic is setting current date in Marketing->Campaign search screen .But when i create a variant with past date and try to execute it today even though do_init_context method is getting triggered date is not getting updated in the variant and i am able to see the result with past date only.
Kindly let me know how to update date dynamically in the variant
Regards
Deepthi