ALV User defined toolbar button
I have defined a checkbox button i.e button type is 5 , in the alv toolbar.
I have handled the toolbar button with an event handler also.
But how do i check in the handle_user_command event handler whether the button is checked or unchecked i.e selected or unselected.
if anyone has a sample code for this pls attach the link.
Thanks,
Rohit.
Hi,
You trigger out a message when it is checked or unchecked.
IF CHK1 = 'X'.
MESSAGE I001. " CHECKBOX IS SELECTED.
ELSE.
MESSAGE I002. " CHECKBOX IS NOT SELECTED.
ENDIF.
Hope this helps.
Cheers!!
Similar Messages
-
Enable User Defined toolbar button on click - editable alv grid using oops
Hi all,
I have created editable alv using oops concept.
created 2 user defined toolbar button save and print using method toolbar
ls_toolbar-text = 'Print'. "#EC NOTEXT
ls_toolbar-quickinfo = space.
ls_toolbar-checked = space.
APPEND ls_toolbar TO e_object->mt_toolbar.
requirement is
initially print button should be disabled, and save enabled
when i click save button, print button should be enabled.
I want coding in editable alv oops concept
kindly help
regards
senthil kumarHalo Senthil,
You should call set_toolbar_interactive method of cl_gui_alv_grid in the on_user_command( ie the event handler for event user command) .
method on_user_command.
case e_ucomm.
when 'SAVE'. or whatever your function code is .
my_save_flag = 'X'.
call method grid->set_toolbar_interactive.
endmethod.
This triggers the toolbar event of the
cl_gui_alv_grid. Inside the eventhandler method ( ie the on_toolbar method ) you should set the toolbar.
if my_save_flag = 'X'.
read table e_object->mt_toolbar
clear l_toolbar-disabled.
modify e_object->mt_toolbar.
endif.
e_ucomm will not have the function code if the save button is not in the toolbar area.
then you can set the my_save_flag in the data_changed event handler of the Cl_gui_alv_grid.
Regards
Arshad -
Hi Friends,
How to add a user defined toolbar for ALV programs. Please help me. I need very urgent.
Regards
PraveenHi Praveen,
The following document gives you almost everything that you need to know about an ALV -
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/an easy reference for alv grid control.pdf
Regards,
Anand Mandalika. -
Hi,
In hierarchial list display.
I'm implementing my own user defined status.
I have copied the standard status and modified for SAVE & BACK functions.
In the at user command module i have coded for SAVE & BACK.
for SAVE it's working fine where as for BACK control is not coming to my user command module.it's just going back to the previous screen.how to implement the function code for BACK.
Regards
RaghavendraHi Raghavendra,
in the PAI event of ur screen from where u want to go back to user command.
sample code:
<b>PROCESS AFTER INPUT</b>.
<b>MODULE <modulename> AT EXIT-COMMAND.</b>
<b>MODULE <modulename> INPUT.</b>
IF OK-CODE = 'BACK' .
LEAVE PROGRAM.
ENDIF.
<b>ENDMODULE.</b>
instead of <b>LEAVE PROGRAM</b> u can also use
<b>LEAVE TO SCREEN 0</b>.
hope this works fine for u. -
ABAP Web Dynpro ALV - User Defined Functions
Dear All,
I don't know if my question is worth a new topic, but since I haven't found any appropriate answer by now I want you to ask the following:
We're using the ALV web dynpro component to manage data and have added user functions in order to display buttons for saving data and adding new lines.
Everything worked fine for us until some users adjusted the default view of the table by using the default 'Settings' option to hide some columns.
The problem we're facing now is that the labels of the additional buttons - which were set up by use of OTR texts on initialisation of the dynpro - are blank until the user navigates on the dynpro or changes some cell contents. After that labels are shown correctly again.
The problem is that I cannot simulate this dynamically, neither I can narrow down the source of the problem at all.
A prompt reply would be very much appreciatedHi Eddy,
Could you please create a CSN ticket for this problem, the component is BC-WD-CMP-ALV.
Please enter all relevant data and access to your system to the message.
Thanks,
Regina -
Execute user defined push button in BackGround
Hi Guys,
I have a report with selection screen.
I have defined a pushbutton on selection screen.
My requirement is when I put my program in Background its should execute the pushbutton's code not the F8 button.
How to achieve this.
Thanks in Advance,
Prasad.Create a BDC for u r report.
do the recording for SE38 or SA38. If u assign T-Code for that report do recording for that T-Code. write a bdc for it.
at last instead of Execute button, press u r custom push button.
and schedule the BDC Program.
Regards,
Santosh Reddy
Edited by: Santosh Reddy on Apr 6, 2009 10:29 PM -
ALV with user-defined buttons on toolbar in wd abap
Hi All,
I have to create an alv with user defined buttons in wd abap on its toolbar.Could any one tell me in detail about it or provide me with any tutorial based on it.
Thanking you all in advance.DATA: LR_CMP_USAGE TYPE REF TO IF_WD_COMPONENT_USAGE.
DATA: LR_INTF_ALV TYPE REF TO IWCI_SALV_WD_TABLE.
LR_CMP_USAGE = WD_THIS->WD_CPUSE_ALV( ).
IF LR_CMP_USAGE->HAS_ACTIVE_COMPONENT( ) EQ ABAP_FALSE.
LR_CMP_USAGE->CREATE_COMPONENT( ).
ENDIF.
LR_INTF_ALV = WD_THIS->WD_CPIFC_ALV( ).
WD_THIS->M_MODEL = LR_INTF_ALV->GET_MODEL( ).
DATA: LR_FUNCTION TYPE REF TO CL_SALV_WD_FUNCTION.
LR_FUNCTION =
WD_THIS->M_MODEL->IF_SALV_WD_FUNCTION_SETTINGS~CREATE_FUNCTION(
ID = 'ISSUE' ).
DATA: LR_BUTTON TYPE REF TO CL_SALV_WD_FE_BUTTON.
CREATE OBJECT LR_BUTTON.
LR_BUTTON->SET_TEXT( 'Issue/Receive' ).
LR_FUNCTION->SET_EDITOR( LR_BUTTON ).
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/101df93f-4b5c-2910-14aa-9eb0338c2110
Abhi -
Applying ALV toolbar button funtionality in user developed button .
Can any body tell me the step by step approch of getting ALV toolbar button funtionality in user developed button in application toolbar ? That is i develop one button on application toolbar and on click on this i want any one toolbar button funtionality on my developed button . how can i do this?
Hi,
To create a button on ALV list display, Like to create a "BACK" button on your ALV tool bar,, you need to first define & create a pf status then call it in your REUSE.. fm,,
below code will explain you all the things,,
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
i_grid_title = text-001
is_layout = s_layout
it_fieldcat = i_fcat
i_save = lf_save
is_variant = s_disvariant
TABLES
t_outtab = i_pernr[]
EXCEPTIONS
program_error = 1
OTHERS = 2.
* FORM USER_COMMAND *
FORM user_command USING ucomm LIKE sy-ucomm
selfield TYPE slis_selfield.
CASE ucomm.
WHEN 'BACK'.
leave to screen 0.
ENDCASE.
ENDFORM. "user_command " USER_COMMAND
* 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 'BACK_BUTTON'.
ENDFORM. "Set_pf_status
First you shuld to create a GUI status for your screen dispalying the list (For this copy a GUI status from a standard program and paste it in 'BACK_BUTTON')
then in Application Toolbar ,, Just create a button as BACK ,, Keep the FUNCTION CODE as BACK ..
I think you got the idea, how to use any GUI for ALV list .. -
How to create user defined button in alv report
how to create user defined button in alv report
thnks in advance.Hi,
U can define it the the PF-STATUS ( Menu for ALV ).
For that u have to define it in the EVENTCAT.
form z_eventcat using p_i_eventcat type slis_t_event.
data: i_event type slis_alv_event.
call function 'REUSE_ALV_EVENTS_GET'
exporting
i_list_type = 0
importing
et_events = p_i_eventcat
exceptions
list_type_wrong = 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.
clear i_event.
read table p_i_eventcat with key name = slis_ev_top_of_page into
i_event.
if sy-subrc = 0.
move 'TOP_OF_PAGE' to i_event-form.
append i_event to p_i_eventcat.
endif.
read table p_i_eventcat with key name = slis_ev_pf_status_set into i_event.
if sy-subrc = 0.
move 'SET_PF_STATUS' to i_event-form.
append i_event to p_i_eventcat.
endif.
clear i_event.
read table p_i_eventcat into i_event with key name = slis_ev_user_command .
if sy-subrc = 0.
move 'USER_COMMAND' to i_event-form.
append i_event to p_i_eventcat.
endif.
And in the DISPLAY
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = v_progname
i_callback_pf_status_set = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
i_callback_top_of_page = 'TOP_OF_PAGE'
i_grid_title = v_gridtitle
i_save = 'A'
is_layout = i_layout
it_fieldcat = i_fieldcat[]
it_sort = i_sortinfo
it_events = i_eventcat
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
tables
t_outtab = it_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.
*MENU SETTINGS.
form set_pf_status using rt_extab type slis_t_extab.
set pf-status 'ALV_MENU'.
endform. "SET_PF_STATUS
endform. " Z_EVENTCAT
Now double click on ALV MENU nad u can create a button in the application bar.
Regards,
Pritha. -
HI ALL
JUST WANT TO KNOW CAN WE HANDLE USER DEFINED EVENTS BY SETTING USER DEFINED PF -STATUS IN ALV
FOR EG :
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
i_callback_program = gd_repid
I_CALLBACK_PF_STATUS_SET = K_STATUS
I_CALLBACK_PF_STATUS_SET = 'ZTEST1'
i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
i_callback_u ser_command = 'USER_COMMAND'
I_CALLBACK_USER_COMMAND = K_USER_COMMAND
IS_LAYOUT = GD_LAYOUT
IT_SPECIAL_GROUPS = KR_SP_GROUP
i_grid_title = outtext
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
it_special_groups = gd_tabgroup
IT_EVENTS = GT_XEVENTS
i_save = 'X'
IS_VARIANT = K_VARIANT
IT_EVENTS = KR_EVENTS[]
is_variant = z_template
tables
t_outtab = it_ekko
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.
endform. " DISPLAY_ALV_REPORT
I HAVE MY OWN PF-STATUS IN WHICH I HAVE CREATED 1 BUTTON WHEN I GET THE OUT PUT AND CLICK ON THAT BUTTON THAN IT GOES TO STANDARD PROGRAM ....I WANT WHEN IT CLICK ON THAT BUTTON IT GOES TO MY Z PROGRAM HOW CAN I DO THAT ...
IF POSSIBLE PLZ PROVIDE CODE OR SOME EXAMPLE .
THANKS
TARANU can have button on application toolbar.
You just have to use the new pf status in your report program.
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.
Have a look at below code for using the new status.
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
<b>I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'</b>
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.
<b>form set_pf_status using rt_extab type slis_t_extab.
set pf-status 'TEST'.
endform.</b>
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
**Write ur functinality here
endcase.
endform.
Also have a look at below links.
http://www.sap-basis-abap.com/abap/add-button-to-alv-toolbar-with-reuse-alv-list-display.htm
ALV report
I hope it helps.
Best Regards,
Vibha
*Please mark all the helpful answers -
CFolders - User Defined Buttons
Hi All,
I went to SPRO -> Collaboration Folders and created a User-defined button for showing the status report.
The place at which is displayed, i have chosen "Default".
Then went to SPRO -> Collaboration Folders and BADI, created a new implementation name and activated with the Filter ID as the new button id (created from the above step).
But now my question is, in the cFolders, i can't able to see the button. Any other specific setting need to be done, to display the button?
And also i would like to know, when i click the button, it has to generate an ABAP report in html format. Any suggestion on this?
Regards,
AnandhiI don't think this is possible in the ALV, you may add another toolbar using class [CL_GUI_TOOLBAR|http://help.sap.com/saphelp_NW70EHP1core/helpdata/en/8f/bcc23657ad0730e10000009b38f839/frameset.htm].
(You can search sdn for sample or look at SAP sample SAPTOOLBAR_DEMO1)
Regards,
Raymond -
Hi all,
I am doing an ALV through an user defined pf-status.But when I am using this pf-status I am unable to find the standard application tool bar and remaining also.I have seen some threads regarding this. These threads are giving me the suggestions to copy the standard pf status of ALV into user defined pf status. How to copy this standard pf status to my program.
Sathish Reddy.First of all you must copy STANDART status from any ALV example in SLIS Development Class into your report.
You can change this status Properties. (Functions, Buttons)
And you must add this form to Active Your Status in ALV.
*& Form set_pf_status
* text
* --> p1 text
* <-- p2 text
form set_pf_status using rt_extab type slis_t_extab.
set pf-status 'STANDARD' excluding rt_extab.
endform.
and you must add specified line in your callf of ALV Function.
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
i_callback_program = g_repid
it_fieldcat = gt_fieldcat[]
it_events = t_events[]
i_callback_user_command = 'USER_COMMAND'
i_callback_pf_status_set = 'SET_PF_STATUS' <<<<<< ADD THIS
tables
t_outtab = mglistoutput.
ibrahim -
Problem with ALV and user defined selection screen. please help!
Hi Experts,
I have program which has a user defined selection screen 9001. On executing the selection screen i call a ALV using resuse_alv_grid function module.
What problem I am facing is that when I press back button from ALV page it goes to the se38 editor instead of selection screen.
How to resolve this?
Thanks
GopalHi,
This might be due to LEAVE TO TRANSACTION statement. You might be running the program from SE38. Try to run the program using Z-TCode assigned to it.
Thanks and Regards,
Bharat Kumar Reddy.V
Message was edited by: Bharat Reddy V -
Handling the Standard Toolbar Button click of an ALV
Hi Experts,
I have created an ALV grid output using CL_GUI_ALV_GRID with standard buttons(default) on the toolbar. When I click on any of these standard buttons, say '+' button to insert records, my custom program is not hit.
I know there is a protected event 'TOOLBAR_BUTTON_CLICK' which I tried to handle in my program but it did not work. However, I am able to handle the public event 'DOUBLE_CLICK' of the same class 'CL_GUI_ALV_GRID'.
So..can anyone tell how to handle this protected event OR how to handle the STANDARD buttons on ALV toolbar so that they hit my custome code.
Thanks very much.
Regards,
RudreshHello Rudresh
The point is to "re-define" the standard ok-codes of toolbar buttons:
" Make toolbar interactive
CALL METHO go_grid->set_toolbar_interactive( ). " raises event TOOLBAR
" Event handler method
METHOD handle_toolbar.
* define local data
DATA: ls_button TYPE stb_button.
" Redefine function code
LOOP AT e_object->mt_toolbar INTO ls_button
WHERE ( function = cl_gui_alv_grid=>MC_FC_LOC_INSERT_ROW ).
ls_button-function = 'MY_FCODE'. " triggers USER_COMMAND
MODIFY e_object->mt_toolbar FROM ls_button INDEX syst-tabix.
ENDLOOP.
ENDMETHOD.
Regards
Uwe -
ALV view : Problem with user defined views
Dear Experts,
We are facing a problem pertaining to user defined views for a ALV table that we have in SAP eRecruiting application in webdynpro ABAP. The problem is as follows.
There is a candidate application ABC & only ONE person can edit this at a time.In this application ABC there is a ALV table.
If the user clicks on this application & navigates to the ALV,this ABC application is in normal/edit mode(no one else has opened this ). So, the user can make changes in ABC. In the ALV, he can click on the 'settings 'button and save the STANDARD view as his own user defined view(by adding or removing columns).
If the user opens the application ABC in display mode(implying that someone else has alraedy opened ABC for editing), when i navigate to the same ALV,the user CANNOT see the views which were saved in the edit mode.Only the standard view is displayed. The user however has the option to again freshly save a view.
The views created by a user for this ALV should be seen irrespective of the application being opened in normal or display mode.
To add to the confusion, this problem is occuring only in some systems & not in others. There is atleast one system where the views are displayed correctly to the user.
On debugging, the table wdy_conf_user has config ids as different where the user views are stored separately for display & edit mode.
In systems where the user views are displayed correctly, the config id is one & the same ensuring that the user can see all his views irrespective of the mode of the application.
Any thoughts on how we can rectify this?
sorry for the long & tedious explanation
Thanks in advance,
SowmyaSee
michaels> select xmlquery('declare function local:test_function($namecmp as xs:string?, $inputtype as xs:string?) as xs:string?
return {$inputtype}
local:test_function("1","2")' returning content) o from dual
Error at line 5
ORA-19114: error during parsing the XQuery expression:
LPX-00801: XQuery syntax error at '{'
3 return {$inputtype}
- ^
michaels> select xmlquery('declare function local:test_function($namecmp as xs:string?, $inputtype as xs:string?) as xs:string?
$inputtype
local:test_function("1","2")' returning content) o from dual
O
2
1 row selected.
Maybe you are looking for
-
How Do I Convert an HD File to Non HD
I just bought a Flip Ultra HD video camera and the HD resolution is nice, but the file sizes are just enormous. I do not need to save every video I shoot as HD, so I am wondering if there is a way to convert the file to a non HD format when I import
-
Macbook pro does not support Final Cut Pro preview on external monitor?
I have been editing on Final Cut Pro from my imac for approx 1 year with an external monitor attached with no problems. I recently bought a macbook pro, for Final Cut Pro editing, and discovered that the monitor does not work. The Final Cut Pro previ
-
SQL0964C The transaction log for the database is full
Hi, i am planning to do QAS refresh from PRD system using Client export\import method. i have done export in PRD and the same has been moved to QAS then started imported. DB Size:160gb DB:DB2 9.7 os: windows 2008. I facing SQL0964C The transaction l
-
Schedule Script to Run without Job Agent
We do not have Job Agent available but need an event to trigger on a schedule. I did find a posting in here, which kind've shows how to do it. The syntax is below. WHILE 1 = 1 BEGIN WAITFOR DELAY '00:30:00'; EXEC sp_dbhelp; END My question is what wo
-
Cannot open project file with write access...
I have seen that this problem has been reported before but have yet to find a solution. I have my project file in an external hard drive. When I plug the hard drive to another computer and want to save it I get this message: "Cannot open project fil