Skip to Content
0
Former Member
Apr 09, 2007 at 04:01 PM

HOW TO DISPLAY MY OWN PF STATUS IN ALV LIST DISPLAY

329 Views

Hi All,

i am developing one program in this program i am displaying output by using alv list display. after displaying the out SAP predefined pf status is coming. here i need my own pf status. any body can send me the sample code ir modify my code if possible.

i am sending my code below.

report zmahi6.

type-pools : slis.

tables : zuser_secobjects.

data : it_secobjects like zuser_secobjects occurs 0 with header line.

data : i_field type slis_t_fieldcat_alv with header line.

data : w_field like line of i_field.

data : i_sort type slis_t_sortinfo_alv.

data : w_sort like line of i_sort.

data : it_filt1 type slis_t_filter_alv with header line.

data:

i_tabname type tabname,

i_repid like sy-repid,

is_lout type slis_layout_alv.

data : chk_box type slis_fieldname.

selection-screen: begin of block b1 with frame title text-t01.

parameters : p_appln type zuser_secobjects-appln.

parameters : p_user type usr02-bname, "zuser_secobjects-appln_user,

p_partnr type zuser_secobjects-appln_partner,

p_ptype type zuser_secobjects-partner_type default '02',

p_upostn type zuser_secobjects-user_position,

p_sdate like likp-erdat default sy-datum,

  • "type zuser_secobjects-start_date

p_edate(10) default '12/31/9999',

  • type zuser_secobjects-end_date,

p_revnum type zuser_secobjects-revnum,

p_cted type zuser_secobjects-created_by,

p_cdate type zuser_secobjects-creation_date,

p_ctime type zuser_secobjects-creation_time,

p_chnby type zuser_secobjects-changed_by,

p_cdate1 type zuser_secobjects-changed_date,

p_ctime1 type zuser_secobjects-changed_time.

selection-screen: end of block b1.

start-of-selection.

perform get_data.

check sy-subrc eq 0.

set pf-status 'ZMAHEE'.

perform prepare_fieldcatalog.

perform alv_list_display.

&----


*& Form PREPARE_FIELDCATALOG

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form prepare_fieldcatalog.

clear: w_field,i_field.

refresh:i_field.

i_field-key = 'X'.

i_field-col_pos = 1.

i_field-ddictxt = 'S'.

i_field-seltext_s = '@11@'.

i_field-checkbox = 'X'.

i_field-input = 'X'.

i_field-fieldname = 'HEADER'.

i_field-outputlen = 0.

append i_field.

clear i_field.

w_field-fieldname = 'APPLN'.

w_field-tabname = 'IT_SECOBJECTS'.

w_field-seltext_l = text-m01.

w_field-outputlen = '10'.

w_field-col_pos = 1.

append w_field to i_field.

clear w_field.

w_field-fieldname = 'APPLN_USER'.

w_field-tabname = 'IT_SECOBJECTS'.

w_field-just = 'C'.

w_field-seltext_l = text-m02.

w_field-outputlen = '7'.

w_field-col_pos = 2.

append w_field to i_field.

clear w_field.

endform. " PREPARE_FIELDCATALOG

*form pf_status_set using rt_extab type slis_t_extab.

  • set pf-status '0001'.

*endform.

&----


*& Form ALV_LIST_DISPLAY

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form alv_list_display.

call function 'REUSE_ALV_LIST_DISPLAY'

exporting

i_callback_program = i_repid

i_callback_pf_status_set = 'PF_STATUS_SET'

i_callback_user_comomand = 'USER_COMMAND'

is_layout = is_lout

it_fieldcat = i_field[]

  • it_sort = i_sort

  • it_events = it_evts[]

tables

t_outtab = it_secobjects.

endform. " ALV_LIST_DISPLAY

&----


*& Form GET_DATA

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form get_data.

select * from zuser_secobjects

into table it_secobjects.

endform. " GET_DATA

thanks,

maheedhar.t