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

Adding

Former Member
0 Likes
727

How to add our own fuctions to ALV application tool bar ?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
659

Hi Sriram,

<b>

Just copy and paste this and analyse the code after looking at the output.....</b>

TABLES sscrfields.

PARAMETERS: p_carrid TYPE s_carr_id,

p_cityfr TYPE s_from_cit.

SELECTION-SCREEN: FUNCTION KEY 1,

FUNCTION KEY 2,

FUNCTION KEY 3,

FUNCTION KEY 4,

FUNCTION KEY 5.

INITIALIZATION.

sscrfields-functxt_01 = 'LH'.

sscrfields-functxt_02 = 'UA'.

sscrfields-functxt_03 = ' V.Raghavender '.

sscrfields-functxt_04 = 'KK'.

sscrfields-functxt_05 = 'ww'.

sscrfields-search_btn = 'EXTRA'.

AT SELECTION-SCREEN.

CASE sscrfields-ucomm.

WHEN'FC01'.

p_carrid = 'LH'.

p_cityfr = 'Frankfurt'.

WHEN 'FC02'.

p_carrid = 'UA'.

p_cityfr = 'Chicago'.

WHEN 'FC03'.

p_carrid = 'SB'.

p_cityfr = 'Hyderabad'.

ENDCASE.

START-OF-SELECTION.

WRITE / 'START-OF-SELECTION'.

<b>

Reward all helpful answers</b>

Regards,

V.Raghavender.

4 REPLIES 4
Read only

Former Member
0 Likes
660

Hi Sriram,

<b>

Just copy and paste this and analyse the code after looking at the output.....</b>

TABLES sscrfields.

PARAMETERS: p_carrid TYPE s_carr_id,

p_cityfr TYPE s_from_cit.

SELECTION-SCREEN: FUNCTION KEY 1,

FUNCTION KEY 2,

FUNCTION KEY 3,

FUNCTION KEY 4,

FUNCTION KEY 5.

INITIALIZATION.

sscrfields-functxt_01 = 'LH'.

sscrfields-functxt_02 = 'UA'.

sscrfields-functxt_03 = ' V.Raghavender '.

sscrfields-functxt_04 = 'KK'.

sscrfields-functxt_05 = 'ww'.

sscrfields-search_btn = 'EXTRA'.

AT SELECTION-SCREEN.

CASE sscrfields-ucomm.

WHEN'FC01'.

p_carrid = 'LH'.

p_cityfr = 'Frankfurt'.

WHEN 'FC02'.

p_carrid = 'UA'.

p_cityfr = 'Chicago'.

WHEN 'FC03'.

p_carrid = 'SB'.

p_cityfr = 'Hyderabad'.

ENDCASE.

START-OF-SELECTION.

WRITE / 'START-OF-SELECTION'.

<b>

Reward all helpful answers</b>

Regards,

V.Raghavender.

Read only

former_member673464
Active Contributor
0 Likes
659

hi..

You can set your own pf-status for adding functions to the tool bar.Copy the standard gui status and add your own functions and use it.

New PF-STATUS is required , say 'ABCD'.

b) Handle user_commmand

2. First of all, from Function group SALV,

copy the STANDARD gui status to your program,

from SE80, by right clicking.

3. come to your program.

start-of-selection.

SET PF-STATUS 'ABCD'.

4. Double click ABCD and activate the gui status.

4. In gui status,

add/change your own buttons

Save and activate.

you should be passing the name of the pf-status in the alv grid fm..

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = SAT_REPID

I_CALLBACK_PF_STATUS_SET = 'ZSTANDARD' --> yours would be ABCD

I_CALLBACK_USER_COMMAND = 'USER_COMMAND'

IS_LAYOUT = SAT_LAYOUT

IT_FIELDCAT = SAT_FIELDCATALOG[]

IT_EVENTS = SAT_EVENTS[]

TABLES

T_OUTTAB = ITAB_FINAL

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.

make sure there is a form ABCD in your program...

FORM ZSTANDARD USING P_EXTAB TYPE SLIS_T_EXTAB.

SET PF-STATUS 'ZSTANDARD1' EXCLUDING P_EXTAB.

ENDFORM. "ZSTANDARD

regards,

veeresh

Read only

Former Member
0 Likes
659

Define the below perform in ur code. create a PF-STATUS for ur program and ur own function codes. This perform will be called internally at the time of initialization of the alv. No nedd to call the perform explicitly.

FORM f_set_status USING rt_extab TYPE slis_t_extab. "#EC *

SET PF-STATUS 'STATLALV' .

CLEAR rt_extab.

ENDFORM. "f_set_status

while calling the ALV set the parameter i_callback_pf_status_set with the peform name ( must be is caps)

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = sy-cprog

i_callback_pf_status_set = 'F_SET_STATUS'.

Use the type pool

TYPE-POOLS: slis.

Read only

Former Member
0 Likes
659

hi

good

go through this weblog,i hope this ll help you solve your problem

/people/ravishankar.rajan/blog/2007/03/09/using-the-alv-extension-class

thanks

mrutyun^