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: 

Question ABout ALV GRIDS

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hey Vicky,

I have uploaded a PDF on ALV on this link :

http://esnips.com/doc/ad20dca9-6182-4903-8d8f-96a66dc8590c/ALV.pdf

You go through this, your functionality will be achieved.

Thanks and Regards,

Kunal.

7 REPLIES 7

Former Member
0 Kudos

Hi vicky,

1. The important things are :

a) New PF-STATUS is required , say 'ABCD'.

b) Handle user_commmand

2. First of all, from Function group SALV,

copy the STANDARD gui status to your program,

from SE80, by right clicking.

3. come to your program.

start-of-selection.

SET PF-STATUS 'ABCD'.

4. Double click ABCD and activate the gui status.

6. AT USER-COMMAND.

IF sy-ucomm = 'MYFCODE'.

ENDIF.

regards,

amit m.

0 Kudos

Did you see the program BCALV_TEST_FULLSCREEN_CALLS?

Regards,

Ravi

Note : Please mark the helpful answers

Former Member
0 Kudos

HI

TRY THIS OUT LINK

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

THANKS

MRUTYUN

Former Member
0 Kudos

Hi Vicky,

Refer this pdf link...it ll definitely help u..

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d97...

Rewward points if it helps.

With Regards,

Manikandan R

Former Member
0 Kudos

Hi Vicky,

You can do that... First copy the pf-status of the standard program SAPLSALV into your program.In that, just add an extra Function code .

Just refer to my post in this link. It contains a samplej program also..

Regards,

SP.

Former Member
0 Kudos

Hey Vicky,

I have uploaded a PDF on ALV on this link :

http://esnips.com/doc/ad20dca9-6182-4903-8d8f-96a66dc8590c/ALV.pdf

You go through this, your functionality will be achieved.

Thanks and Regards,

Kunal.

0 Kudos

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!!