Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Adding a button to the application toolbar

Former Member
0 Kudos

Hello guys,

I have a question here.

1. How to add a custom button to the application toolbar.

Rgds,

7 REPLIES 7

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

You can add a button my modifying the GUI Status. In your program double click on the statement SET PF-STATUS 'XXX'. This will take you to the gui status. Add your button there. If you are working with a report program and there is no statement like this, then you can add it. Before you start writing your list, just make sure that you have this statement.



SET PF-STATUS 'LIST'.

Regards,

Rich Heilman

Former Member
0 Kudos

Hi Naren,

Check this:

http://www.sapdevelopment.co.uk/reporting/selscr/but_appbut.htm

Also refer the program: BCALV_GRID_05

Regards,

Anjali

Former Member

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

Create a GUI status.In that go to Application toolbar.

In that enter the name of the button you want to create in Application toolbar[1-7] and then press enter.In the dialog box that is appearing after that,choose static text and then enter Function text.Then choose something in the popup next appearing for Assign Function to Function Key.Activate the GUI status.

Then in the PBO of the screen you created in the report,

write the following code.

SET PFSTATUS 'ZSTATUS'.

Here ZSTATUS is the name of the GUI you created.

While executing the report,you can see the custom button created.

Hope this helps.If so,reward points.

Former Member
0 Kudos

Hi,

1. create GUI status with "Status" name and "Short text"

2. Now a screen will appear with the following,

a. Menu Bar

b. Application tool bar

c. Function keys

3. Click the down arrow near the application toolbar

4. Enter the function code like SAVE, EXIT, etc., You

can also give ur own meaningful naming convention .

For example ( ZTEST)

5. Now press enter, it will ask for "Static text" or "Dynamic Text". Choose Static text and press enter

6. Now it will ask for function text and Icon name. Specify some function text ( what it does ) and Icon name u want to attach.

7. Press enter. It will ask for function keys. Specify a function key and press enter.

8. Now u can handle this function code (ZTEST) either in PBO/PAI like IF FUNCTION = ZTEST ...ENDIF

Note:

Don't forget to set the GUI status u have created in PBO event.

Example code to set PF status.

PROCESS BEFORE OUTPUT.

MODULE liste_initialisieren.

MODULE setstatus_0100.

LOOP AT extract WITH CONTROL

tctrl_ztufi_league CURSOR nextline.

MODULE liste_show_liste.

ENDLOOP.

In the above MODULE setstatus_0100 do the following,

SET PF-STATUS 'ZGUI'. ( The GUI status u have created).

I hope this helps you.

Regs,

venkat

athavanraja
Active Contributor
0 Kudos

if you want to do this in report program selection scree,

you can do the following.

REPORT  ytest.
TABLES:  sscrfields .
INCLUDE <icon> .

SELECTION-SCREEN FUNCTION KEY 1 .
parameters: pc(1) .

INITIALIZATION .


  CONCATENATE icon_next_object 'test button at applicatin toolbar'
  INTO
       sscrfields-functxt_01 .


AT SELECTION-SCREEN.

  IF sscrfields-ucomm EQ 'FC01' .

    break sy-uname .
  ENDIF .

Regards

Raja

Former Member
0 Kudos

In the PF Status the function Code should start with '&'

for Button Display