cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

Hi Floks

I Have A requriement can you  please share your ideas to implement.

I am new To SAP CRM WEBUI.

i need to show popup window by clicking on button  in service order items assignment block.

we have already one APPOINTMENT Button in Items details page,its standared by SAP.

when we click on appointment button its showing popup window but as per my requirement

i need to create one button at items assignment block,when i click on that button i need to open appointment popup which is already at items details page.

for this reason what i need to do?

in component BT116IT_SRVO And GenericItem View at context node BTADMINI(TV)Under Context node implementaion class i redife the method GET_OCA_T_TABLE.

I Write the code to get button at item assignment block.

  

data: ls_one_click_action type crmt_thtmlb_one_click_action.

CLEAR ls_one_click_action.
ls_one_click_action-id      = 'APPOINTMENT'.
  ls_one_click_action-icon    = 'appointment.gif'.
  ls_one_click_action-text    = ''.
  ls_one_click_action-tooltip = text-002.
  ls_one_click_action-active  = 'X'.
   append ls_one_click_action to rt_actions.

i need to create Event handler for this Appointment,i created this but how can i call popup window which is standared at items details page?

i seem this appoinment button created under this component BT140I_SRVP  And view BT140I_SRVP/OVViewSet

but when i check with this component how they are calling popup window ,in event handler of this component i have below code part

 

  DATA: lv_title              TYPE        string.
  DATAlr_node              TYPE REF TO cl_btapptof_bspwdcomponen_cn00,
         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_SALES_ORDER/SORDER_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( ).

But  when i try to do same code part in the event hadler of the component BT116IT_SRVO its not working

may i want to create Component Usage or Component Interface for  component BT116IT_SRVO ?

can anyone please let me know the process how to get popup window when i click on button at items assignment block(this popup already in place at items details page)same popup i need to show when i click at items assigment block

Helpfull answers will be reward

Thanks

Raj

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Raj,

1> declare a reference variable of type pop-up in your .impl class.

lr_popup type ref to if_bsp_wd_popup.

According to youe scenario, now you have to create an pop-up instance with the fallowing code..

  IF lr_popup IS NOT BOUND.

    lr_popup = comp_controller->window_manager->create_popup(

    iv_interface_view_name = 'BTAPPTOFFER/MainWindow'          "Interface View name of your Component Usge

    iv_usage_name          = 'BTApptOfferPopUp'     "Component Usage Name

    iv_title               = lv_title

)

Endif.

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

So in the component BT116IT_SRVO you have to create a component usage  with name BTApptOfferPopUp by adding the Component BTAPPTOFFER with InterfaceView BTAPPTOFFER/MainWindow

Then all the remaining coding as same as you written.

Former Member
0 Kudos

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


Former Member
0 Kudos

Hi Raj,

While you are raising the pop-up, you can set the Event when the pop-up is get closed by using the method SET_ON_CLOSE_EVENT. Inside of this Event we will write the code as to our requirement.

Sample Code :

gr_popup->set_on_close_event( iv_event_name = 'UPLOAD_FILE_POPUP_CLOSED' iv_view = me ).

Finally we will open the pop-up by using the method OPEN( ).

From your above code i came to know that your initializing the collection wrapper in the line

lr_coll_wrapper->set_collection( lv_data_collection ).

So if u want 2 assign this collection to your popup u can use the appntmnt_popup->OPEN( iv_collection = lv_data_collection).


Please put the debugger before initializing the title to the pop-up and check the variable lv_title is getting populated or not if it is populated,If it getting initiliaze then remove the line appntmnt_popup->set_title( lv_title ) from your code,because it will not make any sense.

If u want any further information regarding to pop-up validation like standard then please provide me the Screen shots of standard along with the screens where u want to raise pop-up .

Reegards,

Ravi Kumar .Y.

Former Member
0 Kudos

Hi Ravi

Thanks A  lot For your Reply.

i am provideing you Details for POPUP Window where in my Development System.

at service order items overview page we have popup window,when we click on that Appointment Button we will see Popup window like below Screen Shots.

The Button Creation Component Name:-BT140I_SRVP

View:-BT140I_SRVP/OVViewSet

The Popup window Component:-BTAPPTOFFER

View:-BTAPPTOFFER/AppntmntOffrEFV

In this Component we have 2 event handlers for popup window

1)EH_ONGETDATES

2)EH_ONCANCLE

In both eventhandler for to get the details when user clicks on Get Appointment in the popup window

i mean its standared.

same thing i need to replicate in the component BT116IT_SRVO

View:-BT116IT_SRVO/GenericItem

Do i Need to create Event handlers as per Component BTAPPTOFFER?

Paste the same code which is written in the 2 Event handler to get same funtionality in my BT116IT_SRVO?

In 3rd Image when i click on Button which is in yellow then i need to show Popup window and same validation which are for Appointment button at Items Details Page.

1 Image

2 Image

3 Image

Thanks

Raj

Former Member
0 Kudos

Hi Raj,

The Validation for the Button Appointments in the standard screen maintained in BT140I_SRVP->BT140I_SRVP/OVViewSet ->Toolbar related Methods ->GET_BUTTONS.

So u have add the following code to get the same validation.

ls_button-enabled = abap_true.

   ls_button-on_click = 'APPNTMNT_OFFER'.

   ls_button-page_id = me->component_id.

   ls_button-text = cl_wd_utilities=>get_otr_text_by_alias( 'CRM_UIU_BT_SALES_ORDER/SORDER_APPNTMNTOFFER' ).

   ls_button-tooltip = cl_wd_utilities=>get_otr_text_by_alias( 'CRM_UIU_BT_SALES_ORDER/SORDER_SCHED_APPOINTMENTS' ).

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

   lr_item ?= lr_coll_wrapper->get_current( ).

* read parameter attribute

   CALL FUNCTION 'CRM_LRP_CUST_APP_PARAM_INFO'

     EXPORTING

       i_application     = gc_app_sbo

     TABLES

       et_app_param_info = lt_parameter.

   IF lt_parameter IS INITIAL.

     ls_button-enabled = abap_false.

     APPEND ls_button TO rt_buttons.

     EXIT.

   ENDIF.

   IF lr_item IS NOT INITIAL.

     lv_guid = lr_item->get_property( iv_attr_name = 'GUID' ).

     ASSIGN lv_guid->* TO <fv_guid>.

     IF <fv_guid> IS NOT INITIAL.

       lr_coll = lr_item->get_related_entities( iv_relation_name = 'BTItemServiceExt' ). "#EC NOTEXT

       lr_property_access = lr_coll->get_current( ).

       IF lr_property_access IS BOUND.

         lv_dispo = lr_property_access->get_property( iv_attr_name = 'DISPO_FLG' ). "#EC NOTEXT

         ASSIGN lv_dispo->* TO <fv_dispo>.

         IF <fv_dispo> IS INITIAL.

           ls_button-enabled = abap_false.

           APPEND ls_button TO rt_buttons.

           EXIT.

         ENDIF.

       ENDIF.

     ENDIF.

   ELSE.

     ls_button-enabled = abap_false.

     APPEND ls_button TO rt_buttons.

     EXIT.

   ENDIF.

Come to part of Event Handlers methods as i know it should work for the your scenario also, so no need of code changes required if it not working then we have work around raising popup with some different inbound plug and based on that we have to handle the events in the BTAPPTOFFER.

First check whether it is working or not,later we can process further.

Regards.

Ravi Kumar .Y

Former Member
0 Kudos

Hi Ravi

Thanks A lot for your reply

as per standared where we need to add this code in my component BT116IT_SRVO?

As per my requriement i implemented in BT116IT_SRVO.in this component to reach standared process

for popup window i just add below code at context node level BTADMINI,GET_OCA_T_TABLE

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

* Start Of Standared Code

CALL METHOD SUPER->GET_OCA_T_TABLE

   EXPORTING

     IV_COMPONENT = IV_COMPONENT

     IV_INDEX     = IV_INDEX

   RECEIVING

     RT_ACTIONS   = RT_ACTIONS.

*End Of Standared Code

data: ls_one_click_action type crmt_thtmlb_one_click_action.

CLEAR ls_one_click_action.

ls_one_click_action-id      = 'APPOINTMENT'.

   ls_one_click_action-icon    = 'appointment.gif'.

   ls_one_click_action-text    = ''.

   ls_one_click_action-tooltip = text-001.

   ls_one_click_action-active  = 'X'.

    append ls_one_click_action to rt_actions.

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

IN The event handler i added below code

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

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_SALES_ORDER/SORDER_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 event handler EH_ONONE_CLICK_ACTION i added below code

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

CASE lv_event.

WHEN 'APPOINTMENT'.

         EH_ONAPPOINTMENT( htmlb_event    = htmlb_event

                   htmlb_event_ex = htmlb_event_ex ).

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

in these 3 placed i implement code apart from this where i need to put the code which you suggest.

please let me know

i have below code in the component BT140I_SRVP

In the GET_BUTTONS

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

   INCLUDE crm_status_con.

   INCLUDE crm_object_types_con.

   DATA   lr_ent     TYPE REF TO cl_crm_bol_entity.

   DATA   current    TYPE REF TO if_bol_bo_property_access.

   DATA   dref       TYPE REF TO data.

   DATAcoll               TYPE REF TO if_bol_entity_col.

   DATAentity             TYPE REF TO cl_crm_bol_entity,

          lr_parent_entity   TYPE REF TO cl_crm_bol_entity.

   DATAlr_node            TYPE REF TO cl_btapptof_bspwdcomponen_cn00,

          lr_coll_wrapper    TYPE REF TO cl_bsp_wd_collection_wrapper,

          lv_data_collection TYPE REF TO if_bol_bo_col,

          lr_item            TYPE REF TO cl_crm_bol_entity,

          lr_wrapper         TYPE REF TO cl_bsp_wd_collection_wrapper,

          lt_parameter       TYPE TABLE OF crm_lrp_app_gra_s.

   DATA: ls_button          TYPE crmt_thtmlb_button_ext,

         lv_enabled         TYPE boolean.

   FIELD-SYMBOLS: <fv_active> TYPE crmt_boolean.

   DATA: lv_guid            TYPE REF TO data,

         lv_dispo           TYPE REF TO data,

         lr_coll            TYPE REF TO if_bol_entity_col,

         lr_property_access TYPE REF TO if_bol_bo_property_access.

   DATA: lr_entity          TYPE REF TO cl_crm_bol_entity,

         lr_items           TYPE REF TO cl_crm_bol_entity,

         lr_adminh          TYPE REF TO cl_crm_bol_entity,

         lv_object_type     TYPE crmt_subobject_category_db.

   FIELD-SYMBOLS: <fv_guid>  TYPE crmt_object_guid,

                  <fv_dispo> TYPE crmt_srv_dispo_flg.

* check if header is incident(service request)/problem, which only support one item

   lr_entity ?= me->typed_context->btadmini->collection_wrapper->get_current( ).

   IF lr_entity IS BOUND.

     lr_items  = lr_entity->get_parent( ).

     lr_adminh = lr_items->get_parent( ).

     lr_adminh->get_property_as_value( EXPORTING iv_attr_name = 'OBJECT_TYPE'

                                       IMPORTING ev_result = lv_object_type ).

     IF lv_object_type = gc_object_type-incident

     OR lv_object_type = gc_object_type-problem.

* only DONE button (back to header-ov)

       ls_button-type     = cl_thtmlb_util=>gc_done.

       ls_button-on_click = gc_ev_done.

       ls_button-enabled  = abap_true.

       ls_button-page_id  = me->component_id.

       APPEND ls_button TO rt_buttons.

       CLEAR ls_button.

* Toolbar Divider

       ls_button-type     = cl_thtmlb_util=>gc_separator.

       ls_button-enabled  = abap_true.

       APPEND ls_button TO rt_buttons.

       CLEAR ls_button.

     ELSE.

* DONE and other general buttons

       rt_buttons = super->if_bsp_wd_toolbar_callback~get_buttons( ).

     ENDIF.

   ENDIF.

****

* Preview Button

   gv_print_preview_enabled = abap_true.

   ls_button-text     = cl_wd_utilities=>get_otr_text_by_alias( 'CRM_UIU_BT/PRINT_PREVIEW' ). "#EC NOTEXT

   ls_button-on_click = 'PRINT_PREVIEW'.                     "#EC NOTEXT

   ls_button-page_id  = me->component_id.

   ls_button-enabled  = abap_true.

   APPEND ls_button TO rt_buttons.

   CLEAR ls_button.

********

   ls_button-enabled = abap_true.

   ls_button-on_click = 'APPNTMNT_OFFER'.

   ls_button-page_id = me->component_id.

   ls_button-text = cl_wd_utilities=>get_otr_text_by_alias( 'CRM_UIU_BT_SALES_ORDER/SORDER_APPNTMNTOFFER' ).

   ls_button-tooltip = cl_wd_utilities=>get_otr_text_by_alias( 'CRM_UIU_BT_SALES_ORDER/SORDER_SCHED_APPOINTMENTS' ).

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

   lr_item ?= lr_coll_wrapper->get_current( ).

* read parameter attribute

   CALL FUNCTION 'CRM_LRP_CUST_APP_PARAM_INFO'

     EXPORTING

       i_application     = gc_app_sbo

     TABLES

       et_app_param_info = lt_parameter.

   IF lt_parameter IS INITIAL.

     ls_button-enabled = abap_false.

     APPEND ls_button TO rt_buttons.

     EXIT.

   ENDIF.

   IF lr_item IS NOT INITIAL.

     lv_guid = lr_item->get_property( iv_attr_name = 'GUID' ).

     ASSIGN lv_guid->* TO <fv_guid>.

     IF <fv_guid> IS NOT INITIAL.

       lr_coll = lr_item->get_related_entities( iv_relation_name = 'BTItemServiceExt' ). "#EC NOTEXT

       lr_property_access = lr_coll->get_current( ).

       IF lr_property_access IS BOUND.

         lv_dispo = lr_property_access->get_property( iv_attr_name = 'DISPO_FLG' ). "#EC NOTEXT

         ASSIGN lv_dispo->* TO <fv_dispo>.

         IF <fv_dispo> IS INITIAL.

           ls_button-enabled = abap_false.

           APPEND ls_button TO rt_buttons.

           EXIT.

         ENDIF.

       ENDIF.

     ENDIF.

   ELSE.

     ls_button-enabled = abap_false.

     APPEND ls_button TO rt_buttons.

     EXIT.

   ENDIF.

   coll = lr_item->get_related_entities( iv_relation_name = 'BTAssignmentAll' ). "#EC NOTEXT

   IF coll->size( ) <> 0.

     ls_button-enabled = abap_false.

     APPEND ls_button TO rt_buttons.

     EXIT.

   ENDIF.

   CLEAR coll.

   TRY.

       coll = lr_item->get_related_entities(

                iv_relation_name = 'BTItemStatusSet' ).      "#EC NOTEXT

       current = coll->get_current( ).

       IF current IS NOT BOUND.

         ls_button-enabled = abap_false.

         APPEND ls_button TO rt_buttons.

         EXIT.

       ENDIF.

       entity ?= current.

       coll = entity->get_related_entities(

                iv_relation_name = 'BTStatusI_I1004' ).      "#EC NOTEXT

       current = coll->get_current( ).

       IF current IS NOT BOUND.

         ls_button-enabled = abap_false.

         APPEND ls_button TO rt_buttons.

         EXIT.

       ENDIF.

       TRY.

           dref = current->get_property( 'ACTIVE' ).         "#EC NOTEXT

         CATCH cx_crm_cic_parameter_error.

           ls_button-enabled = abap_false.

           APPEND ls_button TO rt_buttons.

           EXIT.

       ENDTRY.

       ASSIGN dref->* TO <fv_active>.

       IF <fv_active> = abap_false.

         ls_button-enabled = abap_false.

         APPEND ls_button TO rt_buttons.

         EXIT.

       ENDIF.

     CATCH cx_sy_ref_is_initial cx_sy_move_cast_error

           cx_crm_genil_model_error.

       ls_button-enabled = abap_false.

       APPEND ls_button TO rt_buttons.

       EXIT.

   ENDTRY.

   IF lr_item->is_changeable( ) = abap_false.

     ls_button-enabled = abap_false.

     APPEND ls_button TO rt_buttons.

     EXIT.

   ENDIF.

   APPEND ls_button TO rt_buttons.

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

Thanks

Raj


Answers (0)