on 03-26-2009 7:37 AM
Hello Experts,
I have created a View in my own Component with a context to simple object that I have created.
I need to add a new empty entity to my view's collection in method DO_INIT_CONTEXT
What is the elegant/correct way to do it?
Thank You,
Eyal
Hi,
I found this way:
DATA: lv_query TYPE REF TO if_bol_bo_property_access,
lr_coll_wrapper TYPE REF TO cl_bsp_wd_collection_wrapper,
lr_cucoaui TYPE REF TO cl_iccmp_in_bspwdcomponen_impl,
lv_col TYPE REF TO if_bol_bo_col,
lr_col TYPE REF TO cl_bsp_wd_collection_wrapper,
lr_entity TYPE REF TO if_bol_bo_property_access.
CALL METHOD super->do_init_context.
lr_coll_wrapper = typed_context->zbpactstatissearch->get_collection_wrapper( ).
create query instance
CREATE OBJECT lv_col TYPE cl_crm_bol_bo_col.
lv_query ?= cl_crm_bol_query_service=>get_instance( iv_query_name = 'ZBPActStatisSearch' ). "#EC NOTEXT
lv_col->add( iv_entity = lv_query ).
typed_context->zbpactstatissearch->set_collection( collection = lv_col ).
set default 'My Groups' for 'Assigned To'
lr_col = typed_context->zbpactstatissearch->get_collection_wrapper( ).
IF lr_col IS BOUND.
lr_entity = lr_col->get_current( ).
IF lr_entity IS BOUND.
TRY.
CALL METHOD lr_entity->set_property_as_string
EXPORTING
iv_attr_name = 'BP'
iv_value = '150'.
CATCH cx_sy_conversion_error .
ENDTRY.
ENDIF.
ENDIF.
Is this the Best Way?
Thanks,
Eyal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
2 | |
2 | |
1 | |
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.