2006 Jan 09 10:08 AM
Hy, I want to insert a new personal button in an alv created without abap objects, some like the modify_toolbar method in an alv object.
In the other hand, i need a function for an alv created without aap objects to emulate the get_selectd_rows method in an alv object.
THANX!
2006 Jan 09 10:16 AM
Hi,
this is very simple.
FORM PF_STATUS_SET USING P_EXTAB TYPE SLIS_T_EXTAB.
SET PF-STATUS 'STANDARD' EXCLUDING P_EXTAB.
ENDFORM. "PF_STATUS_SETclick on the status and add your own buttons to the application tool bar.
and handle them in user_command form.
regards
vijay
Hi,
this is very simple.
FORM PF_STATUS_SET USING P_EXTAB TYPE SLIS_T_EXTAB.
SET PF-STATUS 'STANDARD' EXCLUDING P_EXTAB.
ENDFORM. "PF_STATUS_SETclick on the status and add your own buttons to the application tool bar.
and handle them in user_command form.
regards
vijay
2006 Jan 09 10:16 AM
Hi,
this is very simple.
FORM PF_STATUS_SET USING P_EXTAB TYPE SLIS_T_EXTAB.
SET PF-STATUS 'STANDARD' EXCLUDING P_EXTAB.
ENDFORM. "PF_STATUS_SETclick on the status and add your own buttons to the application tool bar.
and handle them in user_command form.
regards
vijay
2006 Jan 09 10:17 AM
Hi fer,
1. want to insert a new personal button
a) thru se80, open function group SALV
b) by right click, copy STANDARD Gui status
to your program as STANDARD_COPY
c) open your program
d) while using FM REUSE_ALV_LIST_DISPLAY
pass this parameters :
i_callback_program = sy-repid i_callback_user_command = 'ITAB_USER_COMMAND' i_callback_pf_status_set = 'SET_PF_STATUS'
e) now write this code for FORM :
FORM set_pf_status USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'STANDARD_COPY'.
ENDFORM. "SET_PF_STATUS
f) double click standard_coy
to open gui status, ADD your own button with own fcode, and activate
g) write one more FORM for call back
FORM ITAB_user_command USING whatcomm TYPE sy-ucomm whatrow TYPE
slis_selfield.
IF whatcomm = 'MYCODE'.
*------ LOGIC
*----
ENDIF.
ENDFORM. "INCRFG_user_command
regards,
amit m.
2007 Apr 05 9:39 AM
Hello !
I referred to ur code below. But I am having certain doubts:-
1. I am workin with transaction FB03. I have developed the code for header data using module pool program.
But now I want to display the line items using ALV grid with buttons(Search , Sort and Back).
Please if possible could u explain this code in detail.
Thanks in advance,
Sachin
2006 Jan 09 10:18 AM
Fer,
Activate the MODIFY_TOOLBAR event and then use this code to add the button.
DATA: LS_TB TYPE STB_BUTTON.
LS_TB-BUTN_TYPE = 3.
INSERT LS_TB INTO E_OBJECT->MT_TOOLBAR INDEX 1.
LS_TB-FUNCTION = 'FUNC1'.
LS_TB-ICON = ICON_ALERT.
LS_TB-QUICKINFO = 'Customer Function 1'(001).
LS_TB-BUTN_TYPE = '0'.
INSERT LS_TB INTO E_OBJECT->MT_TOOLBAR INDEX 1.
LS_TB-FUNCTION = 'FUNC2'.
LS_TB-ICON = ICON_BW_RA_SETTING_ACTIVE.
LS_TB-QUICKINFO = 'Customer Function 2'(002).
LS_TB-BUTN_TYPE = '0'.
INSERT LS_TB INTO E_OBJECT->MT_TOOLBAR INDEX 1.
After that in the event USER_COMMAND you can handle the same. This is for OOP.
regards,
Ravi
2006 Jan 09 10:26 AM
Hi, thanx a lot. I use the REUSE_ALV_EVENTS_GET function to get the alv events, but I cant see the modify_toolbar event that you told me, where can I find it?
thanx!
2006 Jan 09 10:29 AM
2006 Jan 09 10:30 AM
Hi fer,
1. I suppose u are displaying alv
using FM (and not OO alv)
REUSE_ALV_LIST_DISPLAY
2. For that, Events are not required.
3. See my previous reply
( it works fantastic )
regards,
amit m.
2006 Jan 09 10:32 AM
2006 Jan 09 10:40 AM
Hi
You don't need that event, you have to transfert the name of your form to set your bar in parameter I_CALLBACK_PF_STATUS_SET of fm REUSE_ALV_GRID_DISPLAY (or REUSE_ALV_LIST_DISPLAY, i don't know whioch fm you're using) and indicate the name of program where you define this routine (Your program I suppose).
So
GT_REPID = SY-REPID.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORT
I_CALLBACK_PROGRAM = GT_REPID
I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
This form has to be:
FORM set_pf_status USING rt_extab TYPE slis_t_extab.
set pf-status 'MY_GUI_ALV' excluding rt_extab.
ENDFORM.
Now you have to create this toolbar copying from alv gui STANDARD_FULLSCREEN or STANDARD of program SAPLKKBL.
Max
2006 Jan 09 10:36 AM
Hi Ammit, I want to insert the personal button inside the alv, near to search button, export to excel button... but inside the alv, not the top of the screen.
Thanx!
2006 Jan 09 10:43 AM
Hi,
Take one sample standard ALV Program and go to se41.
and give the program name, and choose the status which is available. and click the copy status button and give your program and status name. copy the status and save , activate. then see the components in the pf-status .
now add your own buttons in the status which you copied and activate. give the status in PF-status form.
for normal alv's this is the way.
Regards
vijay
2006 Jan 09 10:44 AM
Hi,
You need to create an own toolbar as copy of standard status gui.
- Create your status GUI as copy of std gui STANDARD_FULLSCREEN of program SAPLKKBL;
- Insert your new push button;
- Create a routine to call your bar:
FORM set_pf_status USING rt_extab TYPE slis_t_extab
SET PF-STATUS 'MY_ALV_BAR' EXCLUDING rt_extab.
ENDFORM.
- Create routine to manage your commands:
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE R_UCOMM.
WHEN 'XXXX'........
ENDCASE.
ENDFORM.
- Transfers these routines to ALV fm:
GT_REPID = SY-REPID.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = GT_REPID
I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
............
Please give points, if it is helpful for you
Thanks,
Pramod
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |