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: 

Execute button in Interactive alv

kanishakgupta1
Contributor
0 Kudos

hi,

i have a requirement where in the alv is displayed and then i should select one of the lines out of alv grid and then click on execute button to perform some function which displays again ALV

I am able toactivate the double click event like if i double click on selected record from ALV,i would be able to perform the further function but does not any body know how to create an execute button in ALV and then perform action on clicking execute button

kanishak

3 REPLIES 3

former_member418469
Participant
0 Kudos

hi,

Go to tcode SE41, copy SAPLKKBL with status 'standard' to your custom program with status 'ZZZZ'. Change your status, insert a button execute with function code. In the code assign :

Call function 'REUSE_ALV_LIST_DISPLAY'

Exporting

I_CALLBACK_USER_COMMAND = 'USER_COMMAD'.

form USER_COMMAND using r_ucomm like sy-ucomm

rs_selfield type slis_selfield.

if r_ucomm = 'EXEC'. "Execute

write your code

ENDOFRM.

Former Member
0 Kudos

Hi kanishak,

There are lot of topics discussed in SCN related to this. You can get lots of samples as to your issue.

Copy the STANDARD GUI status from report SAPLKKBL using

T-Code SE80--->Programming Sub-objects--->GUI status.

Code:

call function 'REUSE_ALV_GRID_DISPLAY' 
         exporting  i_callback_program = gc_repid 
                    I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS' 
                    I_CALLBACK_USER_COMMAND  = 'USER_COMMAND' 
                    i_grid_title       = lc_grid_title 
                    is_layout          = lc_layout 
                    it_fieldcat        = gt_fieldcat 
                    it_sort            = sort 
                    i_save             = l_save 
                    is_reprep_id       = l_bbs_id 
                    is_variant         = l_variant 
         tables     t_outtab           = it_final 
         exceptions program_error      = 1 
                    others             = 2.

The parameters in capitals are the extra ones that need to be added.

I355602
Advisor
Advisor
0 Kudos

Hi,

Refer wiki code by me on ALV with Checkbox and process selected records at run-time:-

https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/alv%252bgrid%252bdisplay%252bwith%252bch...

Hope this helps you.

Regards,

Tarun Gambhir