define view Entity1
with parameters p_valid_at : timestamp
as select
from ibin as component
inner join ibib as ibase on component.mandt = ibase.mandt
and component.ibase = ibase.ibase
inner join zsib_prd_idx as prd_idx on component.mandt = prd_idx.client
and component.objnr = prd_idx.objnr
and prd_idx.status <> 'SMTHHERE'
inner join comv_prshtext as product on prd_idx.client = product.client
and prd_idx.product_guid = product.product_guid
and product.object_family = 'SMTHHERE'
inner join zsst_sy_smvv as smvv on smvv.client = product.client
and smvv.product_guid = product.product_guid
and smvv.valid_from <= :p_valid_at
and smvv.valid_to >= :p_valid_at
left outer join ibpart_idx as partner_idx on component.mandt = partner_idx.mandt
and ibase.ib_guid_16 = partner_idx.segment_recno
and partner_idx.segment = 1
inner join but000 as bp on bp.client = partner_idx.mandt
and bp.partner = partner_idx.partner
and ( bp.type = '2' or bp.type = '3' )
left outer join zsst_sy_head as sy_head on sy_head.client = product.client
and sy_head.product_guid = product.product_guid
{
26 fields from all tables
}
where
component.valfr <= :p_valid_at
and component.valto >= :p_valid_at
and ibase.ibtyp = 'SMTHHERE'
;
define view Entity1_SEARCH1
with parameters p_valid_at : timestamp
as select distinct from Entity1 (p_valid_at: $parameters.p_valid_at) as Ent1
left outer join Entity2 (p_valid_at: $parameters.p_valid_at) as Ent2 on Ent2.key = Ent1.key
left outer join Entity3 (p_valid_at: $parameters.p_valid_at) as Ent3 on Ent3.key = Ent2.key
left outer join SomeView as Smth on Smth.key = Ent1.key
{ 32 fields from all entities }
where
Ent1.usage not like '%ABC%'
and Ent1.usage not like '%XYZ%'
and Ent1.deletion_flag <> 'D'
and Ent1.deletion_flag <> 'X'
and
(
Ent2.solution_id is not null
or
( Ent2.solution_id is null
and Smth.sys_product_id is null
)
)
;
define view : Entity1_SEARCH
with parameters p_valid_at : timestamp
as
select distinct from
Entity1_SEARCH1 (p_valid_at: $parameters.p_valid_at) as Entity1_SEARCH1
{ All 32 fields }
union all
select distinct from
Entity1_SEARCH2 (p_valid_at: $parameters.p_valid_at) as Entity1_SEARCH2
{ All 32 fields }
;
" Build Select List...
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
build_select_list( is_query_params-selection_hints[] ).
" Trigger a normal select...
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
select distinct (gt_select_list) "#EC CI_NOORDER
from Entity1_SEARCH( p_valid_at = @lv_timestamp ) ##DB_FEATURE_MODE[VIEWS_WITH_PARAMETERS]
where
field0 in @lr_field0
and field1 in @lr_field1
and field2 in @lr_field2
and field3 in @lr_field3
and field4 in @lr_field4
and field5 in @lr_field5
and field6 in @lr_field6
and (lv_smth_else)
and (lv_auth_tail)
into corresponding fields of table @lt_result
up to @lv_max_hits_new rows.
method eh_onsearch.
data: lr_query_service type ref to cl_crm_bol_dquery_service.
data: lt_sel_fields type crmt_name_value_pair_tab.
lr_query_service ?= typed_context->searchquerynode->collection_wrapper->get_current( ).
lr_query_service->get_property_as_value( exporting iv_attr_name = 'SELECTION_HINTS'
importing ev_result = lt_sel_fields ).
" Reload Selection Fields...
delete lt_sel_fields where name = 'SEL_FIELD'.
append lines of get_rv_fields( 'ZYOURCOMP/YourPage#ZYOURCOMP/YourResultView' ) to lt_sel_fields[].
lr_query_service->set_property( exporting iv_attr_name = 'SELECTION_HINTS'
iv_value = lt_sel_fields ).
method get_rv_fields.
data: lt_path type table of string.
data: lr_window type ref to cl_bsp_wd_window.
data: lr_rv type ref to cl_bsp_wd_view_controller.
data: lr_config type ref to if_bsp_dlc_configuration.
data: ls_config type bsp_dlc_table_descr.
split iv_view_path at '#' into table lt_path.
if lt_path[] is initial.
return.
endif.
lr_window = me->view_manager->get_window_controller( ).
if lr_window is bound.
loop at lt_path assigning field-symbol(<fs_path>).
" First Level -> Window
if sy-tabix = 1.
lr_rv = lr_window->get_subcontroller_by_viewname( <fs_path> ).
else.
" Next Level -> View or Viewset
if lr_rv is bound.
lr_rv = lr_rv->get_subcontroller_by_viewname( <fs_path> ).
endif.
endif.
endloop.
" Latest View
if lr_rv is bound.
lr_config = lr_rv->configuration_descr.
if lr_config is bound.
call method cl_bsp_dlc_table_utility=>conf_xml_to_abap
exporting
iv_xml = lr_config->get_config_data( )
receiving
rs_table_config = ls_config.
" Take Only Standard, Showed Fields
loop at ls_config-columndefinition assigning field-symbol(<fs_column>)
where name cp 'STRUCT.*' and hidden = abap_false.
replace first occurrence of 'STRUCT.' in <fs_column>-name with space.
condense <fs_column>-name no-gaps.
append value #( name = 'SEL_FIELD' value = <fs_column>-name ) to et_fields[].
endloop.
endif. " if lr_config is bound.
endif. " if lr_rv is bound.
endif. " if lr_window is bound
endmethod.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
4 | |
3 | |
3 | |
2 | |
2 | |
2 | |
2 | |
1 | |
1 | |
1 |