Escolar Documentos
Profissional Documentos
Cultura Documentos
Blog Archive
*&---------------------------------------------------------------------*
*& Report ZAPP_BUTTTON_RPT ►
► 2017 (1)
*&---------------------------------------------------------------------* ►
► 2015 (2)
▼
▼ 2013 (16)
REPORT zapp_buttton_rpt.
►
► December (1)
TYPE-POOLS: slis. " SLIS contains all the ALV data types ▼
▼ November (1)
Step by Step Procedure to add Button in
*&---------------------------------------------------------------------* Applicatio...
*& Data Declaration
►
► October (7)
*&---------------------------------------------------------------------*
DATA: t_sbook TYPE TABLE OF sbook. ►
► September (1)
DATA: t_fieldcat TYPE slis_t_fieldcat_alv, ►
► June (6)
x_fieldcat TYPE slis_fieldcat_alv.
About Me
*--Fetch the required data from databaase table
SELECT * FROM sbook INTO TABLE t_sbook. Venugopal M Nanjappa
x_fieldcat-fieldname = 'CONNID'.
x_fieldcat-seltext_m = 'Con. No.'.
APPEND x_fieldcat TO t_fieldcat.
CLEAR x_fieldcat.
Step-2: Save, Activate and Execute the above program. Output of the program looks like as
follows.
http://oneabap.blogspot.com/2013/11/problem-statement-insome-situation.html 1/6
1/30/2019 ABAP - Learner's Guide: Step by Step Procedure to add Button in Application Toolbar in ALV Output: SAP ABAP
Step-3:
Select the CHECKBOX corresponds to STANDARD.
From Menu, go to GUI Status >> Copy (Click On COPY)
Step-4: Popup window appears, fill the details as follows and click on 'COPY'.
http://oneabap.blogspot.com/2013/11/problem-statement-insome-situation.html 2/6
1/30/2019 ABAP - Learner's Guide: Step by Step Procedure to add Button in Application Toolbar in ALV Output: SAP ABAP
Step-6: Now the GUI status is copied to your program. This can be seen as below.
Step-7: Double click on the 'ZSTANDARD' GUI Status. It will take you to below screen.
Step-8: Enter the function code as '&BUT' as shown above and double click on the same to
proceed further.
Upon double clicking following screen appears, select 'Static Text' Radio Button and press OK.
Step-9: Below screen appears, enter Function text, Icon Name and Information Text as show
below and press OK.
http://oneabap.blogspot.com/2013/11/problem-statement-insome-situation.html 3/6
1/30/2019 ABAP - Learner's Guide: Step by Step Procedure to add Button in Application Toolbar in ALV Output: SAP ABAP
As you can see in the above figure, we have selected "Folder Icon". You select the icon of your
interest by F4 help on Icon name field.
Step-9: Assign Function to function key. In our example we have selected "Shift-F1", then press
OK.
Step-10: Below screen appears, now validate the data entered and press OK.
Step-12: Now go back to your program. Copy and Paste the below code. SAVE and ACTIVATE
the program.
*&---------------------------------------------------------------------*
*& Report ZAPP_BUTTTON_RPT
*&---------------------------------------------------------------------*
REPORT zapp_buttton_rpt.
TYPE-POOLS: slis. " SLIS contains all the ALV data types
*&---------------------------------------------------------------------*
*& Data Declaration
*&---------------------------------------------------------------------*
DATA: t_sbook TYPE TABLE OF sbook.
DATA: t_fieldcat TYPE slis_t_fieldcat_alv,
x_fieldcat TYPE slis_fieldcat_alv.
*&---------------------------------------------------------------------*
*& START-OF-SELECTION
*&---------------------------------------------------------------------*
START-OF-SELECTION.
http://oneabap.blogspot.com/2013/11/problem-statement-insome-situation.html 4/6
1/30/2019 ABAP - Learner's Guide: Step by Step Procedure to add Button in Application Toolbar in ALV Output: SAP ABAP
x_fieldcat-fieldname = 'CONNID'.
x_fieldcat-seltext_m = 'Con. No.'.
APPEND x_fieldcat TO t_fieldcat.
CLEAR x_fieldcat.
*&---------------------------------------------------------------------*
*& Form sub_pf_status
*&---------------------------------------------------------------------*
* Sub-Routine to Set the PF status
*----------------------------------------------------------------------*
FORM sub_pf_status USING rt_extab TYPE slis_t_extab..
SET PF-STATUS 'ZSTANDARD'.
ENDFORM. "sub_pf_status
*&---------------------------------------------------------------------*
*& Form user_command
*&---------------------------------------------------------------------*
* Sub-Routine to handle the click on the ALV aoutput
*----------------------------------------------------------------------*
FORM user_command USING r_ ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
IF r_ucomm EQ '&BUT'.
MESSAGE 'Custom button is clicked.' TYPE 'S'.
ENDIF.
ENDFORM. "User_command
Step-13: Execute(F8) the program. Now we can see the newly added BUTTON in application
toolbar.
Click on the button to see the success message written in the code.
Conclusion:
Thus we have learnt the procedure to add the Button in Application Toolbar in ALV Output.
Regards,
Venugopal M N
No comments:
http://oneabap.blogspot.com/2013/11/problem-statement-insome-situation.html 5/6
1/30/2019 ABAP - Learner's Guide: Step by Step Procedure to add Button in Application Toolbar in ALV Output: SAP ABAP
Post a Comment
Publish Preview No
http://oneabap.blogspot.com/2013/11/problem-statement-insome-situation.html 6/6