on 07-14-2009 1:50 PM
Hi Experts,
i wanna know if there is a kind of status parameter in the Web UI, which shows me the mode of a view? (e.g. in edit mode).
This parameter should be used to set a view configuration. Has anybody an idea?
Thanks for your help!
Tobi
Hi Masood,
now i got the point. It works fine. Here the Code:
DATA: lv_view_sub1 TYPE REF TO cl_cpg_main_vsovefheader_impl,
lv_view_sub2 TYPE REF TO cl_cpgoe_de_eovpwindow_impl,
lr_coco TYPE REF TO cl_cpgoe_de_bspwdcomponen_impl,
lr_entity TYPE REF TO cl_crm_bol_entity.
TRY.
lv_view_sub1 ?= me->get_subcontroller_by_viewname( 'CPG_MAIN/VSOVEFHeader' ).
CHECK lv_view_sub1 IS BOUND.
lv_view_sub2 ?= lv_view_sub1->get_subcontroller_by_viewname( 'UCDetails.eOVPWindow' ).
CHECK lv_view_sub2 IS BOUND.
CATCH cx_sy_move_cast_error.
ENDTRY.
lr_coco ?= lv_view_sub2->m_parent.
lr_entity ?= lr_coco->typed_context->campaign->collection_wrapper->get_current( ).
*IF lr_entity->is_changeable( ) = abap_false.
My Problem now is that when i load the view in first time it didn`t load the config it should. When i go to "edit" button and then "cancel" it gets the right config. Do you have an idea?
IF lv_cpg_str-camp_type EQ 'ZTEST'.
IF lr_entity->is_changeable( ) = abap_false.
CALL METHOD me->set_config_keys
EXPORTING
iv_object_type = 'ZTEST'
iv_object_sub_type = '<DEFAULT>'
iv_propagate_2_children = 'X'.
ELSE.
CALL METHOD me->set_config_keys
EXPORTING
iv_object_type = 'ZTEST2'
iv_object_sub_type = 'DEFAULT'
iv_propagate_2_children = 'X'.
ENDIF.
ENDIF.
Thanks a lot!
Tobias
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It is a tedious process to validate whether it is a standard issue or because of your code.....
1. Check whether the default config is getting picked for your view even after setting of config key by ur code. The config gets set in this method
CL_BSP_DLC_XML_STORAGE2=>GET_CONFIG_KEYS_FOR_VIEW. This gets called for every view, validate the execution sequence of your code and this method(normally you need not do that,but in ur case u r writing the code in a viewset which comes before a view.)
2. Second thing, I observed this issue while setting a new config using DO_CONFIG_DETERMINATION while working for a Search page.....I had to set config dynamically using this method to filter some of the search fields. Despite setting the config this way, all the search fields were getting picked up as soon as I loaded the UI, but after a server event or navigtaing to a page and coming back, the search page used to shown only the required search parameters as made available in new custom config.
So,this can be a standard issue too.....just validate
Masood Imrani S.
Hi Masood,
now i think got the problem. I am in CPG_MAIN. Here in Viewset - CPG_MAIN/OPOverview but want to react on a View (CPG_MAIN/VSOVHeader) of this Viewset. So with me i always get to Viewset IMPL. But now i don`t know how to get to the Views IMPL. Do you have an idea?
Thanks,
Tobias
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Tobi,
Check this attribute of the View Set IMPL Class 'M_SUBCONTROLLERS'
In debugging, type ME, from there navigate to M_SUBCONTROLLERS.
The View IMPL class will be among the subcontrollers of the ViewSet. Write this code, you will get it
DATA: lr_view TYPE REF TO view impl class name.
TRY.
lr_view ?= get_subcontroller_by_viewname( 'CPG_Main/VIEW NAME' ).
CATCH cx_sy_move_cast_error.
ENDTRY.
Using this View Group Context can be accessed. Again View Group Context should be set by the time you execuet this code, else it will be initial again.
Regards,
Masood Imrani S.
Hi Experts,
I think it is not bound yet - because i used it in do_config_determination. What function will be called earlier (do_config_determination or set_view_group_context)? Do you have an idea to fix it?
Here my Code:
IF me->view_group_context->is_view_in_display_mode( me ) = abap_false.
super->do_config_determination( iv_first_time ).
DATA: lr_cuco TYPE REF TO cl_cpg_main_cucoactions_impl,
lr_current TYPE REF TO if_bol_bo_property_access,
lv_ctype TYPE crm_mktpl_camptype,
lv_cpg_str TYPE crmc_mktpl_ctype.
lr_cuco ?= me->get_custom_controller( 'CuCoActions' ).
lr_current = lr_cuco->typed_context->campaign->collection_wrapper->get_current( ).
IF lr_current IS BOUND.
lv_ctype = lr_current->get_property_as_string( iv_attr_name = 'CAMP_TYPE').
ENDIF.
.....
ENDIF.
......
Thanks,
Tobias Meisersick
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Tobi,
I checked in debugging for one of the standard overview pages.
SET_VIEW_GROUP_CONTEXT is triggering first and then DO_CONFIG_DETERMINATION and the attribute VIEW_GROUP_CONTEXT is bound for me in DO_CONFIG_DETERMINATION.
I dont see any issue in the code. Debug and check both the methods and validate what is the state of VIEW_GROUP_CONTEXT......
Regards,
Masood Imrani S.
Hi Masood,
thanks for your answer. But i have a problem with this code - i get an NULL reference. I can also not find the method "is_view_in_display_mode" in my IMPL CLASS (ZL_CPG_MAIN_OPOVERVIEW_IMPL). Do you have an idea?
Regards,
Tobias Meisersick
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tobi,
Check in debugging each of the variable me, view_group_context whether they are bound or not. I doubt VIEW_GROUP_CONTEXT is not bound.
Now VIEW_GROUP_CONTEXT gets created in a method SET_VIEW_GROUP_CONTEXT in your IMPL class.
Check whether you are writing code at a place that triggers after this method SET_VIEW_GROUP_CONTEXT.
Regards,
Masood Imrani S.
Hi Tobi,
You can check if the view is in display mode or editable mode using this piece of code which can be written in any method of the IMPL Class(View Controller).
IF me->view_group_context->is_view_in_display_mode( me ) = abap_true.
Regards,
Masood Imrani S.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
8 | |
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.