Adding push buttons in standard ALV
Hi ,
Is there any possiblity to add custom push buttons to standard ALV in Webdynpro for ABAP.
If so, please provide me the solution.
Thanks in Advance.
cheers,
sravan.
I got the answer .
Similar Messages
-
Can we disable the default push buttons on the ALV Grid
Hi,
Can we disable the default push buttons on the ALV
Grid Control...
If so, pls send me the procedure...
thanks and regards
raghuHi,
In the PBO:
PERFORM f9100_exclude_functions USING :
i_exclude[] '&CHECK',
i_exclude[] '&REFRESH',
i_exclude[] '&LOCAL&CUT' ,
i_exclude[] '&LOCAL©',
i_exclude[] '&LOCAL&PASTE',
i_exclude[] '&LOCAL&PASTE_NEW_ROW',
i_exclude[] '&LOCAL&UNDO' ,
i_exclude[] '&LOCAL&APPEND',
i_exclude[] '&LOCAL&INSERT_ROW',
i_exclude[] '&LOCAL&DELETE_ROW',
i_exclude[] '&SORT_ASC',
i_exclude[] '&SORT_DSC',
i_exclude[] '&FIND',
i_exclude[] '&SUMC',
i_exclude[] '&SUBTOT',
i_exclude[] '&MINIMUM',
i_exclude[] '&MAXIMUM' ,
i_exclude[] '&VGRID' ,
i_exclude[] '&VEXCEL' ,
i_exclude[] '&VCRYSTAL',
i_exclude[] '&HTML',
i_exclude[] '&MAINTAIN',
i_exclude[] '&SAVE',
i_exclude[] '&GRAPH',
i_exclude[] '&HELP',
i_exclude[] '&ALL' ,
i_exclude[] '&SAL' .
* i_exclude[] '&EXCLALLFC'.
*& Form f9100_exclude_functions
* This form exclude buttons from the toolbar.
* -->P_IEXCLUDE text
* -->P_1150 text
FORM f9100_exclude_functions USING pexclude LIKE i_exclude
value(pfunction).
DATA: l_exclude TYPE ui_func.
l_exclude = pfunction.
APPEND l_exclude TO pexclude.
ENDFORM. " f9100_exclude_functions
This will exculde the default push buttons.
Let us know if it works for you.
Regards,
Anjali -
How to add a push button on an ALV grid ?
Hi,
How to add a push button on an ALV grid, using ON_TOOLBAR, ON_USERCOMMAND Methods. Clicking on that push button, a new screen has to be displayed.Hi,
Assuming that you want to have a "push-button" column, i.e. push-buttons within an ALV grid then you need to implement the following steps:
(1) Set the style of the column as button
ls_fcat-style = CL_GUI_ALV_GRID => MC_STYLE_BUTTON.
(2) When the user pushes the button event BUTTON_CLICK is triggered. Thus, define an appropriate event handler method.
<b>Reward points</b>
Regards -
How to disable the custom push button in Classic ALV
Hi All,
Iam Using Classic Alv (with out classes).I have a created a push button.now at run time i want to make it dynamic .
iam using REUSE_ALV_GRID_DISPLAY
for ex.
i have some records in my out put.
i have a push button "INSERT"
For first time when i clicked it will be inserted.
Now if i run the report for the same inputs as top,i will get the records.But the "INSERT" push button should be disable.IS that Possible ??
If yes kindly send me the solution.Hi,
Here is the piece of code for your understanding...
FORM f4200_pf_status_set USING i_extab TYPE slis_t_extab.
REFRESH i_extab.
PERFORM f4210_exclude_fcodes CHANGING i_extab.( This form is mentioned below ).
SET PF-STATUS 'STANDARD' OF PROGRAM '(Program name)' EXCLUDING i_extab.( This line of code will excude the function u don't want)
ENDFORM.
FORM f4210_exclude_fcodes USING i_extab TYPE slis_t_extab.
DATA: ws_fcode TYPE slis_extab.
CLEAR ws_fcode.
ws_fcode = '&EB9'.
APPEND ws_fcode TO i_extab.
ws_fcode = '&ABC'.
APPEND ws_fcode TO i_extab.
ws_fcode = '&NFO'.
APPEND ws_fcode TO i_extab.
ws_fcode = '&LFO'.
APPEND ws_fcode TO i_extab.
ENDFORM. " f4210_exclude_fcodes
I hope this clarifies. Revert for any queries.
Cheers,
Venkat -
Execute in Back ground when push button clicked on alv output
Hi Friends,
I have a alv list display report with check boxes and a 'Detail' Push button in output
when i check the check boxes and click on the 'Detail' Push button detail report is
displayed using 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'. My requirement is if I click on 'Detail'
push button the code should also execute in back ground creating the spool. Request you
to help with sample code. I tried with below but not working.
WHEN 'DETAIL'.
call function 'START_OF_BACKGROUNDTASK'
exporting
startdate = sy-datum
starttime = sy-uzeit
exceptions
others = 1.
if sy-subrc = 1.
exit.
ELSE.
PERFORM determine_table_from_output CHANGING rs_selfield.
PERFORM call_alv_detail.
endif.
commit work.
Thanks,
Neetha.You could encapsulate the detail display in a separate report and call it in your 'DETAIL'-section like this:
DATA: lv_number TYPE tbtcjob-jobcount,
lv_name TYPE tbtcjob-jobname,
ls_rsparams TYPE rsparams,
lt_rsparams LIKE STANDARD TABLE OF ls_rsparams.
* Get free job number
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = lv_name
IMPORTING
jobcount = lv_number
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
IF sy-subrc = 0.
SUBMIT 'ZDISPLAY_DETAIL'
VIA JOB lv_name NUMBER lv_number
WITH SELECTION-TABLE lt_rsparams
AND RETURN.
IF sy-subrc = 0.
* Submit
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = lv_number
jobname = lv_name
strtimmed = 'X'
EXCEPTIONS
cant_start_immediate = 1
invalid_startdate = 2
jobname_missing = 3
job_close_failed = 4
job_nosteps = 5
job_notex = 6
lock_failed = 7
OTHERS = 8.
ENDIF.
Regards,
Ulrich -
Hi Freinds ,
I'm Working on OOPS ALV And i want to know how to add a seprate colomn for push button in ALV means i know how to make all cells of a coloumn as push button but now i want to add a separate coloumn for push button in that oops alv so can any one help me if useful it will be rewarded and please just dont copy paste the code by taking it from other sites please explain me how can i make it possibleHi,
You have to add another column in your internal table with some name 'PUSH' for example. Add this field in fieldcatelog also. Set the properties of this field as a push button. Now you will have a additional column in your ALV display with all pushbuttons.
Hope this solves the problem.
Thanks and Regards,
Lakshmi. -
Adding custom button in standard toolbar in ALV
Hello All,
I need to add a customized button called "Copy" on ALV. The following code is giving me few standard buttons like "Append" "Delete" "Insert" etc. So, how can I add "Copy" button besides one of these standard buttons.
data: l_value type ref to cl_salv_wd_config_table.
data: lr_table_settings type ref to if_salv_wd_table_settings.
lr_table_settings ?= l_value.
lr_table_settings->set_read_only( abap_false ).
Appreciate help.
Thks & Rgds,
HemalCreate One method
And inside that method write the below code
(Here i am creating delete button you can create any name button you want just replace the name
DATA lV_EDITBTN TYPE REF TO cl_salv_wd_fe_button.
DATA lr_buttonui TYPE REF TO cl_salv_wd_fe_button.
CREATE OBJECT lr_buttonui.
lr_buttonui->set_text( 'Details' ).
lr_buttonui->set_tooltip(
'Shows Detail Screen as per the View selected' ).
Generating Function Object for Button.*
DATA btn_button TYPE REF TO cl_salv_wd_function.
btn_button = lo_value->if_salv_wd_function_settings~create_function(
id = 'DETAILS' ).
btn_button->set_editor( lr_buttonui ).
DATA lr_buttonui1 TYPE REF TO cl_salv_wd_fe_button.
After that create another method and make it as a event ( it means now it become event )
select event ON FUNCTION FROM THE LIST
Inside that event write
CASE LV_FCODE.
WHEN 'DETAILS'.
wd_this->fire_OP_TODEATILS_plg( ).
endcase.
May be it may help -
Adding new button to Standard Page and Launching CP when clicked
Hi,
I have a requirement to add a new button to a standard OAF page and when it is clicked, I need to launch a Concurrent Program. Can you please let me know any links/pointers/documents where I can get the details as how this can be accomplished.
TIA.anyone?
-
Adding a button to standard OWL
Hello Gurus,
How do we add a custom button to the Accounts OWL and act on click of it?
I see that the UI is not extensible like that.
The requirement is to select a number of customers from the list and click the button. The button click should call an action on the account business object.
Can we add an embedded component below the list, add a button and on click of that, call action on the BO. How do we get the selected rows (customer IDs)?
Any suggestions are appreciated.Hi Mahesh,
the Account-BO is not an ESF2-Object. Therefore you won't have the possibility to add an action on Account-BO. The action-feature is only available on ESF2-Objects (like Service Request, Activity etc.). -> a Button in an EC would be an option, BUT I am not sure, if it is even possible to get the selected rows from the standard.
A more heavy aproach would be to build your own Account OWL and show this instead of the standard OWL. This would have much more dev. effort, but provides you all freedom for custom action. But you would need to rebuild all the standard functionality (I guess you cannot rebuild everything there from PDI).
Best regards
Tom -
Adding a button to standard bar
hi all,
iwant to add buttons to the tool bar can anybody plz help me out.
THANKS
ANUPAMA
Edited by: deep kammula on Apr 14, 2008 3:43 PMIn that case you better make use of the ALV grids, see the example below...
Example report(type - ALV(ABAP list viewer))
REPORT Z_ALV_SIMPLE_EXAMPLE_WITH_ITAB .
*Simple example to use ALV and to define the ALV data in an internal
*table
*data definition
tables:
marav. "Table MARA and table MAKT
Data to be displayed in ALV
Using the following syntax, REUSE_ALV_FIELDCATALOG_MERGE can auto-
matically determine the fieldstructure from this source program
Data:
begin of imat occurs 100,
matnr like marav-matnr, "Material number
maktx like marav-maktx, "Material short text
matkl like marav-matkl, "Material group (so you can test to make
" intermediate sums)
ntgew like marav-ntgew, "Net weight, numeric field (so you can test to
"make sums)
gewei like marav-gewei, "weight unit (just to be complete)
end of imat.
Other data needed
field to store report name
data i_repid like sy-repid.
field to check table length
data i_lines like sy-tabix.
Data for ALV display
TYPE-POOLS: SLIS.
data int_fcat type SLIS_T_FIELDCAT_ALV.
select-options:
s_matnr for marav-matnr matchcode object MAT1.
start-of-selection.
read data into table imat
select * from marav
into corresponding fields of table imat
where
matnr in s_matnr.
Check if material was found
clear i_lines.
describe table imat lines i_lines.
if i_lines lt 1.
Using hardcoded write here for easy upload
write: /
'No materials found.'.
exit.
endif.
end-of-selection.
To use ALV, we need a DDIC-structure or a thing called Fieldcatalogue.
The fieldcatalouge can be generated by FUNCTION
'REUSE_ALV_FIELDCATALOG_MERGE' from an internal table from any
report source, including this report.
Store report name
i_repid = sy-repid.
Create Fieldcatalogue from internal table
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = i_repid
I_INTERNAL_TABNAME = 'IMAT' "capital letters!
I_INCLNAME = i_repid
CHANGING
CT_FIELDCAT = int_fcat
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.
*explanations:
I_PROGRAM_NAME is the program which calls this function
I_INTERNAL_TABNAME is the name of the internal table which you want
to display in ALV
I_INCLNAME is the ABAP-source where the internal table is defined
(DATA....)
CT_FIELDCAT contains the Fieldcatalouge that we need later for
ALV display
IF SY-SUBRC <> 0.
write: /
'Returncode',
sy-subrc,
'from FUNCTION REUSE_ALV_FIELDCATALOG_MERGE'.
ENDIF.
*This was the fieldcatlogue
Call for ALV list display
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = i_repid
IT_FIELDCAT = int_fcat
TABLES
T_OUTTAB = imat
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
*explanations:
I_CALLBACK_PROGRAM is the program which calls this function
IT_FIELDCAT (just made by REUSE_ALV_FIELDCATALOG_MERGE) contains
now the data definition needed for display
I_SAVE allows the user to save his own layouts
T_OUTTAB contains the data to be displayed in ALV
IF SY-SUBRC <> 0.
write: /
'Returncode',
sy-subrc,
'from FUNCTION REUSE_ALV_LIST_DISPLAY'.
ENDIF. -
How Edit text push button screen standard
Hello Experts,
In SAPMV56A program when I see the display screen 1025 in screen painter there are some buttons with the
name of structures, for example :
RV56A-ICON_STDIS
RV56A-ICON_STREG
RV56A-ICON_STLBG
RV56A-ICON_STLAD
RV56A-ICON_STABF
RV56A-ICON_STTBG
RV56A-ICON_STTEN
the problem is that when I run this program, transaction "VT01N" the text that appears on these buttons is different
the text that is screen painter, there is a transaction where I can define what should be the text that I want
appear for these buttons?
thanks for your help.Okay this is an old thread, but as it`s not answered...
I found a way to change the labels of the pushbuttons, as follow:
On SE80:
Program SAPMV56A
Screen 1025
Go to -> Translate
Insert your destination language
Expand the <SRT4> and double click the
SAPMV56A 1025 / VTR
There you can translate the buttons that are used on the screen. this modification is applied to VT01n/VT02n/VT03n.
Some labels on the left part of the screen (not the buttons) get the text from DDIC, for those you`ll have to translate the data element on CMOD. -
I have done coding for G/L interface . This report displays an ALV at the end after performnig validations on each record uploaded from a flat file. Once all records are checked , the ALV requires a PUSH BUTTON that when triggered will post the records.
My query is, how shud i add a push button in the ALV in the title bar.Hi,
You have to copy the standard pf status to a new one.
For this go to the ALV screen and take the menu System -> Status. (I do not access to the system now) then look for the standard pf status. Copy this to Z range and then add your new button.
Even you can do in this method
Create a GUI status.
Go to GUI Status->Application toolbar.
THen add the button by giving
Function text
Icon name
Icon text
Info. text
Fastpath
Then in PBO of the screen,
Just give in a module
set pf_status 'ZSTATUS'.
Here is an example for your question
TYPE-POOLS: slis.
DATA: i_qmel LIKE qmel OCCURS 0.
data v_repid type repid.
SELECT * FROM qmel INTO TABLE i_qmel.
v_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = v_repid
I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
i_structure_name = 'QMEL'
TABLES
t_outtab = i_qmel
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 set_pf_status using rt_extab type slis_t_extab.
set pf-status 'TEST'.
endform.
FORM user_command USING ucomm LIKE sy-ucomm
selfield TYPE slis_selfield.
data lv_ucomm type sy-ucomm.
lv_ucomm
= sy-ucomm.
CASE lv_ucomm.
WHEN 'BUTTON'. "Double Click line Item
call transaction 'MM01'.
endcase.
endform.
To Click on the you have to do in the following way
i_callback_user_command = 'USER_COMMAND'
form user_command using i_ucomm like sy-ucomm
is_selfield type slis_selfield.
case i_ucomm.
when 'XXXX'. "XXXX is the function code for new button
endcase.
endform.
For More info please refer the below links
Please refer the following
https://www.sdn.sap.com/sdn/collaboration.sdn?contenttype=url&content=https%3A//forums.sdn.sap.com/thread.jspa%3FthreadID%3D38170%26messageID%3D368851
http://www.sap-basis-abap.com/abap/add-button-to-alv-toolbar-with-reuse-alv-list-display.htm
Regards,
Chandru -
Function keys for Push buttons
Hi All,
I have one query in module-pool program,I need to assign Function keys to Push buttons in my programe,like for create(F7),dispaly(F6) and also I need to overwrite few standard function keys,
any one please guide me.
Thanks n regds,
Sree.Hi,
you want in more detail.....ok
(1)u've created a screen -
> added push buttons etc. -
> given name to screen elements i.e pushbuttons etc.and also declared them in program
(2) create its GUI status ,say STATUS_100---->here you have to assign Function codes ->like if in standard toolbar you want BACK,EXIT,CANC or whatever you want,for ex. for BACK u'll find its icon -> double click on it>give the Func code say F3,now u also wnt to enable Func Key F3 for this--> go to UTILITIES (menu bar)-> F Key consistency-> here u will find all the Func keys-> so to F3 give the same func code as u gave to BACK icon button.
similar approach u can use for pussbuttons:
double click on push button> in screen painter attributes-> give the Func code to it ,say for CREATE button u give Func code NEW->come back to GUI status->similarly go to UTILITIES (menu bar)-> F Key consistency-> here u will find all the Func keys---> so to F7 give the same func code (NEW) as u gave to CREATE push button.
(3) In PBO of this screen create a module to set its PF status:
In screen flow logic:
PROCESS BEFORE OUTPUT.
* To set pf-status and title
MODULE status_0100.
In Program:
MODULE status_0100 OUTPUT.
SET PF-STATUS 'STATUS_100'.
SET TITLEBAR 'TITLE_100'.
ENDMODULE.
Hope this much detail is quite clear!!!
Regards,
Neha
Edited by: Neha Shukla on Mar 5, 2009 10:35 AM -
How to add a button on the ALV LIST pop up
Hi ,
Can any one help me to add a button on the ALV list which is a pop up using ABAP Objects.
Thanks in advance.
Regards,
Kavya.HI ,
I want to add a push button on the ALV list out put which is comming as a pop up and I want this using classes and methods.
I have got a method IF_SREL_BROWSER_COMMANDS~ADD_BUTTONS from class cl_gos_attachment_list but still I am unable to get any additional button on the output ALV popup.
Please help.
Regards,
Kavya. -
Push button on the alvgrid tool bar?
how can u place push button on the ALV GRID TOOL BAR?
Hi,
1. create the local class and implement the Toolbar event.
2. within the event to add the new button.
see the below example code.
CLASS LCL_EVENT_HANDLER DEFINITION.
PUBLIC SECTION.
METHODS:
HANDLER_TOOLBAR FOR EVENT TOOLBAR OF CL_GUI_ALV_GRID
IMPORTING E_OBJECT E_INTERACTIVE ,
HANDLER_USER_COMMAND FOR EVENT USER_COMMAND OF CL_GUI_ALV_GRID
IMPORTING E_UCOMM .
ENDCLASS. "lcl_event_handler DEFINITION
CLASS LCL_EVENT_HANDLER IMPLEMENTATION.
Toolbar -----Create 'Add Issue' button
METHOD HANDLER_TOOLBAR.
DATA: L_WA_TOOLBAR TYPE STB_BUTTON. " Toolbar
CLEAR: L_WA_TOOLBAR.
Button Type
L_WA_TOOLBAR-BUTN_TYPE = C_BUTTON_TYPE . " 3.
APPEND L_WA_TOOLBAR TO E_OBJECT->MT_TOOLBAR.
Add Issue Button.
CLEAR: L_WA_TOOLBAR.
L_WA_TOOLBAR-FUNCTION = 'ADD_MI' . " 'ADD_MI' .
L_WA_TOOLBAR-ICON = 'ICON_CREATE'.
L_WA_TOOLBAR-QUICKINFO = 'CREATE' . " 'Add Issue'.
L_WA_TOOLBAR-TEXT = 'CREATE' . " 'Add Issue'.
L_WA_TOOLBAR-DISABLED = ''.
APPEND L_WA_TOOLBAR TO E_OBJECT->MT_TOOLBAR.
CLEAR: L_WA_TOOLBAR.
ENDMETHOD. "handler_toolbar
User Actions Events-- Handle 'Add Issue' Button Click.
METHOD HANDLER_USER_COMMAND.
CASE E_UCOMM.
Add Issue Button.
WHEN C_ADD_MI.
IF NOT G_MATNR IS INITIAL.
FG_REFRESH = C_TRUE.
PERFORM F_ADD_MEDIAISSUE.
ENDIF.
ENDCASE.
Refresh Control
CALL METHOD CL_GUI_CFW=>FLUSH
EXCEPTIONS
CNTL_SYSTEM_ERROR = 1
CNTL_ERROR = 2
OTHERS = 3.
Handle Exceptions
IF SY-SUBRC <> 0.
CASE SY-SUBRC.
WHEN 1.
G_ERROR_TEXT = TEXT-026. " 'Control System Error'.
WHEN 2.
G_ERROR_TEXT = TEXT-027. " 'Control CL_GUI_CFW Has Raised Error'.
ENDCASE.
MESSAGE G_ERROR_TEXT TYPE 'E'.
ENDIF.
Refresh Alv Grid.
PERFORM F_REFRESH_GRID.
ENDMETHOD. "handler_user_command
ENDCLASS. "lcl_event_handler IMPLEMENTATION
Object Ref. Event Class.
DATA: OBJ_EVENT_HANDLER TYPE REF TO LCL_EVENT_HANDLER.
refer the sample program BCALV_GRID_05 in SE38
Reward if found helpful.
Regards,
Boobalan Suburaj
Maybe you are looking for
-
"has encountered a problem and needs to close"
receiving this message for past 12 hours when trying to open itunes any help?? thanks!!
-
I bought Time Capsule specifically to back up my computer at work. Only my computer. There are many computers within my department. I completed the steps the best of my knowledge but was unsure of which option to click. I clicked "I want to create a
-
Nothing more to add, cannot find view source.
-
Can't open the configuration window in Airport Utility
The Airport Utility was able to recognized my AEBS, but failed to read the setting of my AEBS and therefore can't successfully opened the configuration window; just asked me to check if my computer was within range ??????? Logging into the config pan
-
What are the methods to modify SAP standard tables?
hi what are the methods to modify SAP standard tables?