Quantcast
Channel: SCN: Message List - SAP CRM: Webclient UI - Framework
Viewing all articles
Browse latest Browse all 7775

Re: How to Call Appointment POPUP in Items Assignement Block by click on Button

$
0
0

Hi Ravi

Before Seem Your Post I did the same procedure to show popup window.

But i follwed the below procedure please check is it right or wrg.but i am getting popup when i click on Button in Items Assignment Block.

But i have to implement same Validation which is behind the Popup as per Standared?

how can i do this?

 

In the component BT116IT_SRVO There is one event handler EH_ONONE_CLICK_ACTION

in this event handler i added some code part to trigger Event handler EH_ONAPPOINTMENT

DATA: lv_event     TYPE string,

         lv_index_str TYPE string,

         lr_ent       TYPE REF TO cl_crm_bol_entity,

         lr_cw        TYPE REF TO cl_bsp_wd_collection_wrapper,

         lr_cw_items  TYPE REF TO cl_bsp_wd_collection_wrapper,

         lv_index     TYPE i,

         lr_vgc       TYPE REF TO if_bsp_wd_view_group_context,

         lv_exception TYPE REF TO cx_bol_exception,

         lr_msg_srv   TYPE REF TO cl_bsp_wd_message_service.

***

 

   cl_thtmlb_util=>get_event_info( EXPORTING   iv_event = htmlb_event_ex

                                   IMPORTING    ev_index = lv_index ).

 

* get collection wrapper

   lr_cw ?= get_collection_wrapper( gc_context_node_admini ).

* set row index on collection

 

   lr_ent ?= lr_cw->find( iv_index = lv_index ).

 

* get the row index and the event

   SPLIT htmlb_event_ex->event_defined AT '.' INTO lv_event lv_index_str.

* work with the event on the selected collection

 

   TRY.

 

       CASE lv_event.

 

*      BEGIN OF  changes for popup event

         WHEN 'APPOINTMENT'.

         EH_ONAPPOINTMENT( htmlb_event    = htmlb_event

                   htmlb_event_ex = htmlb_event_ex ).

*        ENDOF changes for popup event

         WHEN 'DELETE'.

* delete single entity

           IF lr_ent IS BOUND.

             CHECK lr_ent->lock( ) EQ abap_true.

             lr_ent->delete( ).

             CALL METHOD refresh_items( ).

             view_group_context->set_view_editable( me ).

           ENDIF.

 

         WHEN 'EDIT'.

           IF lr_ent->lock( ) EQ abap_true.

             view_group_context->set_view_editable( me ).

             lr_vgc ?= view_group_context->get_parent_vg_context( ).

             lr_vgc ?= lr_vgc->get_dependant_vg_context( lr_ent ).

             lr_vgc->set_all_editable( ).

             lr_cw->find( iv_bo = lr_ent ).

           ENDIF.

 

*     get collection wrapper and publish current

           lr_cw_items ?= get_collection_wrapper( gc_context_node_items ).

           lr_cw_items->publish_current( ).

 

           IF lr_cw IS BOUND.

             lr_cw->find( iv_bo = lr_ent ).

             set_focus_btadmini( lr_ent ).

           ENDIF.

           eh_onto_item_edit( htmlb_event    = htmlb_event

                              htmlb_event_ex = htmlb_event_ex ).

         WHEN 'DISPLAY'.

           eh_onto_item_display( htmlb_event    = htmlb_event

                                 htmlb_event_ex = htmlb_event_ex ).

 

         WHEN OTHERS.

 

       ENDCASE.

 

     CATCH cx_bol_exception INTO lv_exception.

       IF lv_exception->textid = cx_bol_exception=>entity_already_freed.

*       entity was deleted already, may be by other session

         lr_msg_srv = me->view_manager->get_message_service( ).

         IF 1 = 2. MESSAGE w032(crm_uiu_bt). ENDIF. "just for where used list

         lr_msg_srv->add_message( iv_msg_type       = 'W'

                                  iv_msg_id         = 'CRM_UIU_BT'

                                  iv_msg_number     = '032' ).

         CALL METHOD refresh_items( ).

         view_group_context->set_view_editable( me ).

       ELSE.

*       other exception

         RAISE EXCEPTION lv_exception.

       ENDIF.

   ENDTRY.

 

********************************

In the Event handler i added below code part,but i am not getting Popup window name as appointment

 

 

DATA: lv_title              TYPE        string.

 

   DATAlr_node              TYPE REF TO CL_BSP_WD_CONTEXT_NODE,

          lr_coll_wrapper      TYPE REF TO cl_bsp_wd_collection_wrapper,

          lv_data_collection   TYPE REF TO IF_BOL_BO_COL,

          lr_wrapper           TYPE REF TO CL_BSP_WD_COLLECTION_WRAPPER.

 

   CONSTANTS: lc_cnode_name    TYPE seocmpname VALUE 'BTADMINI'.

 

lv_title = cl_wd_utilities=>get_otr_text_by_alias( 'CRM_UIU_BT_SERVICE_ORDER/SERVICEORDER_APPNTMNTOFFER' ).

 

IF appntmnt_popup IS NOT BOUND.

     appntmnt_popup = comp_controller->window_manager->create_popup(

     iv_interface_view_name = 'BTAPPTOFFER/MainWindow'

     iv_usage_name          = 'BTApptOfferPopUp'

     iv_title               = lv_title

   ).                                                        "#EC NOTEXT

   ENDIF.

   appntmnt_popup->set_display_mode( if_bsp_wd_popup=>c_display_mode_surrounded ).

 

   CREATE OBJECT lv_data_collection TYPE  cl_crm_bol_bo_col.

   lr_coll_wrapper = typed_context->btadmini->get_collection_wrapper( ).

   lv_data_collection ?= lr_coll_wrapper->get_marked( ).

   lr_node = appntmnt_popup->get_context_node( iv_cnode_name = lc_cnode_name ).

   lr_coll_wrapper = lr_node->get_collection_wrapper( ).

   lr_coll_wrapper->set_collection( lv_data_collection ).

 

   appntmnt_popup->set_title( lv_title ).

   appntmnt_popup->open( ).

****************************************************

in the component BT116IT_SRVO Under component Usage i added as you said.

 

 

*******************************************

in main impl class level i added attribute as you mentioned same.

******************************************

 

can you please explain below point which you mention.

 

Then set the close event for the popup by using method SET_ON_CLOSE_EVENT and open with method OPEN.

 

 

can you please let me know the validation part for this popup?

if standared haveing any validation like disable or enable or any conditions to show this popup those are alll i need to do on the button which i created at items assignment block when i click on that button popup need to open.

 

Thanks

RAJ

 



Viewing all articles
Browse latest Browse all 7775

Trending Articles



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