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: 

alv pf status

Former Member
0 Kudos

how to pf status in alvs

6 REPLIES 6

Former Member
0 Kudos

check this .

FU REUSE_ALV_GRID_DISPLAY        I_CALLBACK_PF_STATUS_SET
____________________________________________________
Text
Set EXIT routine to status

Description

Passing an EXIT routine indicates to the ALV that the caller wants to set a self-defined user status.

As a result, the default status of the ALV is not set.

The interface of the form routine specified must be defined as follows:

        FORM set_pf_status USING rt_extab TYPE slis_t_extab

Table RT_EXTAB contains the function codes that would be hidden on the standard user interface.

If the caller wants to use a self-defined user interface (for example, in order to provide additional list functions or use existing functions), we recommend that you copy standard status STANDARD from function group SALV and modify it accordingly. ALV standard function codes always start with '&'.

See also the documentation on parameter I_CALLBACK_USER_COMMAND.

If a self-defined user interface is used that includes function codes of the standard user interface, the function codes of the excluding table passed should be taken into account.

This means that the user status should generally be set as follows:

SET PF-STATUS user status EXCLUDING rt_extab.
Application functions can be added to excluding table rt_extab if they are to be disabled.

The routine is called whenever the standard user interface would be set with SET PF-STATUS.

Default
If no EXIT routine is specified, the ALV sets a status that corresponds to status STANDARD of function group SALV.

Function Module
REUSE_ALV_GRID_DISPLAY

Regards

Prabhu

Former Member
0 Kudos

Hi Pavan,

This is how can u create PF-Status.

U Have to pass a parameter when u call FM- REUSE_ALV_LIST_DISPLAY Like

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

  • EXPORTING

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER =

  • I_BUFFER_ACTIVE = ' '

  • I_CALLBACK_PROGRAM = ' '

I_CALLBACK_PF_STATUS_SET = 'ZPF '

  • I_CALLBACK_USER_COMMAND = ' '

  • I_STRUCTURE_NAME =

  • IS_LAYOUT =

  • IT_FIELDCAT =

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

  • IT_EVENTS =

  • IT_EVENT_EXIT =

  • IS_PRINT =

  • IS_REPREP_ID =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • IR_SALV_LIST_ADAPTER =

  • IT_EXCEPT_QINFO =

  • I_SUPPRESS_EMPTY_DATA = ABAP_FALSE

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

TABLES

T_OUTTAB =

  • EXCEPTIONS

  • PROGRAM_ERROR = 1

  • OTHERS = 2

.

IF SY-SUBRC <> 0.

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

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

ENDIF.

Passing an EXIT routine tells the ALV that you want to set your own user status. In this case, the ALV does not set its default status but calls the form routine passed with I_CALLBACK_PF_STATUS_SET.

The interface of this form routine must be defined as follows:

FORM set_pf_status USING rt_extab TYPE slis_t_extab

The table RT_EXTAB contains those function codes that are hidden on the standard interface of the ALV.

If the caller wants to use his or her own interface (to offer other functions on the list or transfer existing functionality, for example), it is recommended that he or she copy the standard status STANDARD from function group SALV and make the appropriate changes. Standard ALV function codes always begin with '&'.

Please consult the documentation on the I_CALLBACK_USER_COMMAND parameter as well.

If the default status is used, the ALV hides standard functions that are not appropriate for the list currently displayed. To ensure that this also works when you use your own interface, the ALV passes the function codes of these standard functions in the excluding table rt_extab (see above) when the form routine is called.

This means that the user status should always be set as follows in the form routine:

SET PF-STATUS usrstatus EXCLUDING rt_extab.

Excluding table rt_extab can be appended to include those application functions that are to be deactivated.

The system calls this form routine whenever the standard interface would be set by the ALV using SET PF-STATUS.

U can get more detail in se37 - REUSE_ALV_LIST_DISPLAY - function module documentation.

Regds,

Seema.

santhosh_patil
Contributor
0 Kudos

Hi,

1. While calling ALV for display set the pf-status parameter as shown below.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

I_INTERFACE_CHECK = ' '

i_callback_program = g_f_repid

<b> i_callback_pf_status_set = 'PF_STATUS_SET'</b>

.....

...

....

2. Define the form

*----


  • FORM pf_status_set

  • Set GUI status for ALV display

*----


FORM pf_status_set USING i_t_extab TYPE slis_t_extab.

...

HERE U set the pf-ststus as needed.

ENDFORM....

NOTE: When u call the FM for ALV .. this form routine is callled.. only when u set the pf-status parameter.

--Santhosh

Former Member
0 Kudos

You should copy the 'STANDARD' GUI status from program SAPLKKBL using transaction SE90 >Programming SubObjects> Gui Status.

Execute this transaction to get to next screen. select status using checkbox. click on GUI Status --> Copy.

Enter your Z program name and the name you what for this status - you can keep it as 'STANDARD' to be simple.

Then you can edit the new status to add or delete buttons. This will also bring in the standard SAP ALV functionality such as sorting/subtotaling etc...

When you call 'REUSE_ALV_GRID_DISPLAY' make sure you pass it the new status name.

an example of one of mine:

call function 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = 'ZSDBOLST_REPORT'

i_callback_pf_status_set = 'STANDARD' <----


i_callback_user_command = 'USER_COMMAND'

i_structure_name = 'I_BOLACT'

i_grid_title = 'BOL Action Report'(031)

is_layout = gs_layout

it_fieldcat = gt_fieldcat[]

i_save = 'A'

is_variant = v_variant

TABLES

t_outtab = i_bolact

EXCEPTIONS

program_error = 1

others = 2.

  • Form Set_pf_status

  • Notes: Called by FM REUSE_ALV_GRID_DISPLAY

FORM set_pf_status USING rt_extab TYPE slis_t_extab.

SET PF-STATUS 'ZSTANDARD'.

ENDFORM. "Set_pf_status

Best Regards,

Vibha

*Please mark all the helpful answers

Former Member
0 Kudos

hi

good

go through this weblog.

/people/vijaybabu.dudla/blog/2006/07/21/topofpage-in-alv-using-clguialvgrid

thanks

mrutyun^

Former Member
0 Kudos

In order modify PF_STATUS of ALV grid report you need to perform the following steps:

1. Update 'REUSE_ALV_GRID_DISPLAY' FM call to include:

i_callback_pf_status_set = 'SET_PF_STATUS' statement.

2. Create 'SET_PF_STATUS' FORM

3. Create pf_status (i.e. 'ZNEWSTATUS').

- It is recommend that you copy standard status'STANDARD' from function group SALVand modify it accordingly. ALV standard function codes always start with '&'.

call function 'REUSE_ALV_GRID_DISPLAY'

exporting

i_callback_program = gd_repid

i_callback_top_of_page = 'TOP-OF-PAGE'

i_callback_pf_status_set = 'SET_PF_STATUS' "see FORM

is_layout = gd_layout

it_fieldcat = fieldcatalog[]

i_save = 'X'

tables

t_outtab = it_ekko

exceptions

program_error = 1

others = 2.

----


  • FORM SET_PF_STATUS *

----


FORM set_pf_status USING rt_extab TYPE slis_t_extab.

SET PF-STATUS 'ZNEWSTATUS'.

"Copy of 'STANDARD' pf_status from fgroup SALV

ENDFORM.

Rewards if useful.

Sravan