Application Development and Automation 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: 
Read only

Execute button in ALV

Former Member
0 Likes
2,282

Hi,

I am creating an execute button in my ALV report output.

I have created a z status named ZSTANDARD_FULLSCREEN (a copy of standard_fullscreen) through se41 and added the execute button named BDC. While in coding i have made the following changes

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_CALLBACK_PROGRAM     = SY-REPID
      I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
      I_CALLBACK_TOP_OF_PAGE = 'TOP-OF-PAGE'
      I_GRID_TITLE           = 'GENERATE DISCONNECTION ORDERS'
      IS_LAYOUT              = WA_LAYOUT
      IT_FIELDCAT            = I_FCAT  "FIELDCAT
      I_CALLBACK_USER_COMMAND = 'USER_COMMAND'

      IT_SORT                = I_SORT[]
*      IT_EXCLUDING  = IT_MENU

    TABLES
      T_OUTTAB               = I_FINAL.


      DATA: RS_SELFIELD TYPE SLIS_SELFIELD.
.
      SET PF-STATUS 'ZSTANDARD_FULLSCREEN'.

      AT USER-COMMAND.
      IF SYUCOMM = 'BDC'.
      EXIT.

But the execute button is still not coming. I have read almost all the post related to this topic but none of them suffice. Please help.

Added code tags

Edited by: Rob Burbank on Jan 17, 2012 1:30 PM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,548

Well, you have to put the button logic in a form named USER_COMMAND.

Rob

7 REPLIES 7
Read only

Former Member
0 Likes
1,549

Well, you have to put the button logic in a form named USER_COMMAND.

Rob

Read only

sjeevan
Active Contributor
0 Likes
1,548

This is a basic question you can find lot of threads if you search properly

eg:

Read only

Former Member
0 Likes
1,548

Hi Shahruk,

I understood your problem. See are using I_CALLBACK_USER_COMMAND = 'USER_COMMAND'.

Here whatever you give after I_CALLBACK_USER_COMMAND must be a subroutine name.

So create a subroutine named USER_COMMAND and in that subroutine write your logic for user interaction.

Hope this helps....

Best Regards.

Aswath.

Read only

Former Member
0 Likes
1,548

SET PF-STATUS 'ZSTANDARD_FULLSCREEN'.

where have you written this?

there should be a subroutine named SET_PF_STATUS in your program inside which you should write this line

Read only

Harsh_Bansal
Contributor
0 Likes
1,548

Hi,


CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_CALLBACK_PROGRAM     = SY-REPID
      I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
      I_CALLBACK_TOP_OF_PAGE = 'TOP-OF-PAGE'
      I_GRID_TITLE           = 'GENERATE DISCONNECTION ORDERS'
      IS_LAYOUT              = WA_LAYOUT
      IT_FIELDCAT            = I_FCAT  "FIELDCAT
      I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
      IT_SORT                = I_SORT[]
*      IT_EXCLUDING  = IT_MENU
 
    TABLES
      T_OUTTAB               = I_FINAL.
 
 
      DATA: RS_SELFIELD TYPE SLIS_SELFIELD.
.SET PF-STATUS 'ZSTANDARD_FULLSCREEN'
 
      AT USER-COMMAND.
      IF SYUCOMM = 'BDC'.
      EXIT.

For this, you need to create 2 new forms(subroutines).

One for PF-status named SET_PF_STATUS

and other for User command named USER_COMMAND

then write

      SET PF-STATUS 'ZSTANDARD_FULLSCREEN'. 

in set_pf_status form

&

      DATA: RS_SELFIELD TYPE SLIS_SELFIELD.
.

 
      AT USER-COMMAND.
      IF SYUCOMM = 'BDC'.
      EXIT. 

in user_command form.

Regards,

Harsh Bansal

Read only

Former Member
0 Likes
1,548

Hi

As Many Have already specified: Here is the solution:

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = SY-REPID

I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'

I_CALLBACK_TOP_OF_PAGE = 'TOP-OF-PAGE'

I_GRID_TITLE = 'GENERATE DISCONNECTION ORDERS'

IS_LAYOUT = WA_LAYOUT

IT_FIELDCAT = I_FCAT "FIELDCAT

I_CALLBACK_USER_COMMAND = 'USER_COMMAND'

IT_SORT = I_SORT[]

  • IT_EXCLUDING = IT_MENU

TABLES

T_OUTTAB = I_FINAL.

New Performs in urProgram:


FORM set_pf_status USING fp_extab TYPE slis_t_extab.        "#EC CALLED

  SET PF-STATUS 'ZSTANDARD_FULLSCREEN' EXCLUDING fp_extab.

ENDFORM.                    " set_pf_status

FORM user_command USING fp_ucomm TYPE syucomm
                                                fp_slfld TYPE slis_selfield.

  CASE fp_ucomm.
WHEN 'BDC'.
XXXXXXXX
ENDCASE.

ENDFORM.
 

Read only

Former Member
0 Likes
1,548

Thanks every1 for replies..