cancel
Showing results for 
Search instead for 
Did you mean: 

How to Add buttons to an Overview Page and View Set?

Former Member
0 Kudos

HI Guru,

How to add buttons in Overview Page and View Set? I also heard there is one way of adding code in Layout(View Set) and

something other way also. Can someone please explain all of that?

Thank You,

Durgesh Pagar.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Overview Page actually doesn't have an html page.

So, you will have to do it in the IF_BSP_WD_TOOLBAR_CALLBACK~GET_BUTTONS method.

Former Member
0 Kudos

hi

I have similar requirement where in which i need to add button in the over view page

so in   IF_BSP_WD_TOOLBAR_CALLBACK~GET_BUTTONS i have pasted this code

   DATA: ls_button     TYPE crmt_thtmlb_button.
  CLEAR gt_button.
  ls_button-type     = cl_thtmlb_util=>gc_icon_textcomponent.
  ls_button-text     = 'IR NOTES'.
  ls_button-on_click = 'IRNOTE'.
  ls_button-enabled  = abap_true.
  APPEND ls_button TO gt_button.
  CLEAR ls_button.

but still i could not c any button....

please help me what next i need to do?

AlexShipilov
Product and Topic Expert
Product and Topic Expert
0 Kudos

Are you sure your code is activated correctly?

There is no gt_button attribute in the overview.

Answers (2)

Answers (2)

Former Member
0 Kudos

To add to Robert's answer,

1. View Set - Buttons are kept in the signature RT_BUTTONS (internal table) of method IF_BSP_WD_TOOLBAR_CALLBACK~GET_BUTTONS in the view controller.

2. Vew - You need to find out the button internal table first.

- Go to the HTML page of the view, find the thtmb toolbar tag like below:


<thtmlb:toolbar id              = "tb1"
                buttons         = "<%= controller->gt_button %>"
                maxButtonNumber = "6" />

- Here the button table is the public attribute gt_button of the view controller

- Then in the DO_PREPARE_OUTPUT, method, you can add the button into the table.

robert_kunstelj
Active Contributor
0 Kudos

If you want to have button in toolbar area the define new button in method IF_BSP_WD_TOOLBAR_CALLBACK~GET_BUTTONS. If you want to have it placed in top of the view, then define it in method DO_PREPARE_OUTPUT.

Former Member
0 Kudos

Thank so much 'Robert Kunstelj' and 'Peng Wah Ng'.

Please let me know is it possible for both or only for View set? if so then how can we add button in Overview Page.

robert_kunstelj
Active Contributor
0 Kudos

Yes, it is possible.

To add button to ovrview, do:

1. under attributes of class add attribute GT_BUTTON

2. Redefine method u2018DO_PREPARE_OUTPUTu2019 and add code..

DATA ls_button TYPE crmt_thtmlb_button.

CLEAR gt_button.

ls_button-type = cl_thtmlb_util=>GC_ICON_OBJECT_USER.

ls_button-text = 'some text'

ls_button-on_click = 'event name'.

ls_button-enabled = ABAP_TRUE.

INSERT ls_button INTO TABLE gt_button.

3. redefine the layout of *.htm file and add code...

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

maxButtonNumber = "3" />