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: 

Need To Add One Button in The Output

Former Member
0 Kudos

Hi Freinds,

can any one tell how to add one button in the application

tool bar, that is at the final ALV out put screen

9 REPLIES 9

Former Member
0 Kudos

Hi ,

check this one .

regards

Prabhu

GauthamV
Active Contributor
0 Kudos

hi,

create pf status using se41 and use this statement in ur program.

ex:

set pf-status 'ZSET'.

Former Member
0 Kudos

Hi,

data: c_pf_status_set TYPE slis_formname VALUE 'PF_STATUS_SET'.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_interface_check = ' '

i_callback_program = l_repid

i_callback_user_command = c_user_command

i_callback_pf_status_set = c_pf_status_set

is_layout = ls_layout

it_fieldcat = pa_fieldcat[]

  • it_sort = tbl_sortcat

  • it_events = tbl_eventcat

  • i_save = 'X' "Allow variants to be saved

  • is_variant = g_variant

TABLES

t_outtab = pa_output

EXCEPTIONS

program_error = 1

OTHERS = 2.

----


  • Form set_pf_status

*----


  • Set status

----


FORM pf_status_set USING rt_extab TYPE slis_t_extab. "#EC CALLED

SET PF-STATUS 'SAVE'.

ENDFORM. "PF_STATUS_SET

In the above 'SAVE' is the pf-status which u need to create as per ur requirement. The above form will be dynamically called by the REUSE_.... method directly.

Regards,

Harish

Former Member
0 Kudos

Hi,

you just create a pf status and add buttons to it.

then you include that pfstatus in your function module in the

export parameter 'i_callback_pf_status_set'

i found this sample code somewhere you just see how this is done:

create one pfstatus. for example znewstatus is the created

pfstatus. double click on the pfstatus that was created then add the buttons that you require in the appilication tool bar.

pass the form names to the I_CALLBACK_PF_STATUS_SET and I_CALLBACK_USER_COMMAND in grid as shown below.

example for reference:

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = SY-REPID

I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'

I_CALLBACK_USER_COMMAND = 'USER_COMMAND'

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

FORM SET_PF_STATUS USING RT_EXTAB TYPE SLIS_T_EXTAB.

SET PF-STATUS 'ZNEWSTATUS'.

ENDFORM.

FORM USER_COMMAND USING R_UCOM TYPE SY-UCOMM R_SELFIELD TYPE SLIS_SELFIELD.

case R_UCOM

when 'PRINT'. (print is the function code name given to the icon created)

leave to list-processing.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = pass the form name

VARIANT = ' '

DIRECT_CALL = ' '

IMPORTING

FM_NAME = FMNAME

EXCEPTIONS

NO_FORM = 1

NO_FUNCTION_MODULE = 2

OTHERS = 3

.

IF sy-subrc 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

CALL FUNCTION FMNAME.

reward if useful.

Nishant Rana

Former Member
0 Kudos

Hi,

Please refer the link below:

http://www.sapdev.co.uk/reporting/alv/alvgrid_pfstatus.htm

Thanks,

Sriram Ponna.

Former Member
0 Kudos

hi check this..

create the pf-status for this...

FORM GUI_SET USING RT_EXTAB TYPE SLIS_T_EXTAB .

SET PF-STATUS 'GETDATA' .

ENDFORM. "GUI_SET

and create the user -command for this..

FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM

R_SELFIELD TYPE SLIS_SELFIELD.

CASE R_UCOMM.

WHEN 'DATA'.

PERFORM final_display.

endcase.

ENDFORM. "USER_COMMAND

use in the fm

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = sy-repid

IS_LAYOUT = gt_LAYOUT

IT_FIELDCAT = gt_fieldcat

TABLES

t_outtab = i_final .

endform. " final_display

Former Member
0 Kudos

HI FRIENDS THANKS TO ALL.

IF I FALLOW THE PROCUDURE.

IAM NOT GETTING THE STANDARD BUTTONS.

HOW CAN I GET THE STANDARD BUTTONS, AND THE

MY BUTTON ALSO.

0 Kudos

Hi,

To add a button on our ALV:

First go to SE41 and copy the PF-STATUS to your report program.

SAPLKKBL-standard program from which you need to copy PF-STATUS.

program:SAPLKKBL

status:STANDARD

click on copy from status and give the program name into which you need

to copy the status.

Then create push button in the copied PF-STATUS application tool bar.

Regards,

Shailaja