How do I create a context menu in the new ALV object model (cl_salv_table)?
Hi,
Does anyone know how to create a context menu (right click on line or field) in the new ALV object model (class CL_SALV_TABLE)?
Thanks in advance
Keld Gregersen
PS: In the past we could use event CONTEXT_MENU_REQUEST in class CL_GUI_ALV_GRID, so it must be possible
I don't think there's "any such animal" in the new class. I'm not 100% certain however but the new class is only useful for fairly simple display only type grids.
There's no edit capability either.
I'd stick with cl_gui_alv_grid until there's some decent extra functionality in the cl_salv_table class.
It's fine for quick "bog standard" displays as it doesn't need a field catalog or any screens to be created by the user or developer - but you pay a price for that in limited fnctionality.
Cheers
jimbo
Similar Messages
-
How do I create a context menu in the new CL_SALV
I like a function xx in context menu. How do I create a context menu in the CL_SALV ?
thank you!
CLASS lcl_event_handler DEFINITION.
PUBLIC SECTION.
TYPES: t_proc TYPE zmp_c00_pr_d,
tt_proc TYPE STANDARD TABLE OF t_proc,
tt_proces_subpr TYPE TABLE OF ltyp_proces_subpr.
CLASS-DATA: lr_context TYPE REF TO cl_gui_alv_grid,
r_selections TYPE REF TO cl_salv_selections,
lr_menu type ref to cl_ctmenu.
CLASS-METHODS: main CHANGING ct_zmp_c00_pr_d TYPE tt_proc
ct_proces_subpr TYPE tt_proces_subpr
cv_screen TYPE i.
PRIVATE SECTION.
CLASS-DATA lt_zmp_c00_pr_d TYPE TABLE OF zmp_c00_pr_d.
CLASS-DATA ls_process TYPE zmp_c00_pr_d.
CLASS-METHODS: handle_double_click
FOR EVENT double_click OF cl_salv_events_table
IMPORTING row column,
detail
IMPORTING l_objkey TYPE zmp_c00_pr_d-objkey.
ENDCLASS. "lcl_events DEFINITION
* CLASS lcl_event_handler IMPLEMENTATION
CLASS lcl_event_handler IMPLEMENTATION.
METHOD main.
DATA: lr_alv TYPE REF TO cl_salv_table,
lr_events TYPE REF TO cl_salv_events_table,
lr_columns TYPE REF TO cl_salv_columns,
lt_col_tab TYPE salv_t_column_ref.
FIELD-SYMBOLS <column> LIKE LINE OF lt_col_tab.
IF r_container IS INITIAL.
CREATE OBJECT r_container
EXPORTING
container_name = 'CONTAINER'
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
OTHERS = 6.
IF sy-subrc <> 0.
MESSAGE i004(z_pm_tool).
ENDIF.
*Für Dynpro 1400
IF cv_screen = '1400'.
TRY.
CALL METHOD cl_salv_table=>factory
EXPORTING
* list_display = IF_SALV_C_BOOL_SAP=>FALSE
r_container = r_container
IMPORTING
r_salv_table = r_alv
CHANGING
t_table = ct_proces_subpr.
CATCH cx_salv_msg .
ENDTRY.
TRY.
* zeige die Daten
r_alv->display( ).
IF sy-subrc NE 0.
MESSAGE i001(z_pm_tool).
ENDIF.
CATCH cx_salv_msg.
ENDTRY.
ENDIF.
* Für Dynpro 1100
TRY.
CALL METHOD cl_salv_table=>factory
EXPORTING
* list_display = IF_SALV_C_BOOL_SAP=>FALSE
r_container = r_container
IMPORTING
r_salv_table = r_alv
CHANGING
t_table = ct_zmp_c00_pr_d .
CATCH cx_salv_msg .
ENDTRY.
TRY.
* zeige die Daten
r_alv->display( ).
IF sy-subrc NE 0.
MESSAGE i001(z_pm_tool).
ENDIF.
CATCH cx_salv_msg.
ENDTRY.
*Ereignisobjekt holen
lr_events = r_alv->get_event( ).
** get the SELECTIONS object
*r_selections = r_alv->get_selections( ).
* Interne-Tabelle füllen und an die Methode handle_double_click übergeben
LOOP AT ct_zmp_c00_pr_d INTO ls_process.
APPEND ls_process TO lt_zmp_c00_pr_d.
ENDLOOP.
* Zeiger auf Container für Kontexmenu
CREATE OBJECT lr_context
EXPORTING
i_parent = r_container.
DATA: lt_events TYPE cntl_simple_events.
CALL METHOD lr_context->set_registered_events
EXPORTING
events = lt_events
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
illegal_event_combination = 3
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.
* Interne-Tabelle füllen und an die Methode handle_double_click übergeben
LOOP AT ct_zmp_c00_pr_d INTO ls_process.
APPEND ls_process TO lt_zmp_c00_pr_d.
ENDLOOP.
* Event: Add Function
SET HANDLER: on_added_function FOR lr_events.
* Event: Kontexmenu
* SET HANDLER: on_context_menu_request FOR lr_context.
* Event: Doppelklick
SET HANDLER handle_double_click FOR lr_events.
* get the SELECTIONS object
r_selections = r_alv->get_selections( ).
* Einzelne Spalte holen
lr_columns = r_alv->get_columns( ).
* Doppelklick funktioniert nur auf das Feld OBJKEY
LOOP AT lt_col_tab ASSIGNING <column>.
<column>-r_column->set_output_length( 20 ).
IF <column>-columnname = 'OBJKEY'.
<column>-r_column->set_visible( 'X' ).
ELSE.
<column>-r_column->set_visible( ' ' ).
ENDIF.
ENDLOOP.
IF lt_col_tab IS NOT INITIAL AND sy-subrc <> 0.
MESSAGE i002(z_pm_tool).
ENDIF.
ENDIF.
ENDMETHOD. "main
METHOD handle_double_click.
FIELD-SYMBOLS <fs_zmp_c00_pr_d> TYPE zmp_c00_pr_d.
READ TABLE lt_zmp_c00_pr_d INDEX row ASSIGNING <fs_zmp_c00_pr_d>. " vor dem Changing Parameter der Klasse
* READ TABLE ct_zmp_c00_pr_d INDEX row ASSIGNING <fs_zmp_c00_pr_d>.
IF sy-subrc <> 0.
RETURN.
ENDIF.
IF column = 'OBJKEY'.
lcl_event_handler=>detail( <fs_zmp_c00_pr_d>-zz_slotid_a ).
ENDIF.
ENDMETHOD. "handle_double_click
METHOD detail.
DATA: lr_alv TYPE REF TO cl_salv_table,
lt_alv_tab TYPE TABLE OF zmp_p00_sp_d.
* Subprozess holen
SELECT * FROM zmp_p00_sp_d INTO TABLE lt_alv_tab
WHERE objkey = l_objkey.
IF sy-subrc <> 0.
MESSAGE i003(z_pm_tool).
ENDIF.
TRY.
* Neu erzeugte Instanz für ALV-Tabellenobjekt holen
cl_salv_table=>factory( IMPORTING r_salv_table = lr_alv
CHANGING t_table = lt_alv_tab ).
* Ausgabe Fenster für SubScreens
lr_alv->set_screen_popup( start_column = 1
end_column = 130
start_line = 1
end_line = 10 ).
* Anzeige der Daten
lr_alv->display( ).
IF sy-subrc <> 0.
MESSAGE i001(z_pm_tool).
ENDIF.
CATCH cx_salv_msg.
ENDTRY.
ENDMETHOD. "detail
ENDCLASS."lcl_event_handler IMPLEMENTATION
Edited by: polaris1 on Dec 15, 2010 12:18 PMCan't read that jumble, but suggest you look at the excellent SALV tutorials by Rich Heilman by searching for SALV tutorial on SCN. You'll find working code and how-to for adding your own functions to SALV.
-
How to remove options in context menu of the task in UWL.
Hi,
How to remove options or customize the context menu of the task in UWL.
I have 4 options(Edit,Remove,Forward,Resubmit) is appearing in the context menu.
My requirement is to delete Forward option form the menu list and only 3 options
should appear in the list.
Can anybody suggest where to change?
Thanks,
VikasHi vikas,
Go to System Admin ->System Config->UWL Admin.
select your system alias.
Click on Click to Click to Administrate Item Types and View Definitions.
Select your UWL configuration.
Download DTD as well as XML file through Download Configuration.
Then you can edit the xml file using XML spy editor or anyone.
to upload go back to the same page and select the tab...Upload new configuration.
Do not forget to clear the cache after upload.
Hope this helps you.
Regards
Atul Shrivastava -
How to create a sub menu for the transaction se38
Hi All,
I have created menu item in se38 using menu exit.
By using the enhancement SEU00002 .
That menu item is displayed under utilities menu bar.
But i am unable to create sub menu for that.
My requirement is to create sub menu to the custom menu item.
How can we create a sub menu to the transaction se38.Hi,
it looks like that user exit SEU00002 offers only one extra function +CUS. This function then calls FM EXIT_SAPMS38E_010. Hence I do not think that it is possible to create sub menu with this user exit.
Anyway you can try to modify SAP standard. You need to modify menu for SE38 and then add your code for handling new function codes. You can easily find where you will have to add your code for handling functions from your sub menu. You just need to look for usages of the FM EXIT_SAPMS38E_010.
Cheers -
How to create a context menu using powershell
Hi
i would like to create a context menu for powershell but i am getting an error after powershell menu is created
"This file does not have a program associated to it. i am using this script . I am trying to create a powershell shortcut on folders."
also once it gets created i would like to open powershell as admin always
New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT
Test-Path HKCR:\Directory\shell\Powershell
New-Item -Path HKCR:\Directory\shell -Name Powershell
Set-Item -Path HKCR:\Directory\shell\Powershell -Value "Open Powershell Here"
New-Item -Path HKCR:\Directory\shell\Powershell\key -Value "C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe -NoExit -Command ""Set-Location -LiteralPath '%L'"""You need to put forth the effort to ask a good, clear, and meaningful question.
As it stands, you seem to have a record of asking nearly unintelligible questions that take a great amount of effort for others to guess what you are asking. This is bad because it wastes everyone's time.
Read these for some good information on how to ask good questions:
Posting guidelines
Handy tips for posting to this forum
How to ask questions in a technical forum
Rubber duck problem solving
How to write a bad forum post
-- Bill Stewart [Bill_Stewart] -
How to create a context menu in ALV table cell editor(Webdynpro abap )
Hello Experts,
I am having a problem in creating a context menu in a table cell editor in the ALV table output.I have assigned a 'lta' as the cell editor.But befor assigning the lta as cell editor I have assigned the menu to the lta.But when the view is rendered I can see the lta with the actioned assigned to it.But I cannot see the context menu.
The code snippet below:
"Create menu for each coloumn
create OBJECT lo_menu_actions type CL_SALV_WD_VE_MENU EXPORTING
id = 'MITM_ACTIONS'.
lo_menu_actions->set_visible( value = abap_true ).
lo_menu_actions->set_visible_fieldname( value = 'ACTIONS' ).
"ADd menu items
CREATE OBJECT lo_menu_item_create type CL_SALV_WD_VE_MENU
exporting
id = 'MITM_CREATE_EXPRESSION'.
lo_menu_item_create->set_visible( value = abap_true ).
lo_menu_item_create->set_visible_fieldname( value = 'Create' ).
"Add item 1
lo_menu_actions->ADD_ITEM( VALUE = lo_menu_item_create ).
" Set the cell editor for each column cell(link to an action)
LOOP AT lt_node_dec_tab_cols INTO ls_node_dec_tab_cols .
lv_column_name = ls_node_dec_tab_cols-object_name.
lr_column = lr_column_settings->get_column( lv_column_name ).
"Create 'lta' Ui item
CREATE OBJECT lo_lta TYPE cl_salv_wd_uie_link_to_action.
lo_lta->set_menu( value = lo_menu_actions ).
lo_lta->set_text_fieldname( lv_column_name ).
lr_column->set_cell_editor( lo_lta ).
IF ls_node_dec_tab_cols-is_result EQ abap_true.
lr_column->set_cell_design( value =
cl_wd_table_column=>e_cell_design-key_medium ).
ENDIF.
ENDLOOP.Hi Prakash,
I have not come across this requirement till now to have context menu in a cell editor of alv.
Unfortunately the implementation of method SET_MENU of alv ui elements ( ex: cl_salv_wd_uie_text_view ) is not updating alv configurable table, instead it just stores in a global attribute as string. Hence has no effect on context menu.
If your user is very particular about this requirement of having context menu in cell editor, you can go for a normal table. Because, normal table's cell editor has the property to set the menuID as we do it for other ui elements.
Regards,
Rama -
How to create a context menu which appears on right click
Hello Experts,
I want to create a context menu which should appear on the right click of a mouse anywhere on the screen.
I have seen this functionality in one of the sap applications, and i guess this is an inbuild functionality in Webdynpro for ABAP but in WebDynpro Java i haven't found any such inbuild functionality.
Does anybody have any idea about it ?
Regards,
AmolContext menus are not supported in NW04 and NW04s, they will be available in the next major release.
Armin -
Create an context menu item to open a file on a specific display
Hello,
I have an external display connected to my MBP, but I don't always need to use it so it's not always on. I'd like to have a way to open a file (or application) on a specified display on a case by case basis. I know that I can assign an application to open on a specific display by right-clicking on the app in the dock and selecting options->assign to. The problem with this is that it's a global change. When I'm working on school work, I usually like to have reference material (pdfs, wepages, etc) open on the external display while I'm working in Word on the MBPs monitor.
What I'd like to be able to do is right click on the file (or app) and use a context menu item to open the item on a specific display. Does anyone know of an automator action/applescript/terminal command to create a context menu item like this?
Thanks.I use "Open Terminal Here" script for that:
http://www.entropy.ch/software/applescript/ -
How to create Drop down menu in the selection screen
Hi all,
How to create Drop down menu in the selection screen.
Fast answer will be highly rewarded
Regards
Bikashi ,
TYPE-POOLS : vrm.
TABLES:vbak,vbap.
DATA : v(80) TYPE c.
DATA: wa_vbak TYPE vbak,
it_vbak TYPE vbak OCCURS 0 WITH HEADER LINE,
wa_vbap TYPE vbap,
it_vbap TYPE vbap OCCURS 0 WITH HEADER LINE.
DATA: l_name TYPE vrm_id,
li_list TYPE vrm_values ,
v_count TYPE i,
l_value LIKE LINE OF li_list.
PARAMETERS: p_test(20) AS LISTBOX VISIBLE LENGTH 60 MODIF ID DAT.
INITIALIZATION.
AT SELECTION-SCREEN OUTPUT.
PERFORM get_data.
LOOP AT it_vbak.
l_value-key = it_vbak-vbeln .
l_value-text = it_vbak-vbeln .
APPEND l_value TO li_list.
ENDLOOP.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = 'P_TEST'
values = li_list
EXCEPTIONS
id_illegal_name = 1
OTHERS = 2.
AT SELECTION-SCREEN ON P_TEST.
clear : li_list , li_list[].
SELECT vbeln
matnr
meins
FROM vbap
INTO CORRESPONDING FIELDS OF TABLE it_vbap
WHERE vbeln = p_test.
START-OF-SELECTION.
SELECT vbeln
matnr
meins
FROM vbap
INTO CORRESPONDING FIELDS OF TABLE it_vbap
WHERE vbeln = p_test.
LOOP AT it_vbap.
WRITE :/ it_vbap-vbeln, it_vbap-matnr,it_vbap-meins.
ENDLOOP.
*& Form get_Data
text
--> p1 text
<-- p2 text
FORM get_data .
SELECT vbeln
FROM vbak
INTO CORRESPONDING FIELDS OF TABLE it_vbak.
ENDFORM. " get_Data
regards,
venkat. -
Firefox 3 has a context menu for the drop down list of
the Location Bar. One option on this menu I used often
is "Open Link in New Tab" -- quite convenient.
This context menu has disappeared in Firefox 4.
Can I get it back?See also:
*Tools > Options > Privacy > History: "Remember search and form history"
*https://support.mozilla.org/kb/Form+autocomplete
The "Use custom settings for history" setting allows to see the current history and cookie settings, but selecting that setting doesn't make any changes to history and cookie settings.<br />
Firefox shows the "Use custom settings for history" setting as an indication that at least one of the history and cookie settings is not the default to make you aware that changes were made.<br />
If all History settings are default then the custom settings are hidden and you see "Firefox will: (Never) Remember History".<br /> -
Context menu in the Universal Worklist
Hello all,
I'm migrating from Portal 7.0 to 7.3, and right now, I'm trying to migrate the UWL configuration.
I created the Universal Worklist Systems, I uploaded all the .xml configurations, I re-registered the system, I configurated the UWL iView... everything was done like in the Portal 7.0... BUT it doesn't works like before. I'm having problems with the "context menu" of each workitem.
In Portal 7.0, when all the "List of UWL Actions to exclude" are typed, the context menu of each workitem dissapears, and I can do a "click" over the workitem and a webdynpro app. is launched.
In Portal 7.3, when all the "List of UWL Actions to exclude" are typed, the context menu of the selected row dissapears, but still remains in the other unselected lines; and the most important thing, when a workitem row is selected, I can't do a "click" over it, it doesn't do anything... If I leave "launchWenDynPro" value into "List of UWL Actions to exclude", I can do a "click" over the workitems, and the webdynpro app. is launched, but the context menu appears...
How can I do to make dissapear the context menu?
I read the following link, but my Portal 7.3 doesn't works like this...
http://wiki.sdn.sap.com/wiki/display/BPX/ContextMenuBehaviourhaschangedinrelease7.10andhigheroftheUniversal+Worklist
Thanks!
Miguel.Hi Miguel,
Thanks for your post. It would be great if you can let me know the complete version of the UWLJWF component from NWA. To get this please do the following:
To get this, please do the following:
Open NWA -> Configuration management -> System info ->
press Components info tab, and for software components
Search for UWLJWF and you will find the component information. Could you please post it here? Is it possible that you can provide a link to some screenshots of what you are seeing as well?
Along with this, have you checked the standard iview from the PCD - if so is this giving the same result?
Regards,
Beth
EP - Senior Support Consultant II
SAP Active Global Support
Global Support Centre Ireland
**SDN Forum Moderator:
http://forums.sdn.sap.com/forum.jspa?forumID=495&start=0
**SDN Universal Worklist Wiki:
http://wiki.sdn.sap.com/wiki/x/ehU -
Remove Resubmit option in context menu of the task in UWL EP7
Hi All
In EP7, the behaviour of the tasks has changed a lot.
when the task appeared in UWL,Clicking on the work items, the form is not getting opened up instead it is showing "Resubmit" option in context menu of the task.
For each task i need the corresponding iView to get opened up. This is how I have configured our uwl.webflow.<system_alias>.xml
How can we remove the Resubmit button and open the form for manager to submit?
I need to revert back to original functionality.
Points will be rewarded
Regards
Sonal Mangla
Message was edited by:
Sonal ManglaHave you looked at this:
http://help.sap.com/saphelp_nw2004s/helpdata/en/09/6d6b17b29b4eef83a553acaa52f668/frameset.htm
Paul -
How can i create multiple accounts but use the same itunes?
how can i create multiple accounts but use the same itunes?
Hi iCloud is Making Me Go Crazy,
You will need to create a new Apple ID for your GameCenter and iCloud services. You can continue to use the current Apple ID you share with your Mom for access to iTunes Store purchases if you wish.
Using your Apple ID for Apple services
http://support.apple.com/kb/HT4895
Frequently asked questions about Apple ID
http://support.apple.com/kb/HT5622
Cheers,
- Judy -
How can I create an iridescent effect in a Photoshop 3D object?
How can I create an iridescent effect in a Photoshop 3D object? I have searched everywhere for downloadable option for a mac with no luck. I'm working with CS6.
NO way. Such stuff isn't even commonly available in many 3D programs becaus it's actually pretty advanced shader stuff...
Mylenium -
i had my Itunes account disabled due to fraud, if i create a new itunes account how can i switch purchases and apps to the new ID?
Hi ...
Just be cause the account was disabled (Apple ID) doesn't mean you can't reset the password and have access to your iTunes purchases.
Use the iforgot link to reset your password > Apple ID: "This Apple ID has been disabled for security reasons" alert appears
If you have problems resetting, use the email form here > Apple - Support - iTunes Store - Contact Us
edited by: cs
Maybe you are looking for
-
Why is my index bigger than my table ?
Hi I am using locally managed tablespaces, with system allocation on 9.2.0.8 I have a table with some 32 columns and a 3 column index (unique key). The 3 columns indexed are not null and all number(12) datatype. The index is bigger than the table by
-
When using my new ipad 4 retina display when on the Internet many of the images are blurry or low resolution? But if you go on apples website everything is crystal clear?? Why is this?
-
Have an iMac 21.5 in late 2012 running iOS 10.10.2 Yosemite I have 25.74 GB of music on the iMac and 109.27 GB on an iOmega hard drive (500GB) and I Want to transfer all of this to the iMac. How do I do this?
-
Create a JAVA client calling a proxy...
Hi, I succeed creating a servlet that calls a web service via a "deployable proxy". Is it possible to create a java class (not a servlet or jsp) that connect to this proxy ? Here is a sample of my client class: InitialContext ic = new
-
Dial-up for checking emails doesn't disconnect after checking
Hi, is there a way to ask the Treo to disconnect once it has dialed up to check for messages? I am getting a hefty data bill as it checks in the middle of the night and does not disconnect unless i ask it to. Post relates to: Treo 700wx (Verizon)