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

ALV button Problem ?

Former Member
0 Likes
675

Hello I am trying to create a button in my report of alv for that i have copied SALV function group GUI STANDARD into ZPFSTATUS and i have called the ZPFSTATUS in my coding as shown but i am unable to the GUI i mean no menu is displaying.....please if any thing that i have to change in my coding please suggest me..

My coding

FORM SUB_DISP_ALV .

W_FIELDCAT-COL_POS = 1.

W_FIELDCAT-FIELDNAME = 'SLNO'.

W_FIELDCAT-SELTEXT_M = 'SERIAL NUMBER'.

APPEND W_FIELDCAT TO T_FIELDCAT.

CLEAR W_FIELDCAT.

W_FIELDCAT-COL_POS = 2.

W_FIELDCAT-FIELDNAME = 'NAME'.

W_FIELDCAT-SELTEXT_M = 'NAME'.

APPEND W_FIELDCAT TO T_FIELDCAT.

CLEAR W_FIELDCAT.

W_FIELDCAT-COL_POS = 3.

W_FIELDCAT-FIELDNAME = 'LINO'.

W_FIELDCAT-SELTEXT_M = 'LICENCE NUMBER'.

APPEND W_FIELDCAT TO T_FIELDCAT.

CLEAR W_FIELDCAT.

W_FIELDCAT-COL_POS = 4.

W_FIELDCAT-FIELDNAME = 'PROF'.

W_FIELDCAT-SELTEXT_M = 'PROFESSION'.

APPEND W_FIELDCAT TO T_FIELDCAT.

CLEAR W_FIELDCAT.

W_FIELDCAT-COL_POS = 5.

W_FIELDCAT-FIELDNAME = 'ADDR'.

W_FIELDCAT-SELTEXT_M = 'ADDRESS'.

W_FIELDCAT-DO_SUM = 'X'.

APPEND W_FIELDCAT TO T_FIELDCAT.

CLEAR W_FIELDCAT.

W_FIELDCAT-COL_POS = 6.

W_FIELDCAT-FIELDNAME = 'FANM'.

W_FIELDCAT-SELTEXT_M = 'FATHER NAME'.

APPEND W_FIELDCAT TO T_FIELDCAT.

CLEAR W_FIELDCAT.

W_FIELDCAT-COL_POS = 7.

W_FIELDCAT-FIELDNAME = 'PLBU'.

W_FIELDCAT-SELTEXT_M = 'PLACE OF BUSSINESS'.

APPEND W_FIELDCAT TO T_FIELDCAT.

CLEAR W_FIELDCAT.

*PUPULATING TOP-OF-PAGE.

w_LISTHEADER-TYP = 'H'.

W_LISTHEADER-INFO = 'FORMA'.

APPEND W_LISTHEADER TO T_LISTHEADER.

CLEAR W_LISTHEADER.

*Form PFSTATUS.

set pf-status 'ZPFSTATUS'. " Here u can create a button

*ENDFORM.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = 'SY-CPROG'

I_CALLBACK_PF_STATUS_SET = 'PFSTATUS'

  • I_CALLBACK_USER_COMMAND = ' '

I_CALLBACK_TOP_OF_PAGE = 'SUB_TOP_OF_PAGE'

IT_FIELDCAT = T_FIELDCAT

I_DEFAULT = 'X'

TABLES

T_OUTTAB = T_OUTPUT

.

IF SY-SUBRC <> 0.

ENDIF.

6 REPLIES 6
Read only

Former Member
0 Likes
645

Hi,

Check the below link for How to add User User PF status in ALV

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

Hope this helps you.

Thanks,

Ruthra

Read only

former_member497886
Participant
0 Likes
645

hi,

Try this.

Write s subroutine and pass it tot alv_grid or list dispplay in user command.

Example-

Form click using r_extab type slis_t_extab.

Set PF-status 'stand' excluding r_extab.

endform.

Stand - it is the name of GUI copied.

Pass the name of the subroutine to ur grid_display-

I_callback_pf_status_set = ' click'.

Hope this will solve ur problem.

Regards,

Mohammadi.

Read only

former_member206439
Contributor
0 Likes
645

Hi

<content removed by moderator as it was just a copy/paste of someone else's work without giving credit. Any points have been unassigned.>

Edited by: Mike Pokraka on Aug 12, 2008 11:26 AM

Read only

former_member206439
Contributor
0 Likes
645

Hi

<content removed by moderator as it was just a copy/paste of someone else's work without giving credit. Any points have been unassigned.>

Edited by: Mike Pokraka on Aug 12, 2008 11:27 AM

Read only

Former Member
0 Likes
645

***Correct your program as follows...

PROGRAM rsolett1 MESSAGE-ID sy.

TYPE-POOLS: slis.

data: repid like sy-repid.

DATA: w_fieldcat TYPE slis_fieldcat_alv,

t_fieldcat TYPE slis_t_fieldcat_alv.

DATA: w_listheader TYPE slis_listheader,

t_listheader TYPE slis_t_listheader.

DATA: BEGIN OF t_output OCCURS 0,

slno TYPE char10,

name TYPE char10,

lino TYPE char10,

prof TYPE char10,

addr TYPE char10,

fanm TYPE char10,

plbu TYPE char10,

END OF t_output.

w_fieldcat-col_pos = 1.

w_fieldcat-fieldname = 'SLNO'.

w_fieldcat-seltext_m = 'SERIAL NUMBER'.

APPEND w_fieldcat TO t_fieldcat.

CLEAR w_fieldcat.

w_fieldcat-col_pos = 2.

w_fieldcat-fieldname = 'NAME'.

w_fieldcat-seltext_m = 'NAME'.

APPEND w_fieldcat TO t_fieldcat.

CLEAR w_fieldcat.

w_fieldcat-col_pos = 3.

w_fieldcat-fieldname = 'LINO'.

w_fieldcat-seltext_m = 'LICENCE NUMBER'.

APPEND w_fieldcat TO t_fieldcat.

CLEAR w_fieldcat.

w_fieldcat-col_pos = 4.

w_fieldcat-fieldname = 'PROF'.

w_fieldcat-seltext_m = 'PROFESSION'.

APPEND w_fieldcat TO t_fieldcat.

CLEAR w_fieldcat.

w_fieldcat-col_pos = 5.

w_fieldcat-fieldname = 'ADDR'.

w_fieldcat-seltext_m = 'ADDRESS'.

w_fieldcat-do_sum = 'X'.

APPEND w_fieldcat TO t_fieldcat.

CLEAR w_fieldcat.

w_fieldcat-col_pos = 6.

w_fieldcat-fieldname = 'FANM'.

w_fieldcat-seltext_m = 'FATHER NAME'.

APPEND w_fieldcat TO t_fieldcat.

CLEAR w_fieldcat.

w_fieldcat-col_pos = 7.

w_fieldcat-fieldname = 'PLBU'.

w_fieldcat-seltext_m = 'PLACE OF BUSSINESS'.

APPEND w_fieldcat TO t_fieldcat.

CLEAR w_fieldcat.

*PUPULATING TOP-OF-PAGE.

w_listheader-typ = 'H'.

w_listheader-info = 'FORMA'.

APPEND w_listheader TO t_listheader.

CLEAR w_listheader.

repid = sy-repid.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = repid

i_callback_pf_status_set = 'SET_PF_STATUS'

i_callback_user_command = ' '

i_callback_top_of_page = 'SUB_TOP_OF_PAGE'

it_fieldcat = t_fieldcat

i_default = 'X'

TABLES

t_outtab = t_output.

FORM set_pf_status USING rt_extab TYPE slis_t_extab.

SET PF-STATUS 'ZPFSTATUS'.

ENDFORM.

Edited by: Ganesh Modhave on Aug 12, 2008 1:06 PM

Read only

Former Member
0 Likes
645

Hi,

Please refer to the following link:

http://saptechnical.com/Tutorials/ALV/ALVMainPage.htm

Thanks & regrds,

Mayukh