Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Question ABout ALV GRIDS

Hi,

I need to add a custom button to the alv grid menu and i couldnt able to see the screen when i execute this program. Will u please tell me how to add a new button to the existing application toolbar of the ALV grid. I had tried this code but couldnt succeeded.

Here is my code.

REPORT ZZZZ .

&----


*& Report ZZZZ

*&

&----


*&

*&

&----


type-pools: slis.

  • Data to be displayed

data: gt_wrkpool type table of zte_wrkpool.

data: gs_wrkpool type zte_wrkpool.

data: gs_layout type slis_layout_alv.

DATA:G_REPID TYPE SY-REPID.

----


  • Selection

select * from zte_wrkpool into corresponding fields of table gt_wrkpool.

  • Eingabebereit

gs_layout-edit = 'X'.

G_REPID = SY-REPID.

  • Call ABAP List Viewer (ALV)

call function 'REUSE_ALV_GRID_DISPLAY'

exporting

I_CALLBACK_PROGRAM = g_repid

I_CALLBACK_USER_COMMAND = 'ACTION'

I_CALLBACK_PF_STATUS_SET = 'PF_STATUS'

i_structure_name = 'zte_wrkpool'

is_layout = gs_layout

  • IT_SORT = SORT[]

  • IT_EVENTS = events[]

tables

t_outtab = gt_wrkpool.

FORM pf_status_set USING gt_extab TYPE slis_t_extab.

SET PF-STATUS <ZSTANDARD>.

ENDFORM.

Create another subroutine:

&----


*& Form user_command

&----


  • Takes the User command and acts accordingly

----


FORM user_command USING r_ucomm LIKE sy-ucomm

rs_selfield TYPE slis_selfield.

call function 'sAP_WI_FORWARD'

..............

endform.

Tags:
replied

Checkout these !!

/people/ravikumar.allampallam/blog/2005/12/07/need-a-way-to-add-custom-buttons-to-standard-alv-report-toolbar--part-ii

http://www.sapgenie.com/abap/controls/alvgrid.htm#Customize%20the%20appearence%20of%20the%20grid

http://www.abap4.it/download/ALV.pdf

also if you search on SDN , you`ll find lots of post with code!!

Help on ALV u0096 to add a button to PF-STATUS

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question