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

How to create functionality to ALV Grid?

Former Member
0 Likes
751

Hi All,

My ALV code is running successfully,but I just wanna add few customer specific functionality and my own PF status.Can you suggest me something for this.

Thanks and Regards.

Rajarshi.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
723

Hi Rajarshi,

If you are using REUSE_ALV_GRID_CONTROL, Here is how you add

custom functionality.

1) In the fM REUSE_ALV_GRID_CONTROL pass the parameters

i_callback_user_command = 'USER_COMMAND' i_callback_pf_status_set = 'SET_PF_STATUS'. This are form name.

2) Create a form in your program as below.

FORM set_pf_status USING rt_extab TYPE slis_t_extab.

SET PF-STATUS 'PFSTAT1' EXCLUDING rt_extab.

ENDFORM. "SET_PF_STATUS

PFSTAT1 is a copy of the Pf-status STANDARD_FULSCREEN of the program SAPLKKBL (copy it using SE41).

Once PFSTAT1 is created you can modify it just like any other PF status and add your own menu or command buttons.

3) To handle the functioanlity create a form of name user_command in your program as below.

FORM user_command USING r_ucomm LIKE sy-ucomm

rs_selfield TYPE slis_selfield.

  • The field "R_UCOMM" will contain the current value of *"SY-UCOMM"

  • "RS_SELFIELD" will hold contents of the selected line

CASE r_ucomm.

ENDCASE.

ENDFORM. "USER_COMMAND

Hope this helps

6 REPLIES 6
Read only

athavanraja
Active Contributor
0 Likes
723

Hi,

check out these programs.

BCALV_GRID*

Regards

Raja

Read only

Former Member
0 Likes
723

Hi Rajarshi,

Have a look at the excellent tutorial Serdar wrote on ALV Grid:

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/an easy reference for alv grid control.pdf

Regards,

John.

Read only

Former Member
0 Likes
724

Hi Rajarshi,

If you are using REUSE_ALV_GRID_CONTROL, Here is how you add

custom functionality.

1) In the fM REUSE_ALV_GRID_CONTROL pass the parameters

i_callback_user_command = 'USER_COMMAND' i_callback_pf_status_set = 'SET_PF_STATUS'. This are form name.

2) Create a form in your program as below.

FORM set_pf_status USING rt_extab TYPE slis_t_extab.

SET PF-STATUS 'PFSTAT1' EXCLUDING rt_extab.

ENDFORM. "SET_PF_STATUS

PFSTAT1 is a copy of the Pf-status STANDARD_FULSCREEN of the program SAPLKKBL (copy it using SE41).

Once PFSTAT1 is created you can modify it just like any other PF status and add your own menu or command buttons.

3) To handle the functioanlity create a form of name user_command in your program as below.

FORM user_command USING r_ucomm LIKE sy-ucomm

rs_selfield TYPE slis_selfield.

  • The field "R_UCOMM" will contain the current value of *"SY-UCOMM"

  • "RS_SELFIELD" will hold contents of the selected line

CASE r_ucomm.

ENDCASE.

ENDFORM. "USER_COMMAND

Hope this helps

Read only

0 Likes
723

Hi Rajesh,

Thx for your help,but u have mentioned that I have to copy the PF status of SAPLKKBLO that is STANDARD_FULLSCREEN from the T-Code se41,this portion is not clear to me.

Asking for your kind reply.

Regards.

Rajarshi.

Read only

Former Member
0 Likes
723

ALV Comes with built in functionalities like filter, sort etc. If you still want these functionalities in your program without having to code for these functionalities, then copy the PF status (STANDARD_FULLSCREEN) from the program SAPLKKBL. (For copying the PF status you can use SE41)

You can add additional functionalities to the existing ones by modifying the copied PF status.

Regards

Rajesh

Message was edited by: Rajesh R

Read only

0 Likes
723

Hi Rajesh,

Thank you very much for your kind help.My problem is over.

Regards.

Rajarshi.