Skip to Content
avatar image
Former Member

Status Parameter "Edit"-Mode

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • avatar image
    Former Member
    Jul 14, 2009 at 01:38 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 15, 2009 at 06:39 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.

  • avatar image
    Former Member
    Jul 15, 2009 at 08:37 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.

  • avatar image
    Former Member
    Jul 15, 2009 at 03:59 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.

  • avatar image
    Former Member
    Jul 17, 2009 at 05:45 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Tobi,

      I think it depends on the case I mentioned in my earlier post.

      Just validate thoroughly, if you feel it is an issue with the standard raise an OSS.