Add buttons to an standard status ALV
Hi experts,
I want to add new buttons to an standard status of ALV list.
I created the ALV with the function REUSE_ALV_HIERSEQ_LIST_DISPLAY.
Can anyone help me???
Thanks!
Hi LydiaMM,
Copy the standard Status and add the required functionality in the code for the new buttons and
pass the status to the import parameter I_CALLBACK_PF_STATUS_SETfor the FM REUSE_ALV_HIERSEQ_LIST_DISPLAY.
Copy the status 'STANDARD' of the program SAPLKKBL and you can add the new buttons in the status.
Hope this might help you.
Regards,
Phani.
Similar Messages
-
Add button to RF Standard transaction
Hello,
Is it possible to add a push button to an RF Standard transaction? and How?
ThxHi,
SAP has provided Dummy screens to each RF screen for you to enhance it. They usually named as 'SAPLXLRF' and screen number would be 9XXX . 'XXX' being the original screen number. Then you need to activate the corresponding user exit that starts with MWMRF* for the corresponding screen. Also in the RF Screen Management you need to add an entry with Variant '1'.
Hope that helps.
Thanks
Vinod. -
How to add button in reuse_alv not in gui status
hi guys,
my question how can i add button to reuse_alv not in gui_status or pf_status ? and also i have an internal table which contains a checkbox field when user select one or more check box and push button , new table will be sended to batch input program.how can i do add button part, the rest of it is done.?Hi,The following sample report ZUS_SDN_ALV_BUTTON_CLICK_LTXT shows a possible way how to handle the BUTTON_CLICK event in order to retrieve a longtext for a ALV entry. Please note that for the sake of simplicity I have choosen an obsolete function module for text editing (only enter numerical values otherwise the function module crashes).
*& Report ZUS_SDN_ALV_BUTTON_CLICK_LTXT
*& Screen '0100' contains no elements.
*& ok_code -> assigned to GD_OKCODE
*& Flow logic:
* PROCESS BEFORE OUTPUT.
* MODULE STATUS_0100.
* PROCESS AFTER INPUT.
* MODULE USER_COMMAND_0100.
*& PURPOSE: Demonstrate event BUTTON_CLICK for entering long text
REPORT zus_sdn_alv_button_click_ltxt.
TYPE-POOLS: icon.
TYPES: BEGIN OF ty_s_outtab.
INCLUDE TYPE knb1.
TYPES: button TYPE iconname.
TYPES: line TYPE bapi_line.
TYPES: END OF ty_s_outtab.
TYPES: ty_t_outtab TYPE STANDARD TABLE OF ty_s_outtab
WITH DEFAULT KEY.
DATA:
gd_okcode TYPE ui_func,
gd_repid TYPE syst-repid,
go_docking TYPE REF TO cl_gui_docking_container,
go_grid TYPE REF TO cl_gui_alv_grid,
gt_fcat TYPE lvc_t_fcat,
gt_variant TYPE disvariant,
gs_layout TYPE lvc_s_layo.
DATA:
gs_outtab TYPE ty_s_outtab,
gt_outtab TYPE ty_t_outtab.
* CLASS lcl_eventhandler DEFINITION
CLASS lcl_eventhandler DEFINITION.
PUBLIC SECTION.
CLASS-METHODS:
handle_button_click FOR EVENT button_click OF cl_gui_alv_grid
IMPORTING
es_col_id
es_row_no
sender.
ENDCLASS. "lcl_eventhandler DEFINITION
* CLASS lcl_eventhandler IMPLEMENTATION
CLASS lcl_eventhandler IMPLEMENTATION.
METHOD handle_button_click.
* define local data
DATA:
ld_answer(1) TYPE c,
ls_outtab TYPE ty_s_outtab.
CHECK ( sender = go_grid ).
READ TABLE gt_outtab INTO ls_outtab INDEX es_row_no-row_id.
" Note: This function module is obsolete and crashes if
" non-numerical values are entered. Choose a more
" appropriate way of entering the longtext.
CALL FUNCTION 'POPUP_TO_GET_VALUE'
EXPORTING
fieldname = 'LINE'
tabname = 'BAPITGB'
titel = 'Enter Longtext'
valuein = ls_outtab-line
IMPORTING
answer = ld_answer
valueout = ls_outtab-line
EXCEPTIONS
fieldname_not_found = 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.
IF ( ld_answer NE 'C' ). " 'C' = cancel
MODIFY gt_outtab FROM ls_outtab INDEX es_row_no-row_id
TRANSPORTING line.
ENDIF.
* Triggers PAI of the dynpro with the specified ok-code
CALL METHOD cl_gui_cfw=>set_new_ok_code( 'REFRESH' ).
ENDMETHOD. "handle_button_click
ENDCLASS. "lcl_eventhandler IMPLEMENTATION
START-OF-SELECTION.
SELECT * FROM knb1
INTO CORRESPONDING FIELDS OF TABLE gt_outtab
WHERE bukrs = '1000'.
CLEAR: gs_outtab.
gs_outtab-button = icon_change_text.
MODIFY gt_outtab FROM gs_outtab
TRANSPORTING button LINE
where ( bukrs NE space ). " modify all lines
PERFORM build_fieldcatalog.
* Create docking container
CREATE OBJECT go_docking
EXPORTING
parent = cl_gui_container=>screen0
ratio = 90
EXCEPTIONS
OTHERS = 6.
IF sy-subrc 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Create ALV grids
CREATE OBJECT go_grid
EXPORTING
i_parent = go_docking
EXCEPTIONS
OTHERS = 5.
IF sy-subrc 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Set event handler
SET HANDLER: lcl_eventhandler=>handle_button_click FOR go_grid.
* Display data
gs_layout-grid_title = 'Customers'.
CALL METHOD go_grid->set_table_for_first_display
EXPORTING
is_layout = gs_layout
CHANGING
it_outtab = gt_outtab
it_fieldcatalog = gt_fcat
EXCEPTIONS
OTHERS = 4.
IF sy-subrc 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Link the docking container to the target dynpro
gd_repid = syst-repid.
CALL METHOD go_docking->link
EXPORTING
repid = gd_repid
dynnr = '0100'
* CONTAINER =
EXCEPTIONS
OTHERS = 4.
IF sy-subrc 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* NOTE: dynpro does not contain any elements
CALL SCREEN '0100'.
* Flow logic of dynpro (does not contain any dynpro elements):
*PROCESS BEFORE OUTPUT.
* MODULE STATUS_0100.
*PROCESS AFTER INPUT.
* MODULE USER_COMMAND_0100.
END-OF-SELECTION.
*& Module STATUS_0100 OUTPUT
* text
MODULE status_0100 OUTPUT.
SET PF-STATUS 'STATUS_0100'. " contains push button "DETAIL"
* SET TITLEBAR 'xxx'.
CALL METHOD go_grid->refresh_table_display
* EXPORTING
* IS_STABLE =
* I_SOFT_REFRESH =
* EXCEPTIONS
* FINISHED = 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.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
* text
MODULE user_command_0100 INPUT.
CASE gd_okcode.
WHEN 'BACK' OR
'END' OR
'CANC'.
SET SCREEN 0. LEAVE SCREEN.
* Refresh -> pass PAI and PBO where flushing occurs
WHEN 'REFRESH'.
WHEN OTHERS.
ENDCASE.
CLEAR: gd_okcode.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Form BUILD_FIELDCATALOG
* text
* --> p1 text
* <-- p2 text
FORM build_fieldcatalog .
* define local data
DATA:
ls_fcat TYPE lvc_s_fcat,
lt_fcat TYPE lvc_t_fcat.
REFRESH: gt_fcat.
CLEAR: lt_fcat.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'KNB1'
CHANGING
ct_fieldcat = lt_fcat
EXCEPTIONS
OTHERS = 99.
IF sy-subrc 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
APPEND LINES OF lt_fcat TO gt_fcat.
CLEAR: lt_fcat.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'BAPITGB'
CHANGING
ct_fieldcat = lt_fcat
EXCEPTIONS
OTHERS = 99.
IF sy-subrc 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
READ TABLE lt_fcat INTO ls_fcat
WITH KEY fieldname = 'LINE'.
IF ( syst-subrc = 0 ).
INSERT ls_fcat INTO gt_fcat INDEX 4.
ENDIF.
CLEAR: lt_fcat.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'ICON'
CHANGING
ct_fieldcat = lt_fcat
EXCEPTIONS
OTHERS = 99.
IF sy-subrc 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
READ TABLE lt_fcat INTO ls_fcat
WITH KEY fieldname = 'NAME'.
IF ( syst-subrc = 0 ).
ls_fcat-fieldname = 'BUTTON'.
ls_fcat-style = cl_gui_alv_grid=>mc_style_button.
INSERT ls_fcat INTO gt_fcat INDEX 4.
ENDIF.
LOOP AT gt_fcat INTO ls_fcat.
ls_fcat-col_pos = syst-tabix.
MODIFY gt_fcat FROM ls_fcat INDEX syst-tabix.
ENDLOOP.
ENDFORM. " BUILD_FIELDCATALOG[/code]
Reward If Found Useful. -
Wan to add push button in the output of ALV Grid display.
Hi Friends,
I wan to add a Push button in the output of ALV GRID display with STANDARD ikons.
How to copy standard ikons of GRID output.
How to apply the copied status into my code.
Regards,
VijiHi,
Goto SE41, create a pf-status for your alv report program.
On the next screen, click menu EXTRAS --> click option ADJUST TEMPLATES and select radiobutton LIST VIEWER --> you will get all standard buttons of alv in the pf-status.
Delete the unwanted buttons and also you can add new buttons if reqd.
Activate pf-status --> and apply in alv program.
Now to apply this pf-status in your alv report follow code:-
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = v_rep_id " report id
i_callback_pf_status_set = 'PF' " for PF-STATUS
i_callback_user_command = 'USER_COMMAND' " for User-Command
is_layout = wa_layout " for layout
it_fieldcat = it_field " field catalog
it_sort = it_sort " sort info
TABLES
t_outtab = it_final " internal table
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.
*& Form pf
* SUB-ROUTINE PF IS USED TO SET THE PF-STATUS OF THE SCREEN
* ON WHICH THE ALV GRID IS DISPLAYED
* -->RT_EXTAB
FORM pf USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'ZTG_STAT'. "<--pass pf-status name here
ENDFORM. "pf
*& Form USER_COMMAND
* SUB-ROUTINE USER_COMMAND IS USED TO HANDLE THE USER ACTION
* AND EXECUTE THE APPROPIATE CODE
* -->LV_OKCODE used to capture the function code
* of the user-defined push-buttons
* -->L_SELFIELD text
FORM user_command USING lv_okcode LIKE sy-ucomm l_selfield TYPE slis_selfield.
* assign the function code to variable v_okcode
lv_okcode = sy-ucomm.
* handle the code execution based on the function code encountered
CASE lv_okcode.
WHEN '<function_code>'. "<--to handle user actions
ENDCASE.
ENDFORM. "USER_COMMAND
Hope this helps you.
Regards,
Tarun -
How to add button in ALV report (Class method )?
Hello experts,
I have developed one ALV report using classes.
I want to add one more button on the report like already is there named DISPLQUA
How ca i do that here?
Following the code of CLASS definition & implimentation
CLASS lcl_handle_events DEFINITION.
PUBLIC SECTION.
METHODS:
handle_on_user_command FOR EVENT added_function OF cl_salv_events
IMPORTING e_salv_function.
ENDCLASS. "lcl_handle_events DEFINITION
CLASS lcl_handle_events IMPLEMENTATION
CLASS lcl_handle_events IMPLEMENTATION.
METHOD handle_on_user_command.
CASE e_salv_function.
WHEN 'DISPLQUA'.
PERFORM show_quant_record.
WHEN 'DISPQM03'. " Here i want to add button
PERFORM display_quality_notification.
WHEN OTHERS.
ENDCASE.
ENDMETHOD. "handle_on_user_command
ENDCLASS. "lcl_handle_events IMPLEMENTATIONHI Ronny.
Code snippet for reference.
CLASS LCL_EVENT_HANDLER DEFINITION .
PUBLIC SECTION.
METHODS :
*--Toolbar control
HANDLE_TOOLBAR FOR EVENT TOOLBAR
OF CL_GUI_ALV_GRID IMPORTING E_OBJECT
E_INTERACTIVE,
ENDCLASS
CLASS LCL_EVENT_HANDLER IMPLEMENTATION.
*--handle toolbar
METHOD HANDLE_TOOLBAR.
* append a separator to normal toolbar
CLEAR G_TOOLBAR.
G_TOOLBAR-BUTN_TYPE = 3.
APPEND G_TOOLBAR TO E_OBJECT->MT_TOOLBAR.
CLEAR G_TOOLBAR.
G_TOOLBAR-FUNCTION = 'SAVE'.
G_TOOLBAR-ICON = ICON_SYSTEM_SAVE.
G_TOOLBAR-BUTN_TYPE = 0.
G_TOOLBAR-QUICKINFO = 'Save the Customer'(203).
APPEND G_TOOLBAR TO E_OBJECT->MT_TOOLBAR.
ENDMETHOD. "HANDLE_TOOLBAR
Hope this helps.
Gary.
<REMOVED BY MODERATOR>
Edited by: Alvaro Tejada Galindo on Apr 7, 2008 5:41 PM -
How to add display button(ICON) on standard report screen?
Hi,
I have to add display button after the excute button on the standard selection screen of the report.
could you please guid me how to do that i was trying with below but it does not reflect.
TABLES: sscrfields.
TYPE-POOLS: slis, icon.
INITIALIZATION.
Add display button to selection screen
functxt-icon_id = ICON_DISPLAY.
functxt-quickinfo = text-007.
sscrfields-functxt_01 = functxt.
Thanks,
Rajesh
Edited by: Rajesh Gupta on Nov 16, 2010 3:28 PMHi
TABLES: sscrfields.
TYPE-POOLS: slis, icon.
PARAMETERS: p_bukrs LIKE t001-bukrs.
SELECTION-SCREEN FUNCTION KEY 1.
INITIALIZATION.
* Add display button to selection screen
sscrfields-functxt_01 = icon_display.
In selection-screen you need to active the button by statament SELECTION-SCREEN FUNCTION KEY
Max -
How to add the BexAnalyser as standard radio button to the add-ins?
HI All,
how to add the BexAnalyser as standard radio button to the add-ins.
Thanks
VasuWhat do you want to do? Pls give some more details.
-
Add a Button to SAP Standard Transaction by using userexit
Hi All,
How to add a Button to SAP Standard Transaction by using User Exits ?
If any one is having step step material on the same , please forward me.
my id is : [email protected]
Thanks in advance
RKUSER EXIT
http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
http://www.sapgenie.com/abap/code/abap26.htm
http://www.sap-img.com/abap/what-is-user-exits.htm
http://wiki.ittoolbox.com/index.php/HOWTO:Implement_a_screen_exit_to_a_standard_SAP_transaction
http://www.easymarketplace.de/userexit.php
http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
http://www.sappoint.com/abap/userexit.pdfUser-Exit
http://www.sap-img.com/ab038.htm
http://help.sap.com/saphelp_46c/helpdata/en/64/72369adc56d11195100060b03c6b76/frameset.htm
http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
http://www.sap-img.com/abap/what-is-user-exits.htm
http://expertanswercenter.techtarget.com/eac/knowledgebaseAnswer/0,295199,sid63_gci982756,00.html
Rewards if useful.........
Minal -
Push Button in Every record in ALV grid output
Dear Experts,
I need to print a push button in first column of every record in ALV grid output. How ?
No OOPS concepts please.
Thanks,
Siva.For this requirement, you have to copy the standard PF status of the ALV output. Do as below :-
1) Go to SE41
2) Enter the program name as SAPLKKBL
3) In the field status enter STANDARD_FULLSCREEN
4) Click on STATUS button on the application toolbar.
5) Enter the name of your Program & a new status name.
6) Click on COPY.
This way the standard status will be copied to the custom status & call the same status in your program using SET PF STATUS statement. Then double click on the custom status name & you will be navigated to SE41, there you can add you new button on the application tool bar & assign a function code, which you can program by enabling the export parameter I_CALLBACK_USER_COMMAND of the Function module REUSE_ALV_GRID_DISPLAY.
Just a sample code snippet for your reference :-
FORM USER_COMMAND USING L_UCOMM LIKE SY-UCOMM
LS_SELFIELD TYPE SLIS_SELFIELD.
CASE L_UCOMM.
WHEN 'your function code goes here'.
Do further processing.
This way you will have the standard PF status alongwith your button as well.
Edited by: Kumar Manas Mishra on Jan 29, 2010 1:03 PM -
Creating buttons on title bar using alv
hi all good morning,
can any one help me in making a button on title bar of ALV report. Till now i have used only one function of ALV i,e REUSE_ALV_GRID_DISPLAY. it is showing proper out put but i want to make some action using my own button on the final ALV result displayed like save change etc.Hi,
How to add button to ALV toolbar using REUSE_ALV_LIST_DISPLAY?
In the program which calls ALV using REUSE_ALV_LIST_DISPLAY,
I have to add a new button.
I saw the demo program BCALV_GRID_08, which is written using ABAP-Controls.
In that example, the button is added using TOOLBAR event of cl_gui_alv_grid.
Could you help me to implement the same logic using REUSE_ALV_LIST_DISPLAY parameters.
you should copy the 'STANDARD' GUI status from program SAPLKKBL using transaction SE90 >Programming SubObjects> Gui Status.
Execute this transaction to get to next screen. select status using checkbox. click on GUI Status --> Copy.
Enter your Z program name and the name you what for this status - you can keep it as 'STANDARD' to be simple.
Then you can edit the new status to add or delete buttons. This will also bring in the standard SAP ALV functionality such as sorting/subtotaling etc...
When you call 'REUSE_ALV_GRID_DISPLAY' make sure you pass it the new status name.
an example of one of mine:
call function 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = 'ZSDBOLST_REPORT'
i_callback_pf_status_set = 'STANDARD' <----
i_callback_user_command = 'USER_COMMAND'
i_structure_name = 'I_BOLACT'
i_grid_title = 'BOL Action Report'(031)
is_layout = gs_layout
it_fieldcat = gt_fieldcat[]
i_save = 'A'
is_variant = v_variant
TABLES
t_outtab = i_bolact
EXCEPTIONS
program_error = 1
others = 2.
I just tried the same procedure ,but my entire application toolbar disappeared and a lock icon appears next to the application toolbar in my copied pf-status.
Could you advice what might have gone wrong ?
As identified with the FM's help you can do the following.
1). Using SE80 (I think) you can copy a GUI status from one program to another. It mentions which one in the FM's help.
2). Create a form named like so:
Code:
Form Set_pf_status
Notes: Called by FM REUSE_ALV_GRID_DISPLAY
FORM set_pf_status USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'ZSTANDARD'.
ENDFORM. "Set_pf_status
In the above case the GUI status copied was named ZSTANDARD and adjusted accordingly, adding and removing the desired buttons. A button was added called '%DELETE'.
3). Create the following report:
Code:
Form User_command
Notes: Called by FM REUSE_ALV_GRID_DISPLAY
Detects whether the icon/button for
'Return Tag Deletion' has been pressed. If it has then
detect whether any rows have been highlighted and then
set the delete flag.
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
DATA: li_count TYPE I.
IF r_ucomm EQ '%DELETE'.
LOOP AT %g00 WHERE mark EQ 'X'.
ADD 1 TO li_count.
ENDLOOP.
IF li_count GT 0.
gc_delete_flag = 'X'.
r_ucomm = '&F03'. "Back arraow
ELSE.
MESSAGE W000 WITH 'Please highlight the rows to be deleted!'.
ENDIF.
ENDIF.
ENDFORM. "User_command
As I've added an extra button to indicate which records should be deleted I need to identify a form to be called to process when this button is chosen.
Then when you call the ALV function you to specify the following extra details:
Code:
call function 'REUSE_ALV_GRID_DISPLAY'
exporting i_callback_program = gc_repid
I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
i_grid_title = lc_grid_title
is_layout = lc_layout
it_fieldcat = gt_fieldcat
it_sort = sort
i_save = l_save
is_reprep_id = l_bbs_id
is_variant = l_variant
tables t_outtab = %g00
exceptions program_error = 1
others = 2.
The parameters in capitals are the extra ones that need to be added.
Regards,
Satish -
Add button in REUSE_ALV_GRID_DISPLAY
Hi experts,
could you explain me how to add one simple button (even without functionality) by using of REUSE_ALV_GRID_DISPLAY?
This is what I have now without button:
v_repid = sy-repid.
v_layout-zebra = ' '.
v_layout-colwidth_optimize = 'X'.
v_layout-box_fieldname = 'SEL'.
v_grid_title = 'Anzeige der Preiskonditionen'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = v_repid
i_grid_title = v_grid_title
i_save = 'A'
i_structure_name = 'ZST_PREISUPLOAD'
is_layout = v_layout
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
TABLES
t_outtab = ta_csv_data
EXCEPTIONS
program_error = 1
OTHERS = 2.
Thank you for your help!Hi
If you need to have the standard ALG GRID menu, you don't have to transfer the routine for status (SET_PF_STATUS):
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = v_repid
i_grid_title = v_grid_title
i_save = 'A'
i_structure_name = 'ZST_PREISUPLOAD'
is_layout = v_layout
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
TABLES
t_outtab = ta_csv_data
EXCEPTIONS
program_error = 1
OTHERS = 2.
Else if you want to add a new button, you need to copy the standard status for grid (SAPLKKBL/STANDARD_FULLSCREEN) and then add your new buttons.
Of course if you want you can create a new status without to copy the standard one, but all ALV standard functionalities will miss.
Now you need to call your new status in the routine you've assigned to alv:
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = v_repid
i_grid_title = v_grid_title
i_save = 'A'
i_structure_name = 'ZST_PREISUPLOAD'
is_layout = v_layout
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
TABLES
t_outtab = ta_csv_data
EXCEPTIONS
program_error = 1
OTHERS = 2..
FORM SET_PF_STATUS USING RT_EXTAB TYPE SLIS_T_EXTAB.
APPEND 'MY_PREF' TO RT_EXTAB.
SET PF-STATUS 'MY_STATUS' EXCLUDING RT_EXTAB.
ENDFORM.
That form will be called automatically by ALV, it's important the interface is like above
Max -
Creating a cascading menu button an a GUI status
I have a GUI status on a normal screen (NOT on an ALV grid). On this status I have added 3 function buttons (SEARCH, CREATE, MANAGE). I want to add a 4th button that appears and acts like a cascading menu button. An example of what I want the button to look like is similar to what you would see on the standard 'Change Layout' button on an ALV Grid. I am not using an ALV grid, though - but I'm trying to get a button on the GUI status to act like that - where you click on it and you see multiple options such as Display, Edit, Copy.
I don't want to add this to my MENU bar. I'm trying to add it to my APPLICATION bar. If anyone has ever done this, please let me know how you did it.
Thank you for any helpful information.
-P. FoleyI think that is done with the "toolbar" control so it will be in the screen, not on the application bar... have a look at SAPTOOLBAR_DEMO1, and the CTMENU_* programs, plus
http://help.sap.com/saphelp_sm32/helpdata/en/8f/bcc23657ad0730e10000009b38f839/frameset.htm
for more info on this, if it is the style you want.
Or perhaps look at Generic Object Services to add a button between the application bar and below the menu (as in ME23N, FB03 etc)
Jonathan -
Hi,
I have created an Interactive report on a table. I want to add two buttons in each row: Accept and Reject, so that i can change the status(db column) of the corresponding record on button action.
How can I do so?Hi poojaC,
Try the below code,
i am giving the idea to add buttons..may be this is not the way you want.
step1
-- put this code in report region
select "ROWID",
'<input type="button" value="Accept" onclick="func('||EMPNO||')">' as "Accept",
'<input type="button" value="Reject" onclick="func('||EMPNO||')">' as "Reject",
"EMPNO",
"ENAME",
"JOB",
"MGR",
"HIREDATE",
"SAL",
"COMM",
"DEPTNO"
from "#OWNER#"."EMP"
-- edit the Accept and reject column and change Display type to "standard report column"Step 2 : create one function in page header like
-- here you can execute your process on button action
<script>
function func(id)
alert(id);
</script>Hope this will give you some idea.
Regards,
Jitendra -
How to setup the button inactive in pf-status?
who can tell me how to setup a button inactive in pf-status so that the button is inactive when the program is running?
there is a sample of button '&SUM' in PF-STATUS 'STANDARD'(lines 303) of program 'RM07MKON'.Hi huanzhiyu,
In a custom (Z) program you can make PF status buttons and subsequently their OK codes inactive by using the following command:
SET PF-STATUS 'STANDARD' EXCLUDING '&SUM'.
And if you need to exclude more than one OK code
data: itab type sy-ucomm occurs 0,
wa type sy-ucomm.
move '&SUM' to wa. append wa to itab.
move '&ADD' to wa. append wa to itab.
set pf-status 'STANDARD' excluding itab.
Hope this helps.
Regards,
Aditya -
Custom buttons in SORT FILTER at ALVs
Hi all ,
Please let me know how to attach custom push buttons to the Standard one ( sort , filter in alvs )
Regards
Aslam..Hi ,
Please search SDN before posting.
There are many threads on this topic.
If you are using 'REUSE_ALV_GRID_DISPLAY' then pass your PF status with desired functions to parameter i_callback_pf_status_set .
In factory method
CALL METHOD go_table->set_screen_status
EXPORTING
report = gv_cprog
pfstatus = gc_gui_status
set_functions = go_table->c_functions_all.
Hope this helps you.
Edited by: Harsh Bhalla on Jan 6, 2010 8:48 AM
Maybe you are looking for
-
Product advice for porting video to TV
Got a question. I want to connect my Analogue TV to my computer so i can wath movies, TV shows and even watch youtube full screen. Currently i have a Visiontek Radeon HD 6350 installed. I do not want to get rid of the card. I am looking for a card th
-
Swf, swc and the mxmlc, compc ant tasks
I'm a bit confused on the end result of the mxmlc / compc ant tasks, or maybe the difference between swf and swc files. I have a library of 60 or so AS3 files used for serialization/deserialization of my Java backend (using GDS for serialization of d
-
I had to factory reset my iPhone 4 because of memory constraints.
-
I have a Muse slide show that will not go away. I deleted it and uploaded the new files and it still shows up on the server. I deleted the entire server and it still shows up. Ive quit Muse, reinstalled it and even did the 2014 update and the slide
-
Can't send emails all of a sudden
My hard drive recently crashed on Mac Book Pro running Snow Leopard. Was finally able to reinstall everything and it was all working fine including mail (I was able to send and recieve). A few weeks prior Verizon had sent out a notice indicating em