Skip to Content
h2. Section 4: Create PartnerSelection view METHOD if_htmlb_tableview_iterator~render_cell_start . DATA: lr_col_check TYPE REF TO cl_crm_ic_checkbox. * Adjustment depends on column CASE p_column_key. WHEN ‘SELECT_FLAG’. CREATE OBJECT lr_col_check. lr_col_check->id = p_cell_id. lr_col_check->key = ‘TRUE’. lr_col_check->keynotchecked = ‘FALSE’. READ TABLE gr_context_node->gr_cuco_partnersel->gt_selected_partner_list TRANSPORTING NO FIELDS WITH KEY partner_no = gv_partner_no partner_fct = gv_partner_fct. IF sy-subrc = 0. lr_col_check->checked = ‘TRUE’. ELSE. lr_col_check->checked = ‘FALSE’. ENDIF. lr_col_check->disabled = ‘FALSE’. p_replacement_bee = lr_col_check. ENDCASE. ENDMETHOD. step 7 : Modify the newly created context node class to include the iterator Add an attribute | Attribute | Level | Visibility | Type | Initial Value | | ITERATOR | Instance | Public | ZCL_PARTNERSELECTION_IT | | | GR_CUCO_PARTNERSEL | Instance | Public | ZCl_Cuco_partnerselection | | h5. Add constructor method method CONSTRUCTOR.CALL METHOD SUPER-> CONSTRUCTOR. * create iterator IF NOT iterator IS BOUND. CREATE OBJECT iterator EXPORTING ir_context_node = me . ENDIF. endmethod. step 8 : In the controller class created for Partner selection view, add the following attributes | Attribute | Level | Visibility | Type | Initial Value | | GV_TITLE | Instance | Private | TEXT100 | | | GR_CUCO_PARTNERSELECTION | Instance | Private | ZCL_CUCO_PARTNERSELECTION | | | GC_YES | Constant | Private | C | ‘X’ | | GV_SOURCE_VIEW | Instance | Private | STRING | | Redefine the following methods h5. DO_HANDLE_EVENT METHOD do_handle_event. * Eventhandler DATA: lv_partner_fct TYPE comt_partner_fct, lv_outbound_plug TYPE string, lv_flag TYPE c. DATA lr_msg_service TYPE REF TO cl_bsp_wd_message_service. DATA lv_msg_v1 TYPE symsgv. DATA lv_msg_v2 TYPE symsgv. DATA:lv_partner_fn_desc TYPE comt_partner_description. DATA:lr_cucobdc TYPE REF TO cl_crm_ic_cucobdc_impl. DATA: lt_parameters TYPE crmt_name_value_pair_tab, lr_core TYPE REF TO cl_crm_bol_core, lr_result TYPE REF TO if_bol_bo_col. IF htmlb_event IS NOT INITIAL. CASE htmlb_event->server_event. WHEN ‘done’. IF NOT gr_cuco_partnerselection IS BOUND. gr_cuco_partnerselection ?= me->get_custom_controller( ‘Z12S0CucoPartnerSelect’ ). ENDIF. CALL METHOD gr_cuco_partnerselection->check_partner_functions IMPORTING ev_partner_function = lv_partner_fct EXCEPTIONS partner_function_select_error = 1 OTHERS = 2. IF sy-subrc <> 0. lr_msg_service = cl_bsp_wd_message_service=>get_instance( ). lv_msg_v1 = text-001. READ TABLE gr_cuco_partnerselection->gt_partner_fn_desc INTO lv_partner_fn_desc WITH KEY partner_fct = lv_partner_fct. IF sy-subrc = 0. lv_msg_v2 = lv_partner_fn_desc-description. ENDIF. lr_msg_service->add_message( iv_msg_type = if_genil_message_container=>mt_error iv_msg_id = ‘R1’ iv_msg_number = ‘000’ iv_msg_v1 = lv_msg_v1 iv_msg_v2 = lv_msg_v2 iv_msg_level = ‘5’ ). RETURN. ENDIF. CALL METHOD gr_cuco_partnerselection->fill_partner_functions . CALL METHOD gr_cuco_partnerselection->get_partner_functions. IF gr_cuco_partnerselection->gt_partner_selection_tab IS INITIAL. lv_flag = gc_yes. CALL METHOD gr_cuco_partnerselection->set_selection_flag EXPORTING iv_flag = lv_flag. CALL METHOD gr_cuco_partnerselection->get_outbound_plug IMPORTING ev_outbound_plug = lv_outbound_plug. * Prepare navigation lr_cucobdc ?= me->get_custom_controller( ‘CuCoBDC’ ).”#EC NOTEXT IF lr_cucobdc IS BOUND AND gv_source_view IS NOT INITIAL. * get navigation data CALL METHOD lr_cucobdc->set_navigation_data EXPORTING iv_source_view_name = gv_source_view. ENDIF. view_manager->navigate( source_rep_view = rep_view outbound_plug = lv_outbound_plug ). ELSE. lr_core = cl_crm_bol_core=>get_instance( ). lr_result = lr_core->query( iv_query_name = ‘ZPartnerSelectionQuery’ it_query_params = lt_parameters iv_view_name = ” ). “#EC NOTEXT me->typed_context->partnerselection->collection_wrapper->set_collection( lr_result ). ENDIF. WHEN OTHERS. ENDCASE. ENDIF. IF htmlb_event_ex IS NOT INITIAL. ENDIF. ENDMETHOD. = lt_selection. * Set the models for output view->set_attribute( name = ‘PartnerSelection’ “#EC NOTEXT value = typed_context->partnerselection ). lt_partner_sel_tmp = gr_cuco_partnerselection->gt_partner_selection_tab. DELETE ADJACENT DUPLICATES FROM lt_partner_sel_tmp COMPARING partner_fct. DESCRIBE TABLE lt_partner_sel_tmp LINES ln_count. IF ln_count = 1. READ TABLE lt_partner_sel_tmp INTO lv_partner_selection INDEX 1. READ TABLE gr_cuco_partnerselection->gt_partner_fn_desc INTO lv_partner_fn_desc WITH KEY partner_fct = lv_partner_selection-partner_fct. CONCATENATE text-002 lv_partner_fn_desc-description INTO gv_title SEPARATED BY space. ELSE. gv_title = text-003. ENDIF. view->set_attribute( name = ‘gv_title’ “#EC NOTEXT value = gv_title ). ENDMETHOD. h5. DO_PREPARE_OUTPUT method DO_PREPARE_OUTPUT. * build all dummy tables typed_context->PartnerSelection->build_table( ). . endmethod. Add the following method h5. IP_DEFAULT (Instance, Public) method IP_DEFAULT. DATA: lr_cucobdc TYPE REF TO cl_crm_ic_cucobdc_impl. * get Individual Object from BDC lr_cucobdc ?= me->get_custom_controller( ‘CuCoBDC’ ). “#EC NOTEXT ******************************************************************** * get navigation data CALL METHOD lr_cucobdc->get_navigation_data IMPORTING ev_source_view_name = gv_source_view. endmethod. step 9 : In the Runtime framework profile in IMG, add replacement controllers for the partner selection viewset and view. image image And also add the new custom controller image
To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

  1. Mark Romaine
    Hi there,
    I apologise in advance if  this is not the correct forum for my question ,
    Please re-direct me if this is so.

    Here is my question:
    I need to hide the address details of the Emplyoee Responsible   on this view.
    HPartnerTable.htm.

    would it be possible to manipulate the contents by putting some code in the View?   :}
    Marlene. (marleneswiegers@yahoo.co.uk)

    (0) 

Leave a Reply