Professional Documents
Culture Documents
Hom e Tra i ni ngs Qui z Ti ps Tutori a l s Functi ona l Ce rt Q's I nte rvi e w Q's Jobs Te sti m oni a l s Adve rti se Conta ct Us
SAP Virtual/Onsite
Trainings
Document Categories:
ABAPTM
Adobe Forms
ABAP-HR
ALE & IDocs
ALV
BAPI
BASIS
BSP
Business Objects
Business Workflow
CRM NEW
LSMW
SAP Script/Smart Forms
BI/BW
eXchange Infrastructure (XI)
Enterprise Portals (EP)
eCATT
Object Oriented Programming
SAP Query
Userexits/BADIs
WebDynpro for Java/ABAPTM
Others
What's New?
ABAP Test Cockpit HOT
SAP ABAP Pragmas
Understanding SE32 (ABAP
Text Element Maintenance)
Creating an IDoc File on SAP
Application Server
Understanding Advance with
dialog option of SAP Workflow
*&---------------------------------------------------------------------*
*&Report:ZALV_TOOLBAR
*
*&Author : Swarna.S
*&---------------------------------------------------------------------*
*& AS : ALV report with user defined buttons on its toolbar
*& and when clicking the last yellow button(arrow) can display the
*& toolbar and expand it in three steps
*---------------------------------------------------------------------*
REPORT zalv_toolbar.
pdfcrowd.com
Contribute?
Sample Specs
*Initialization event
INITIALIZATION.
*Start of selection event
START-OF-SELECTION.
What's Hot?
Web Dynpro for ABAP Tutorials
Join the Mailing List
Enter name and email address below :
Name:
pdfcrowd.com
Name:
*
ALV event handler
*---------------------------------------------------------------------*
CLASS lcl_alv_toolbar DEFINITION.
PUBLIC SECTION.
Email:
Subscribe
Unsubscribe
GO
*Constructor
METHODS: constructor
IMPORTING
io_alv_grid TYPE REF TO cl_gui_alv_grid,
*Event for toolbar
on_toolbar
FOR EVENT toolbar
OF cl_gui_alv_grid
IMPORTING
e_object.
ENDCLASS.
"lcl_alv_toolbar DEFINITION
*---------------------------------------------------------------------*
*
CLASS lcl_alv_toolbar IMPLEMENTATION
*---------------------------------------------------------------------*
*
ALV event handler
*---------------------------------------------------------------------*
CLASS lcl_alv_toolbar IMPLEMENTATION.
METHOD constructor.
*
"constructor
METHOD on_toolbar.
*
*
pdfcrowd.com
ENDMETHOD.
ENDCLASS.
"on_toolbar
"lcl_alv_toolbar IMPLEMENTATION
*&---------------------------------------------------------------------*
*&
Form fetch_data
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
* --> p1
text
* <-- p2
text
*----------------------------------------------------------------------*
FORM fetch_data .
* Select the tcodes upto 200 rows from TSTC
SELECT
tcode
pgmna
FROM tstc
INTO CORRESPONDING FIELDS OF TABLE it_table
UP TO 200 ROWS
WHERE dypno NE '0000'.
For texts
READ TABLE it_ittext INTO wa_ittext WITH KEY tcode = wa_table-tcode.
wa_output-ttext = wa_ittext-ttext.
pdfcrowd.com
" alv_output
pdfcrowd.com
" ALV_GRID
OUTPUT
*&---------------------------------------------------------------------*
*&
Form alv_build_fieldcat
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
*
<--P_IT_FCAT text
*----------------------------------------------------------------------*
FORM alv_build_fieldcat.
DATA lv_fldcat TYPE lvc_s_fcat.
CLEAR lv_fldcat.
lv_fldcat-row_pos
lv_fldcat-col_pos
lv_fldcat-fieldname
lv_fldcat-tabname
lv_fldcat-outputlen
lv_fldcat-scrtext_m
=
=
=
=
=
=
'1'.
'1'.
'TCODE'.
'IT_OUTPUT'.
8.
'TCODE'.
=
=
=
=
=
=
'1'.
'2'.
'PGMNA'.
'IT_OUTPUT'.
15.
'PROGNAME'.
pdfcrowd.com
=
=
=
=
=
=
'1'.
'3'.
'TTEXT'.
'IT_OUTPUT'.
60.
'Description'.
" alv_build_fieldcat
*&---------------------------------------------------------------------*
*&
Form alv_report_layout
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
*
<--P_IT_LAYOUT text
*----------------------------------------------------------------------*
FORM alv_report_layout.
it_layout-cwidth_opt = 'X'.
it_layout-zebra = 'X'.
ENDFORM.
" alv_report_layout
" USER_COMMAND_0600
INPUT
Output:
pdfcrowd.com
pdfcrowd.com