Checkbox,dropdown,image in ALV
Hi Experts,
I am working ALV table in Webdynpro ABAP.
My client have a requirement like
1] He want to display the check box for ist row accept and secon row reject and 4th coloumn link if you click that it will open the editor.7th coloumn inputfield and 8th image if you click that image then add two coloumns in the table below that cell.and 12h coloumn dropdown box the values coming from BAPI.and 18th image. like that........
2] these above UI elemnts will be based on the record containe in the number.
Example:1. if that BAPI gives the 3 records only three row will be appear these UI elements other rows are should be
non- editable.
2. If the BAPI giving 10 records only ten rows should appear these Ui elements.
3] Some casess based on the condition also the UI elements should non-editable in ALV.
Can you please give how to do this.Please help me these screen how to develop.time is very less.
Hi,
DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.
lo_cmp_usage = wd_this->wd_cpuse_alv( ).
IF lo_cmp_usage->has_active_component( ) IS INITIAL.
lo_cmp_usage->create_component( ).
ENDIF.
DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .
lo_interfacecontroller = wd_this->wd_cpifc_alv( ).
DATA lv_value TYPE REF TO cl_salv_wd_config_table.
lv_value = lo_interfacecontroller->get_model(
DATA lt_columns type SALV_WD_T_COLUMN_REF.
DATA ls_columns type SALV_WD_S_COLUMN_REF.
lr_column type ref to CL_SALV_WD_COLUMN
DATA:
lr_input TYPE REF TO cl_salv_wd_uie_input_field,
lr_checkbox type ref to cl_salv_wd_uie_checkbox.
CALL METHOD lv->if_salv_wd_column_settings~get_columns
RECEIVING
value = lt_columns.
LOOP AT lt_columns INTO lis_columns.
lv_id = ls_columns-id.
lr_column = ls_columns-r_column.
***Column name
CASE lv_id.
WHEN 'CARRID'.
create object lr_checkbox
EXPORTING
checked_fieldname = 'CARRID'.
lr_checkbox->set_enabled( abap_true ).
lr_column->set_cell_editor( lr_checkbox ).
WHEN 'CONNID'.
CREATE OBJECT lr_input
EXPORTING
value_fieldname = lv_id.
CALL METHOD lr_column->set_cell_editor
EXPORTING
value = lr_input.
WHEN 'FLDATE'.
endcase.
endloop.
Regards,
Lekha.
Similar Messages
-
Hi,everyone.
I have a problem with dropdown field in alv .
When i set some fields dropdown in alv created by oo.
i can't input words in this field . can anyone give me some advice?
ths!Hi,
steps..
1. X_FIELDCAT-DRDN_HNDL = '1'. "pass this to the field you want to show as drop down
2.
DATA: X_OCRC LIKE LINE OF IT_OCRC.
DATA:LT_DRAL TYPE LVC_T_DRAL,
LS_DRAL TYPE LVC_S_DRAL.
LOOP AT IT_OCRC INTO X_OCRC.
* First listbox (handle '1').
IF SY-INDEX = 1.
LS_DRAL-HANDLE = '1'.
LS_DRAL-VALUE = ' '.
LS_DRAL-INT_VALUE = ' '.
ELSE.
LS_DRAL-HANDLE = '1'.
LS_DRAL-VALUE = X_OCRC-COMBI.
LS_DRAL-INT_VALUE = X_OCRC-COMBI.
ENDIF.
APPEND LS_DRAL TO LT_DRAL.
ENDLOOP.
**Setting the Drop down table for field1
CALL METHOD G_GRID->SET_DROP_DOWN_TABLE
EXPORTING
IT_DROP_DOWN_ALIAS = LT_DRAL.
for sample code check here i gave one.
Event for the List Box in ALV Grid Control
Regards
vijay -
Hello,
I am trying to get a dropdown column in an ALV table. While searching in the forum I now have the dropdown in thr ALV column 'VALUE' but I am not able to to get values in the column.
I have one node called 'RES' type WDR_CONTEXT_ATTR_VALUE with the attributs VALUE and TEXT and the following coding:
***********************ALV INIT
data: lr_if_controller type ref to iwci_salv_wd_table,
lr_cmdl type ref to cl_salv_wd_config_table,
lr_cmp_usage type ref to if_wd_component_usage.
Instantiate ALV1 component
lr_cmp_usage = wd_this->wd_cpuse_alv( ).
if lr_cmp_usage->has_active_component( ) is initial.
lr_cmp_usage->create_component( ).
endif.
Get reference to model
lr_if_controller = wd_this->wd_cpifc_alv( ).
lr_cmdl = lr_if_controller->get_model( ).
data: lr_col type ref to cl_salv_wd_column,
lr_dropdown type ref to cl_salv_wd_uie_dropdown_by_key.
create object lr_dropdown
exporting
selected_key_fieldname = 'VALUE'.
lr_cmdl->if_salv_wd_table_settings~set_read_only( abap_false ).
lr_col = lr_cmdl->if_salv_wd_column_settings~get_column( id = 'VALUE' ).
lr_col->set_cell_editor( lr_dropdown ).
data: lt_valueset type table of wdr_context_attr_value,
ls_valueset type wdr_context_attr_value,
lr_node type ref to if_wd_context_node,
lr_nodeinfo type ref to if_wd_context_node_info.
lr_node = wd_context->get_child_node( name = wd_this->wdctx_res ).
lr_nodeinfo = lr_node->get_node_info( ).
ls_valueset-value = '1'.
ls_valueset-text = 'eins'.
append ls_valueset to lt_valueset.
ls_valueset-value = '2'.
ls_valueset-text = 'zwei'.
append ls_valueset to lt_valueset.
lr_nodeinfo->set_attribute_value_set(
exporting
name = 'VALUE'
value_set = lt_valueset
data: itab_res type table of wd_this->element_res,
stru_res type wd_this->element_res.
append stru_res to itab_res.
lr_node->bind_table( itab_res ).
Anyone knows what I am doing wrong?
regards
StefanHi ,
I think its not get updated because the external context mapping of the node is done at design time... so remove the design time mapping and do the dyanamic mapping .. once the attributes valueset is updated.. see the below code...
Instantiate ALV component
DATA: l_ref_cmp_usage TYPE REF TO if_wd_component_usage.
l_ref_cmp_usage = wd_this->wd_cpuse_alv( ).
IF l_ref_cmp_usage->has_active_component( ) IS INITIAL.
l_ref_cmp_usage->create_component( ).
ENDIF.
Pass context node to ALV
DATA: l_ref_interfacecontroller TYPE REF TO iwci_salv_wd_table .
l_ref_interfacecontroller = wd_this->wd_cpifc_alv( ).
l_ref_interfacecontroller->set_data( dyn_node ).
hope this will help ..............
Regards
Yash -
WD4A : Displaying images in ALV table
Hi,
Does anyone know how to display images in ALV tables in Webdynpro?Hello,
You can define an attribute in the context with the type CHAR 30 and define it value like an icon from WDA (like ~Icon/GreenLed). And then you need to create an method to define the attributes of the column that will have the image like follows:
METHOD display_alv .
DATA: lr_alv_usage TYPE REF TO if_wd_component_usage,
lr_config TYPE REF TO cl_salv_wd_config_table,
lr_col_header TYPE REF TO cl_salv_wd_column_header,
lr_function_wd TYPE REF TO cl_salv_wd_function,
lr_button TYPE REF TO cl_salv_wd_fe_button,
lr_image TYPE REF TO cl_salv_wd_uie_image,
lr_header TYPE REF TO cl_salv_wd_header,
lr_uie_link TYPE REF TO cl_salv_wd_uie_link_to_action,
lr_if_controller TYPE REF TO iwci_salv_wd_table,
lr_function_set TYPE REF TO if_salv_wd_function_settings,
lr_table_settings TYPE REF TO if_salv_wd_table_settings,
lr_column_settings TYPE REF TO if_salv_wd_column_settings.
DATA: lt_columns TYPE salv_wd_t_column_ref,
ls_column TYPE salv_wd_s_column_ref,
lv_text TYPE string.
* Instantiate ALV Component
lr_alv_usage = wd_this->wd_cpuse_all_alv( ).
IF lr_alv_usage->has_active_component( ) IS INITIAL.
lr_alv_usage->create_component( ).
ENDIF.
* get reference to model
lr_if_controller = wd_this->wd_cpifc_all_alv( ).
lr_config = lr_if_controller->get_model( ).
* modify visible rows
lr_config->if_salv_wd_table_settings~set_visible_row_count( iv_rows ).
lr_config->if_salv_wd_table_settings~set_selection_mode(
wd_assist->co_alv_selmode ).
* create function
lr_function_set ?= lr_config.
lr_function_wd = lr_function_set->create_function(
wd_assist->co_func_det_nfe ).
CREATE OBJECT lr_button.
*read text
lv_text = wd_assist->read_text( iv_key = '002' ).
lr_button->set_text( lv_text ).
lv_text = wd_assist->read_text( iv_key = '001' ).
lr_button->set_tooltip( lv_text ).
lr_button->set_image_source( wd_assist->co_icon_seldet ).
lr_function_wd->set_editor( lr_button ).
* set table header
lr_table_settings ?= lr_config.
lr_header = lr_table_settings->get_header( ).
lv_text = wd_assist->read_text( iv_key = '003' ).
lr_header->set_text( lv_text ).
lv_text = wd_assist->read_text( iv_key = '004' ).
lr_header->set_tooltip( lv_text ).
lr_header->set_image_source( wd_assist->co_icon_list ).
lr_column_settings ?= lr_config.
lt_columns = lr_column_settings->get_columns( ).
LOOP AT lt_columns INTO ls_column.
CASE ls_column-id.
WHEN 'ICON'.
CREATE OBJECT lr_image.
lr_image->set_source_fieldname( ls_column-id ).
lr_image->set_tooltip_fieldname( 'ICON_TOOLTIP' ).
ls_column-r_column->set_cell_editor( lr_image ).
WHEN 'ID'.
CREATE OBJECT lr_uie_link.
lr_uie_link->set_text_fieldname( ls_column-id ).
ls_column-r_column->set_cell_editor( lr_uie_link ).
WHEN 'ICON_TOOLTIP' or 'LOGSYS'.
ls_column-r_column->set_visible(
cl_wd_uielement=>e_visible-none ).
ENDCASE.
*set header binding of medium description, otherwise title
lr_col_header = ls_column-r_column->get_header( ).
lr_col_header->set_ddic_binding_field(
if_salv_wd_c_column_settings=>ddic_bind_medium ).
ENDLOOP.
ENDMETHOD.
Here will be showed an icon (column ICON) and an link (column ID).
Regards, -
HI,
is it possible to show a picture (image) in ALV ?
Regards,
Gordonhi
Check this blog to show image in ALV table:
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1190424a-0801-0010-84b5-ef03fd2d33d9
regards
Satish -
Making field as Dropdown list in ALV
Hi
This is the code for making field as dropdown list in ALV.
But wat do you mean by HANDLE here.
What is the value one indicates.
FORM prepare_drilldown_values.
DATA lt_ddval TYPE lvc_t_drop .
DATA ls_ddval TYPE lvc_s_drop .
ls_ddval-handle = '1' .ls_ddval-value = 'JFK-12' .
APPEND ls_ddval TO lt_ddval .
ls_ddval-handle = '1' .
ls_ddval-value = 'JSF-44' .
APPEND ls_ddval TO lt_ddval .
ls_ddval-handle = '1' .
ls_ddval-value = 'KMDA-53' .
APPEND ls_ddval TO lt_ddval .
ls_ddval-handle = '1' .
ls_ddval-value = 'SS3O/N' .
APPEND ls_ddval TO lt_ddval .
CALL METHOD gr_alvgrid->set_drop_down_table
EXPORTING
it_drop_down = lt_ddval .
ENDFORM. " prepare_drilldown_values
Regards
Sandeep ReddyHi,
REPORT YMS_DROPDOWNLISTBOX.
TYPE-POOLS : VRM.
TABLES : AFKO,AFPO,SSCRFIELDS.
DATA : BEGIN OF IAFKO OCCURS 0,
AUFNR LIKE AFKO-AUFNR,
END OF IAFKO.
DATA : BEGIN OF IAFPO OCCURS 0,
MATNR LIKE AFPO-MATNR,
END OF IAFPO.
DATA : ITAB TYPE VRM_VALUE.
DATA : VID TYPE VRM_ID.
DATA : ITAB1 TYPE VRM_VALUES ,
ITAB2 TYPE VRM_VALUES .
DATA : FLAG.
PARAMETERS : P_AUFNR LIKE AFKO-AUFNR AS LISTBOX VISIBLE LENGTH 15.
INITIALIZATION.
SELECT AUFNR FROM AFKO UP TO 10 ROWS INTO TABLE IAFKO WHERE AUFNR LIKE
'%704%'.
LOOP AT IAFKO.
ITAB-KEY = IAFKO-AUFNR.
ITAB-TEXT = IAFKO-AUFNR.
APPEND ITAB TO ITAB1.
ENDLOOP.
AT SELECTION-SCREEN OUTPUT.
VID = 'P_AUFNR'.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = VID
VALUES = ITAB1
EXCEPTIONS
ID_ILLEGAL_NAME = 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.
Thanks,
Sankar M -
Hi Gurus,
Am developing ALV report using OOPS. In that i have to insert company logo. By using the below code it is coming good
CREATE OBJECT CONTAINER
EXPORTING
CONTAINER_NAME = 'PICTURE'.
CREATE OBJECT PIC
EXPORTING
PARENT = CONTAINER.
CALL METHOD pic->set_display_mode
EXPORTING
display_mode = CL_GUI_PICTURE=>DISPLAY_MODE_FIT_CENTER
EXCEPTIONS
ERROR = 1
others = 2
CALL METHOD pic->load_picture_from_url
EXPORTING
url = 'file://D:\kk.GIF'
IMPORTING
RESULT =
EXCEPTIONS
ERROR = 1
others = 2
But here am hardcoding the url of the logo. Instead of that upload the image into SAP and how to insert that logo in that screen? Can anyone give me suggestions regarding this.
Points will be awarded
Thanks
RaviHi
In the transaction OAOR, you should be able to insert your company Logo.
GOTO - OAOR (Business Document Navigator)
Give Class Name - PICTURES Class Type - OT..... then Execute
It will show you the list, then select ENJOYSAP_LOGO.
On that list, you will find one control with a "create" tab.
Click std. doc types.
Select SCREEN and double-click.
It will push FILE selection screen.
Select your company logo (.gif) and press OK.
It will ask for a description- for instance: "company logo".
It will let you know your doc has been stored successfully.
You can find your logo under ENJOYSAP_LOGO->Screen->company logo.
Just run your ALV program, you should find your company logo in place of the EnjoySAP logo.
FORM TOP-OF-PAGE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = HEADING[]
I_LOGO = 'ENJOYSAP_LOGO'
I_END_OF_LIST_GRID ='GT_LIST_TOP_OF_PAGE'.
ENDFORM. "TOP-OF-PAGE
Here 'ENJOYSAP_LOGO' will replace by ur created logo.
Refer this link
http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_enhanced.htm
http://www.sap-img.com/abap/alv-logo.htm
http://www.sap-img.com/fu002.htm
Re: Logo on Login screen
Re: To change image into main menu of sap
Reward points for useful Answers
Regards
Anji -
F4 help for a dropdown field in ALV
I am trying to enable F4 help for a field in ALV (OO style) that also has a dropdown assigned to it.
If I enable the dropdown in the field catalog, the field does not respond to F4 event at all.
When I remove the dropdown attribute from the field catalog, the F4 help works, but obviously now there is no dropdown.
The reason I am trying to implement it this way is that my dropdown list (which is the same for all rows) is quite large while F4 help depends on the current line in the ALV (so the available values are limited).
I would like to try to avoid creating a dropdown handle for every row in ALV.
Does anybody know if it's even possible to have a dropdown and F4 help at the same time in ALV?Hi
Linking F4 Help to Fields
For the last section, we will deal with linking F4 help to fields. It is easy. As usual, define, implement and register the event onf4 at proper places in your code. For F4 help, you must register the fields whose F4 request will trigger the onf4 event. For this you must prepare a table of type LVC_T_F4 and register this table using the method register_f4_for_fields. While preparing table you must include a line for each field which will trigger F4 event. For each field in the structure;
1) Pass the fieldname to FIELDNAME
2)Set REGISTER to make the field registered,
3)Set GETBEFORE to provide field content transport before F4 in editable mode
4)Set CHNGEAFTER to make the data changed after F4 in editable mode.
Preparing table for the fields to be registered to trigger F4 event
DATA: lt_f4 TYPE lvc_t_f4 WITH HEADER LINE .
lt_f4-fieldname = 'PRICE'.
lt_f4-register = 'X' .
lt_f4-getbefore = 'X' .
APPEND lt_f4 .
CALL METHOD gr_alvgrid->register_f4_for_fields
EXPORTING
it_f4 = lt_f4[] .
A sample onf4 method implementation
METHOD handle_on_f1 .
PERFORM f4_help USING e_fieldname es_row_no .
er_event_data->m_event_handled = 'X' .
ENDMETHOD .
Again, we set the attribute er_event_data->m_event_handled to prevent further processing of standard F4 help.
Check this link
http://help.sap.com/saphelp_nw04/helpdata/en/ed/ec623c4f69b712e10000000a114084/content.htm
Check these standard programs
BCALV_GRID_F4_HELP_APPLICATION
BCALV_GRID_F4_HELPM01
BCALV_TEST_GRID_F4_HELP
Regards
Pavan -
How to get selected-value of dropdown-field in alv ?
Hello experts,
I have a alv-table with dropdown-field.
When I open the dropdown I am able to select another value.
Now I use method ON_CLICK with ON_CELL_ACTION, and when
I change value in my alv, system jumps into this mehtod.
But how do I get now the selected dropdown value in this method ?
I use following code in comp-wdini in order to declare the dropdown:
Dropdownfield
DATA: lr_dp TYPE REF TO cl_salv_wd_uie_dropdown_by_key.
DATA: lr_node TYPE REF TO if_wd_context_node_info.
DATA: lt_valueset TYPE wdr_context_attr_value_list.
DATA: ls_valueset TYPE wdr_context_attr_value.
DATA : lr_nodeinfo TYPE REF TO if_wd_context_node_info.
DATA wa TYPE cdbc_tj30t.
DATA: lr_drdn_by_index TYPE REF TO cl_salv_wd_uie_dropdown_by_idx.
SELECT * FROM cdbc_tj30t INTO wa WHERE stsma = 'CRMOPPOR' AND
spras = 'DE'.
ls_valueset-value = wa-estat. " actual values
ls_valueset-text = wa-txt30. " text displaying on the dropdown
APPEND ls_valueset TO lt_valueset.
ENDSELECT.
LOOP AT lt_columns INTO ls_column.
CASE ls_column-id.
WHEN 'CONCATSTATUSER'.
CREATE OBJECT lr_drdn_by_index
EXPORTING
selected_key_fieldname = ls_column-id.
lr_drdn_by_index->set_valueset_fieldname( 'VALUESET' ).
lr_drdn_by_index->set_type( if_salv_wd_c_uie_drdn_by_index=>type_key_value ).
ls_column-r_column->set_cell_editor( lr_drdn_by_index ).
ENDCASE.
ENDLOOP.
In view-ini I fill the table which is bound to my alv-table:
LOOP AT lt_list_opportunities INTO lstru_list_opportunities
WHERE status = ls_opportunity_status-estat AND
valid_to <= ls_input-bdate AND valid_from >= ls_input-vdate.
ls_opportunities-valueset = lt_valueset.
MOVE-CORRESPONDING lstru_list_opportunities TO ls_opportunities.
APPEND ls_opportunities TO ltt_list_opportunities.
ENDLOOP.
lo_nd_opportunities = wd_context->get_child_node( name =
wd_this->wdctx_opportunities ).
lo_nd_opportunities->bind_table( new_items = ltt_list_opportunities ).
HOW can I now get the slected dropdown values in ON_CLICK with ON_CELL_ACTION method ?
Thanks for answers !!
GerdHello Abap,
when I have selected the value in the dropdown-box, then the event should start, and then I should have the
selected values of the dropdown box.
Hope you can help me !
Gerd -
Hi,
I upload two bmp images in se78. I maintained the image name in zreport. Using select qry i fetch the name and i want to diaplay those images one of the column in my alv report.
Need Source Code for this.
plz assist ,
Thanks.
Edited by: abap.m on May 1, 2010 12:16 PMHai Kanwardeep Singh,
Now i have some image in excel sheet i want to upload those images in r/3.
Because of i'll go to create one alv report to display the images.
For example:
in material master they maintained the machine model number,machine name etc.
Now their req is they need a report
SeqNo Mch_ No Mch_Name Mch_Img
1 100 heat image
2 200 pump image
.(In Mch_Img Column i need a image related to that particular machine how)
Like that i need a report in alv
Edited by: abap.m on May 1, 2010 1:26 PM -
To Display Image in Alv Grid....
Hello Gurus,
I want to display an image/icon ( custom icon ) in the ALV grid.
I know to display standard icons in ALV. But i dont know how to store custom icons in the system.
I want to display an icon or image depending upon certain conditions. i need to display these images/icons for each row of the ALV grid.
Please let me know if i can show images or icons ( not standard ) for each row in ALV grid.
<REMOVED BY MODERATOR>
Edited by: Alvaro Tejada Galindo on Feb 25, 2008 10:20 AMcheck out CL_GUI_PICTURE and the demo programs
SAP_PICTURE_DEMO
SAP_PICTURE_DEMO_ICON
RSDEMO_PICTURE_CONTROL
you can fit the picture in to the control with the following modes.
DISPLAY_MODE_FIT
other options
DISPLAY_MODE_NORMAL
DISPLAY_MODE_STRETCH
DISPLAY_MODE_NORMAL_CENTER
DISPLAY_MODE_FIT_CENTER
Regards
Raja -
Is it possible to have sorting by group and checkboxes in the same ALV
Hi there,
Does anyone know whether it is possible to have sorting and group on one field in ALV and checkboxes set on another field in ALV?
eg.
Fieldname
===========
Name----
Text
Allowance----
Numeric -> Sort & Group
Verified----
Checkbox
How do I code it if it is possible to have grouping and check box all in one ALV. Meaning I want some data that are the same to merge using sort, while still having the checkbox available for my other field (Verified).
Thanks in advance.
Lawrencehi,
GROUP BY clause is used on database tables with select statement.
sort is used on internal tables.
can u clearly explain y u need group by and sort on the same field.
if u are extracting from dbtable using grou by clause on a field, then no need to sort it again.
if u want sort u can do it by giveing "sort itab by field". thats not a problem.
now coming to check box.instead of using SLIS type field catalog, u use LVC type.
in LVC_S_LAYO, u can fine box_fname.
while defining layout, u declare a variable of type LVC_S_LAYO
AND GIVE BOX_FNAME = internal table field name -
Function code for dropdown on OO ALV Grid to trigger user_command
Hi Experts,
I know we can add a dropdown to a column of an OO ALV Grid, set values to the dropdown list and allow the user to select some these values.
However , what I'm not sure is that if we can *assign a function code to the dropdown * which would then trigger the event user_command ( PAI ) of the ALV class so I can handle the changes to when a particular value is selected from a dropdown list, just like we do in normal dialogs.
Now I know that I can register the 'Enter' event and handle the data changes in data_changed event, but that is something I want to avoid the user from doing as far as possible to make the report more user friendly.
Awaiting your valuable inputs and would really appreciate your help.
Thanks & regards,
AdvaitHi Advait,
No problem. Yes, this functionality requires changing the focus to other cell.
I think there is other solution. As the dropdown is kind of F4 activity try this way:
data: it_f4 type lvc_t_f4,
wa_f4 type lvc_s_f4.
wa_f4-FIELDNAME = 'CONNID'.
wa_f4-REGISTER = 'X'.
wa_f4-GETBEFORE = 'X'.
wa_f4-CHNGEAFTER = 'X'.
append wa_f4 to it_f4.
"register F4 event
CALL METHOD g_alv_grid_ref->register_f4_for_fields
EXPORTING
it_f4 = it_f4.
"Once you try to pick the value HANDLE_DATA_CHANGED event will be triggered
"Definition
methods:
handle_data_changed FOR EVENT data_changed OF cl_gui_alv_grid
IMPORTING er_data_changed e_onf4 e_onf4_before e_onf4_after,
"Implementation
METHOD handle_data_changed .
DATA: ls_mod_cells TYPE lvc_s_modi.
IF e_onf4_before = 'X'.
MESSAGE 'Data changed before F4' TYPE 'I'.
ENDIF.
IF e_onf4 = 'X'. "if event triggered by F4
MESSAGE 'Data changed on F4' TYPE 'I'.
ENDIF.
IF e_onf4_after = 'X'.
MESSAGE 'Data changed after F4' TYPE 'I'.
ENDIF.
"here you know which cell was modified
LOOP AT er_data_changed->mt_mod_cells INTO ls_mod_cells.
"just example test case, here you can implement your code for modified cells
IF ls_mod_cells-value >=5.
CALL METHOD er_data_changed->add_protocol_entry
EXPORTING
i_msgid = 'SABAPDOCU'
i_msgty = 'E'
i_msgno = '888'
i_msgv1 = 'Only numbers below 5 are possibe'
i_msgv2 = 'Please correct'
i_fieldname = ls_mod_cells-fieldname
i_row_id = ls_mod_cells-row_id.
CALL METHOD er_data_changed->modify_cell
EXPORTING
i_fieldname = ls_mod_cells-fieldname
i_row_id = ls_mod_cells-row_id
i_value = space.
ENDIF.
ENDLOOP.
ENDMETHOD. "handle_data_changed
This approach works fine for picking value from input help. Never tried it for dropdown list. You have to try it out.
Regards
Marcin -
How to avoid roundtrip to server on value select in dropdown box in ALV cel
Dear Experts,
I have WD ALV table where user edits values in the cels using dropdown by key element.
Then after edit he saves whole table. When value is changed in dropdown box the roundtrip to server occurs and it takes noticable time for every cell. My dropdown lists are fixed and are the same for all rows. It is not pleasant user experience and is annoying for user.
Is there a way to disable this roundtrip for each value selection for each cell and transfer all the data for whole ALV table only when I save whole table (separate button "Save")?
Help very much appreciated.
DmitryA lot of enterprises, however, actively avoid systems which are locked down to a particular server for very legitimate reasons. If my data center dies in the middle of the night, I sure don't want to have to call your mobile phone so that you can get to a computer, log in to the office network, and get me a new key so that I can finish my emergency failover. If I've got dozens of applications, I absolutely don't want to do that with dozens of different vendors.
It sounds like your problem, though, isn't that users are installing your software on multiple computers it's that they are accessing functionality they haven't licensed. That is generally a much easier problem to solve and doesn't require you to lock anything down to a particular machine. You can create a table LICENSED_CONTENT, for example,
CREATE TABLE licensed_content (
client_id NUMBER,
content_type VARCHAR2(30),
key RAW(128)
)In this case, KEY is, say, a hash (using the DBMS_CRYPTO or DBMS_OBFUSCATION_TOOLKIT packages if you'd like) of the client_id, content_type, and a bit of salt (i.e. a fixed string that only you know). When you sell a license to manage diamond content, you provide a script that inserts the appropriate row in the LICENSED_CONTENT table. When your application starts up, it reads the LICENSED_CONTENT table and verifies the hash before allowing users to access that type of content. This allows legitimate customers to move the software from one system to another but prevents them from accessing new functionality without a new license.
Justin -
How to catch the event for change dropdown value in alv
it has a column output by dropdown in alv. the dropdown type cl_salv_wd_uie_dropdown_by_idx.
now the problem is if change the dropdown value, i want to catch the event to change another column value.
how can i do it?This part contains other ALV initialization code
*... init ColumnSettings
DATA:
lr_column_settings TYPE REF TO if_salv_wd_column_settings.
lr_column_settings ?= wd_this->r_table.
DATA:
lt_columns TYPE salv_wd_t_column_ref.
lt_columns = lr_column_settings->get_columns( ).
DATA:
ls_column TYPE salv_wd_s_column_ref,
lr_col_header TYPE REF TO cl_salv_wd_column_header,
l_tooltip TYPE string.
LOOP AT lt_columns INTO ls_column.
CASE ls_column-id.
WHEN 'PLANETYPE'.
DATA:
lr_drdn_by_key TYPE REF TO cl_salv_wd_uie_dropdown_by_key.
CREATE OBJECT lr_drdn_by_key
EXPORTING
selected_key_fieldname = ls_column-id.
lr_drdn_by_key->set_key_visible( abap_true ).
ls_column-r_column->set_cell_editor( lr_drdn_by_key ).
WHEN OTHERS.
ENDCASE.
ENDLOOP.
DATA:
node_info TYPE REF TO if_wd_context_node_info,
lt_valueset TYPE STANDARD TABLE OF wdr_context_attr_value,
l_value TYPE wdr_context_attr_value.
node_info = wd_context->get_node_info( ).
node_info = node_info->get_child_node( 'FLIGHT_INFO' ).
data : lt_sflight type STANDARD TABLE OF sflight,
ls_sflight like LINE OF lt_sflight.
SELECT * from sflight into TABLE lt_sflight.
LOOP at lt_sflight into ls_sflight.
l_value-value = ls_sflight-planetype.
l_value-text = ls_sflight-planetype.
INSERT l_value into TABLE lt_valueset.
ENDLOOP.
node_info->set_attribute_value_set(
name = 'PLANETYPE'
value_set = lt_valueset ).
Maybe you are looking for
-
Cannot install Numbers on my Mac
I Bought Numbers app, but cannot install it on my Mac. When I'm trying to install - it says An error has occured. I have installed the Pages and Keynote, but not Numbers. Can you please help?
-
I have a older netra t1 with the diag lights on amber in the front. i did a prtdiag and it does not show any faults.. <div class="pre"><pre>System Configuration: Sun Microsystems sun4u Netra T1 200 (UltraSPARC-IIe 500MHz)System clock frequency: 100 M
-
640 - No event raised for Infotype 19 (SWEHR1/2/3)
G'day all, I'm trying to raise events when Infotype 0019 is inserted/changed/deleted. I've had a poke through SWEHR1/2/3 to find similar entries. Most of the Person related infotypes are linked to Objects with an ultimate parent object of EMPLOYEEI.
-
Custom (non RTMP) FMS live video feed
Is there a way to feed the FMS with live video created by custom software that does not 'speak' RTMP? How can that be accomplished?
-
Aperture 3: Watermarks with Facebook, Flickr, and MobileMe
I am pleased that Apple has released Aperture 3. I have not had the chance to download the 30-day trial or play with it in an Apple store yet. For those of you who have, do you know if Apple has enabled (visible) watermarking as part of the sharing o