07-21-2005 7:19 PM
Hello guys,
I have a question here.
1. How to add a custom button to the application toolbar.
Rgds,
07-21-2005 7:35 PM
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
07-22-2005 4:23 AM
Hi Naren,
Check this:
http://www.sapdevelopment.co.uk/reporting/selscr/but_appbut.htm
Also refer the program: BCALV_GRID_05
Regards,
Anjali
07-22-2005 4:25 AM
Hi,
Look at this sample code,
http://www.sap-basis-abap.com/abap/add-button-to-alv-toolbar-with-reuse-alv-list-display.htm
http://www.planetsap.com/Tips_and_Tricks.htm
Hope this helps.
Thanks & Regards,
Judith.
07-22-2005 4:35 AM
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.
07-22-2005 6:27 AM
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
07-22-2005 9:10 AM
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
07-22-2005 12:10 PM
In the PF Status the function Code should start with '&'
for Button Display