Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 8735

How assign diff configurations 4 same used component in diff componentusage

$
0
0

Hi

 

As part of standard development, Component CRMCMP_CMG has component usage Attachements.mainwindow to show attachments. The used component is GS_CM

 

Similarly i have created a component usage say Z_GS_CM and using same used component GS_CM. I have binded the used component in Context node. And it is working fine as i am getting same values in view for my Z component usage as for standard componentusage.

 

My issue is i have to show different configuration of GS_CM/DocList as we are using for standard.

 

I have created a Object for configuration in SPRO, using define UI object types. say my object type is Z_GS_CM.

 

Created the callback class also for getting 3 subtypes.

 

IV_OBJECT_TYPE TYPE BSP_DLC_OBJECT_TYPE OPTIONAL Object Type 
VALUE( RESULT ) TYPE BSP_DLCT_OBJECT_SUB_TYPE Object sub types 
method IF_BSP_DLC_OBJ_TYPE_CALLBACK~GET_OBJECT_SUB_TYPES. 

DATA: lv_subtype TYPE bsp_dlc_object_sub_type. 

  lv_subtype = 'RECEIVED'.   APPEND lv_subtype TO result.   CLEAR lv_subtype.   lv_subtype = 'INTERNAL'.   APPEND lv_subtype TO result.   CLEAR lv_subtype.   lv_subtype = 'OUTGOING'.   APPEND lv_subtype TO result.   CLEAR lv_subtype. 

endmethod

 

 

In configuration of GS_CM i have created 3 configuration for object type Z_GS_CM and 3 subtypes.

 

Now in Component usage in CRMCMP_CMG, i want to assign one of the configuration.... How to do that?

 

i tried using below code in implementation class of view OverviewPage of component CRMCMP_CMG, but my window is not able to read the component usage Z_GS_CM in case. But all went in vain,

kindly help me, please.

 

method DO_CONFIG_DETERMINATION. 
*CALL METHOD SUPER->DO_CONFIG_DETERMINATION 
**  EXPORTING 
**    IV_FIRST_TIME = ABAP_FALSE 
*    .   DATA lr_ui_profile TYPE REF TO if_crm_ui_profile.   DATA lv_profile TYPE crmt_ic_configprof.   lr_ui_profile = cl_crm_ui_profile=>get_instance( ).   lv_profile = lr_ui_profile->get_profile( ).   IF lv_profile EQ 'Z_CASEWORK'.     DATA:     lr_window      TYPE REF TO   cl_bsp_wd_window,               lv_usage       TYPE          String,               lv_subtype     TYPE          bsp_dlc_object_sub_type.     CONSTANTS: lc_chm_opp     TYPE         bsp_dlc_object_type     VALUE 'Z_GS_CM'. 

*   Get the Window Controller     lr_window  = me->view_manager->get_window_controller( ). 
*    Get the Usage name from the instance of the window controller     lv_usage   = lr_window->get_component_usage_name( ). 
*me->GET_REPOSITORY_VIEW    CASE lv_usage.       WHEN 'Z_GS_CM'.         LV_SUBTYPE = 'RECEIVED'. 
*     And finally set the subtype of the configuration         CALL METHOD set_config_keys           EXPORTING             iv_object_type          = lc_chm_opp             iv_object_sub_type      = lv_subtype             iv_propagate_2_children = abap_true.       WHEN OTHERS.         SKIP.     ENDCASE.   ENDIF. 
endmethod.

 


Viewing all articles
Browse latest Browse all 8735

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>