cancel
Showing results for 
Search instead for 
Did you mean: 

Create PushButton.

Former Member
0 Kudos

Hi,

Is it possible to create push button for a field in table view in SAO CRM WEBUI?

Suppose tableview contains the fields Action, Cat Description, Date.

Now I want to put pushbutton for "Action" field for all the records in the table view.

Is it POssible.

Regards,

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

I need to create pushbutton for every record in tableview but not on the top. Is it not possible?

Regards,

Former Member
0 Kudos

Hello,

yes it is of course possible to have buttons on each line:

You could use the concept of one click actions - see for example attribute THTMLB_OCA in view BP_DATA\AccountContactsOV.

Or you can add the button in each of your own columns.

Change the attribute which represents the column:

GET_P Method: Display an image instead of text an call onclick eventhandler

CASE iv_property.

      WHEN if_bsp_wd_model_setter_getter=>fp_fieldtype.
          rv_value = if_bsp_dlc_view_descriptor=>field_type_image.


      WHEN if_bsp_wd_model_setter_getter=>fp_onclick.
        rv_value = 'PRESALES'.
     ENDCASE.

In the GET Method of the Attribute you have to use the icon URL as value:

CALL METHOD cl_thtmlb_util=>get_icon_info
      EXPORTING
     iv_icon_type       = cl_thtmlb_util=>gc_icon_foldershortcut
*    iv_browser_type    = 2
*    iv_browser_version = 700
*    iv_get_new_icons   =
      IMPORTING
*    ev_icon_title      =
*    ev_icon_tooltip    =
        ev_icon_filename   = lv_filename
*    ev_display_title   =
*  EXCEPTIONS
*    unknown_type       = 1
*    others             = 2
            .
    IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.


    CALL METHOD cl_thtmlb_util=>get_icon_url
      EXPORTING
        iv_icon_name    = lv_filename
*       iv_skin         =
*       iv_absolute_url = 'FALSE'
      RECEIVING
        ev_url          = value
        .

And of course you have to create your eventhandler with the name you used in GET_P and code your logic there.

Good luck.

Kind regards

Manfred

Former Member
0 Kudos

Hi Manfred,

For this code some other button is coming. But I need only Push Buttons.

Regards,

Pushpa

Former Member
0 Kudos

Hi Manfred,

Thank you verymuch for your reply.

My scenario is like this.

I have a table view with the following fields Action, Cat Description, Date. These fields will get populated from Z-table.

For Action field there are two values Run, Assess. For Action field I want to create pushbutton(Coloumnwise for all records).

Regards,

Pushpa

Former Member
0 Kudos

Hi Pushpa,

if you want to work with all records in the tableview i recommend one button on top of the table assignmentblock.

1. Create in the IMPL Class one new attribute GT_BUTTON (instance public) from type CRMT_THTMLB_BUTTON_T.

2. Redefine "do_prepare_output" to code your button, see example:

method DO_PREPARE_OUTPUT.

  DATA: ls_button  TYPE crmt_thtmlb_button.

  CALL METHOD super->do_prepare_output.

  DATA: lr_profile TYPE REF TO IF_CRM_UI_PROFILE,
          lv_profile_type TYPE CRMT_UI_PROFILE_TYPE,
          lr_uiu_channel_aspects TYPE REF TO object.

  lr_profile = cl_crm_ui_profile=>get_instance( ).
  lv_profile_type = lr_profile->get_profile_type( ).

  CASE lv_profile_type.
    WHEN if_crm_uiu_channel_aspects=>gc_profile_TYPE_UIU.
      IF gt_button IS INITIAL.
*   here the name of the button and the event is determine
        ls_button-type     = cl_thtmlb_util=>gc_icon_new.
        ls_button-on_click = 'NEW'.
        ls_button-enabled = abap_true.
        APPEND ls_button TO gt_button.
        CLEAR ls_button.

      ENDIF.
  ENDCASE.

endmethod.

3. Go to the .htm page and add some lines like this:

<thtmlb:areaFrameSetter toolbarButtons  = "<%= controller->gt_button %>"
                        maxButtonNumber = "1" />

4. No create the eventhandler you have coded in ls_button-on_click and create your coding for the button click there.

Good luck.

Kind regards

Manfred

Former Member
0 Kudos

Hi,

yes it is possible to have buttons on top of an assignmentblock and it is also possible to have buttons on each line of the table.

Please specify your requirement a bit more and we will try to help you.

Kind regards

Manfred