How to set selected row in alv display?
Hi,
How do I select some particular row in alv - say at first display i want to highlight 4th row. How can i do that?
Thanks,
Sheel
try to use method set_selected_rows just after method for first display.
Similar Messages
-
How to Edit selected row in ALV
Hi Experts,
I new to webdynpro ABAP. How to Edit the entire selected row in ALV. Please suggest?
Thanks in advance.Hi,
I guess you have created the node as dynamic and also set this to the ALV..
1. Have you created READ_ONLY attribute of type wdy_boolean inside the node to which the ALV is bound..If not create it first and set the default value for this readonly as abap_true...ie X.
2. Got the contents in the internal table.
bind the table to the node..
3.Instantiate the ALV.
4. Now get teh column refrences of this ALV using the cl_salv_wd_config_table..and for columns
use the cell editor type as cl_salv_wd_uie_input_field...
loop through the column references and for all refrences create an object of type Input field and inside this class
use the method set_read_only_field_name ( 'READ_ONLY' ).
For the table settings if_salv_wd_table_settings of cl_salv_wd-config_table.. set the read only mode as abap_false..
5 create the custom button in the ALV using the cl_salv_wd_fe_button..
6 In this go for the events ON_FUCNTION and inside this method..do the coding
7 .Initially the table will be set to non editable..
In the button handler....
Get the refernece of this node to which the ALV is bound.....
lr_node = wd_context->get_child_node( 'VBAK' ). "dynamic node name
lv_index = lr_node->get_lead_selection_index ( ).
loop at it_table into ls_table.
if sy-tabix eq lv_index.
ls_table-read_only = abap_false. "editable
else.
ls_table-read_only = abap_true. "non editable
endif.
modify table
endloop.
lr_node->bind_table( lt_table ).
If you have any doutbs just refer the previous thread posted on the same..
You can follow the above steps to acheive thjs..
Regards,
Lekha.
Edited by: Lekha on Dec 17, 2009 6:10 PM -
ALV - How to set selected rows into internal table
Hi all,
I am tying to set with an 'X' flag the selected rows in my ALV using an internal table that contains all rows showed.
More exactly I have tried to follow these steps.
1) I have added the filed SEL (type SEL) to my ALV structure zrt_bo_slabsend and I defined my internal table in this way
DATA: gt_report TYPE STANDARD TABLE OF zrt_bo_slabsend,
gw_report TYPE zrt_bo_slabsend.
2) I have set gw_layo-box_fname = 'SEL' to gw_layo (ALV layout)
Pressing the "delete button" that I have insert on the top of the ALV, I intercept correctly my user command and I call a form (named "delete_lines") where I have this abap code
FORM delete_lines.
DATA: l_subrc LIKE sy-subrc,
lw_grid_settings LIKE lvc_s_glay.
gw_layo-box_fname = 'SEL'.
"set field name to store row selection
gw_layo-edit = 'X'. "makes whole ALV table editable
gw_layo-zebra = 'X'.
gv_repid = sy-repid.
call function 'REUSE_ALV_GRID_DISPLAY_LVC'
exporting
i_callback_program = gv_repid
i_callback_pf_status_set = gc_status
i_callback_user_command = gc_user_command
is_layout_lvc = gw_layo
it_fieldcat_lvc = gw_fkat
i_grid_settings = lw_grid_settings
i_save = 'X'
is_variant = variant
it_events = gt_events
TABLES
t_outtab = gt_report
EXCEPTIONS
program_error = 1
OTHERS = 2.
LOOP AT gt_report ASSIGNING <report> WHERE SEL = 'X'.
DELETE gt_report.
ENDLOOP.
ENDFORM.
I'd like to select many rows in my ALV report, than by pressing the delete button I'd like to see a refresh of my ALV, without the selected rows. I want to save it only at the end of my action, only by pressing the save button.
Any suggestion about the abap code will be well appreciated.
Thanks in advance for your kind help.
Regards.
GiovanniHi Giovanni,
I am using the method:-
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER =
* I_BUFFER_ACTIVE =
I_CALLBACK_PROGRAM = gd_REPID
I_CALLBACK_PF_STATUS_SET = 'UDIT'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
* I_CALLBACK_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_END_OF_LIST = ' '
* I_STRUCTURE_NAME =
* I_BACKGROUND_ID = ' '
I_GRID_TITLE = 'Mainatin cell entry'
* I_GRID_SETTINGS =
IS_LAYOUT_LVC = GS_LAYOUT
IT_FIELDCAT_LVC = I_FIELDCAT[]
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS_LVC =
* IT_SORT_LVC =
* IT_FILTER_LVC =
* IT_HYPERLINK =
* IS_SEL_HIDE =
I_DEFAULT = 'X'
* I_SAVE = 'X'
* IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
* IS_PRINT_LVC =
* IS_REPREP_ID_LVC =
I_SCREEN_START_COLUMN = 30
I_SCREEN_START_LINE = 14
I_SCREEN_END_COLUMN = 120
I_SCREEN_END_LINE = 25
* IT_EXCEPT_QINFO_LVC =
* I_HTML_HEIGHT_TOP =
* I_HTML_HEIGHT_END =
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = IT_ZCP_DEMAND_SYS1
* 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.
I have made five buttons on my toolbar (add, delete, save, back, exit).
Kindly tell me how can I catch the sy-ucomm of these buttons.
NOTE: this FM is written inside an user-exit, so I cannot make forms.
Thanks in advance. -
How to set some rows in ALV to be editable or some non editable.
Dear all Gurus,
I'm facing a situation here, I need your assistance.
I'm creating a alv table where the user can enter a data and then this will be uploaded into the system. Now upon validation some records might fail and would need some changes and some records that had no problems would have been successfully posted.
When the program returns to the user i want the successful one's to be greyed out and not editable. I'm not sure on how i could acess the rows of the table. I tried few classes and an all i could manage was to change the table setting and configs.
Below i've pasted the code on how i've code my alv table. Please advice on how i could access the rows and disable the successfull ones. Please.
METHOD wddoinit .
DATA: l_ref_cmp_usage TYPE REF TO if_wd_component_usage,
l_interface TYPE REF TO iwci_salv_wd_table,
l_model TYPE ref to cl_salv_wd_config_table, "Contains all characteristics of a table(collumns, fields, etc)
lt_columns TYPE salv_wd_t_column_ref, " Table type
lt_fields TYPE salv_wd_t_field_ref, " Table type
l_btn_ins TYPE REF TO cl_salv_wd_fe_button,
l_btn_del TYPE REF TO cl_salv_wd_fe_button,
l_btn_sell_all TYPE REF TO cl_salv_wd_fe_button,
l_btn_dell_all TYPE REF TO cl_salv_wd_fe_button,
l_btn_calc TYPE REF TO cl_salv_wd_fe_button,
l_btn_save TYPE REF TO cl_salv_wd_fe_button,
l_function TYPE REF TO cl_salv_wd_function,
l_column TYPE REF TO cl_salv_wd_column,
l_header TYPE REF TO cl_salv_wd_column_header,
lr_input_1 TYPE REF TO cl_salv_wd_uie_input_field,
lr_input_2 TYPE REF TO cl_salv_wd_uie_input_field,
lr_input_3 TYPE REF TO cl_salv_wd_uie_input_field,
lr_input_4 TYPE REF TO cl_salv_wd_uie_input_field,
lr_input_5 TYPE REF TO cl_salv_wd_uie_input_field,
lr_input_6 TYPE REF TO cl_salv_wd_uie_input_field,
lr_input_7 TYPE REF TO cl_salv_wd_uie_input_field,
lr_input_8 TYPE REF TO cl_salv_wd_uie_input_field,
lr_input_9 TYPE REF TO cl_salv_wd_uie_input_field,
lr_input_10 TYPE REF TO cl_salv_wd_uie_input_field,
lr_input_11 TYPE REF TO cl_salv_wd_uie_input_field,
lr_input_12 TYPE REF TO cl_salv_wd_uie_input_field,
l_link TYPE REF TO cl_salv_wd_uie_button.
CONSTANTS:
zzto TYPE string VALUE 'ZZTO',
zzfrom TYPE string VALUE 'ZZFROM',
takeoff_date TYPE string VALUE 'TAKEOFF_DATE',
read_date TYPE string VALUE 'READ_DATE',
takeoff_time TYPE string VALUE 'TAKEOFF_TIME',
read_time TYPE string VALUE 'READ_TIME',
ac_hrs TYPE string VALUE 'AC_HRS',
le_hrs TYPE string VALUE 'LE_HRS',
re_hrs TYPE string VALUE 'RE_HRS',
ac_cycle TYPE string VALUE 'AC_CYCLE',
re_cycle TYPE string VALUE 'RE_CYCLE',
le_cycle TYPE string VALUE 'LE_CYCLE',
ltext TYPE string VALUE 'LTEXT'.
l_ref_cmp_usage = wd_this->wd_cpuse_multi_alv( ).
IF l_ref_cmp_usage->has_active_component( ) IS INITIAL.
l_ref_cmp_usage->create_component( ).
ENDIF.
*Map the interface.
l_interface = wd_this->wd_cpifc_multi_alv( ).
DATA:
node_mdoc TYPE REF TO if_wd_context_node,
elem_mdoc TYPE REF TO if_wd_context_element.
navigate from <CONTEXT> to <MDOC> via lead selection
node_mdoc = wd_context->get_child_node( name = if_create_mass_entry=>wdctx_mdoc ).
l_interface->set_data( r_node_data = node_mdoc ).
*Map the model
wd_this->l_model = l_interface->get_model( ).
*Map the columns
lt_columns = wd_this->l_model->if_salv_wd_column_settings~t_columns.
*Map the fields
lt_fields = wd_this->l_model->if_salv_wd_field_settings~t_fields.
cl_salv_wd_model_table_util=>if_salv_wd_table_util_stdfuncs~set_all(
EXPORTING r_model = wd_this->l_model
allowed = abap_false ). " try abap_true
*Enable or Disable the ALV desired outlook and design
wd_this->l_model->if_salv_wd_table_settings~delete_header( ).
wd_this->l_model->if_salv_wd_table_settings~set_selection_mode(
value = cl_wd_table=>e_selection_mode-auto ).
wd_this->l_model->if_salv_wd_table_settings~set_width( value = '100%' ).
wd_this->l_model->if_salv_wd_table_settings~set_visible_row_count( value = '10' ).
wd_this->l_model->if_salv_wd_table_settings~set_read_only( value = abap_false ).
wd_this->l_model->if_salv_wd_std_functions~set_filter_filterline_allowed( value = abap_true ).
wd_this->l_model->if_salv_wd_std_functions~set_sort_headerclick_allowed( value = abap_true ).
wd_this->l_model->if_salv_wd_std_functions~set_export_allowed( value = abap_false ).
*Adding functionalities to the ALV
*'Insert Row' Button
CREATE OBJECT l_btn_ins.
l_btn_ins->set_text( 'Insert Row' ).
l_btn_ins->set_tooltip( 'To enter a new row' ).
l_btn_ins->set_image_source( value = 'ICON_INSERT_ROW' ).
l_function = wd_this->l_model->if_salv_wd_function_settings~create_function( id = 'INSERT' ).
l_function->set_position( value = '1' ).
l_function->set_editor( value = l_btn_ins ).
*'Delete Row' Button
CREATE OBJECT l_btn_del.
l_btn_del->set_text( 'Delete Row' ).
l_btn_del->set_tooltip( 'Delete the selected row' ).
l_btn_del->set_image_source( value = 'ICON_DELETE_ROW' ).
l_function = wd_this->l_model->if_salv_wd_function_settings~create_function( id = 'DELETE' ).
l_function->set_position( value = '2' ).
l_function->set_editor( value = l_btn_del ).
*'Select All' Button
CREATE OBJECT l_btn_sell_all.
l_btn_sell_all->set_text( 'Select All' ).
l_btn_sell_all->set_tooltip( 'Select all entered record' ).
l_btn_sell_all->set_image_source( value = 'ICON_INSERT_ROW' ).
l_function = wd_this->l_model->if_salv_wd_function_settings~create_function( id = 'SELECT' ).
l_function->set_position( value = '3' ).
l_function->set_editor( value = l_btn_sell_all ).
*'Deselect All' Button
CREATE OBJECT l_btn_dell_all.
l_btn_dell_all->set_text( 'Deselect All' ).
l_btn_dell_all->set_tooltip( 'Deselect all records selected' ).
l_btn_dell_all->set_image_source( value = 'ICON_DESELECT_ALL' ).
l_function = wd_this->l_model->if_salv_wd_function_settings~create_function( id = 'DESELECT' ).
l_function->set_position( value = '4' ).
l_function->set_editor( value = l_btn_dell_all ).
*'Calculate' Button
CREATE OBJECT l_btn_calc.
l_btn_calc->set_text( 'Calculate Hours' ).
l_btn_calc->set_tooltip( 'Calculate hours of each record' ).
l_btn_calc->set_image_source( value = 'ICON_CALCULATION' ).
l_function = wd_this->l_model->if_salv_wd_function_settings~create_function( id = 'CALC' ).
l_function->set_position( value = '5' ).
l_function->set_editor( value = l_btn_calc ).
*'Save' Button
CREATE OBJECT l_btn_save.
l_btn_save->set_text( 'Save All' ).
l_btn_save->set_tooltip( 'Save all' ).
l_btn_save->set_image_source( value = 'ICON_SYSTEM_SAVE' ).
l_function = wd_this->l_model->if_salv_wd_function_settings~create_function( id = 'SAVE' ).
l_function->set_position( value = '6' ).
l_function->set_editor( value = l_btn_save ).
FIELD-SYMBOLS: <fs_column> TYPE salv_wd_s_column_ref.
LOOP AT lt_columns ASSIGNING <fs_column>.
l_column = <fs_column>-r_column.
l_column->get_header( RECEIVING value = l_header ).
l_header->set_ddic_binding_field( value = if_salv_wd_c_column_settings=>ddic_bind_none ).
CASE <fs_column>-id .
WHEN zzfrom.
CREATE OBJECT lr_input_1 EXPORTING value_fieldname = zzfrom.
l_header->set_text( value = 'Flt Fr' ).
l_column->set_position( value = '1' ).
l_column->set_cell_editor( lr_input_1 ).
l_column->set_visible( '0' ).
WHEN zzto.
CREATE OBJECT lr_input_2 EXPORTING value_fieldname = zzto.
l_header->set_text( value = 'Flt To' ).
l_column->set_position( value = '2' ).
l_column->set_cell_editor( lr_input_2 ).
WHEN takeoff_date.
CREATE OBJECT lr_input_3 EXPORTING value_fieldname = takeoff_date.
l_header->set_text( value = 'Takeoff Date' ).
l_column->set_position( value = '3' ).
l_column->set_cell_editor( lr_input_3 ).
WHEN read_date.
CREATE OBJECT lr_input_4 EXPORTING value_fieldname = read_date.
l_header->set_text( value = 'Landing Date' ).
l_column->set_position( value = '4' ).
l_column->set_cell_editor( lr_input_4 ).
WHEN takeoff_time.
CREATE OBJECT lr_input_5 EXPORTING value_fieldname = takeoff_time.
l_header->set_text( value = 'Takeoff Time' ).
l_column->set_position( value = '5' ).
l_column->set_cell_editor( lr_input_5 ).
WHEN read_time.
CREATE OBJECT lr_input_6 EXPORTING value_fieldname = read_time.
l_header->set_text( value = 'Landing Time' ).
l_column->set_position( value = '6' ).
l_column->set_cell_editor( lr_input_6 ).
WHEN ac_hrs.
CREATE OBJECT lr_input_7 EXPORTING value_fieldname = ac_hrs.
l_header->set_text( value = 'Flt Time' ).
l_column->set_position( value = '7' ).
l_column->set_cell_editor( lr_input_7 ).
WHEN le_hrs.
CREATE OBJECT lr_input_8 EXPORTING value_fieldname = le_hrs.
l_header->set_text( value = 'LH Eng Runtime' ).
l_column->set_position( value = '8' ).
l_column->set_cell_editor( lr_input_8 ).
WHEN re_hrs.
CREATE OBJECT lr_input_9 EXPORTING value_fieldname = re_hrs.
l_header->set_text( value = 'RH Eng Runtime' ).
l_column->set_position( value = '9' ).
l_column->set_cell_editor( lr_input_9 ).
WHEN ac_cycle.
CREATE OBJECT lr_input_10 EXPORTING value_fieldname = ac_cycle.
l_header->set_text( value = 'No. of Landings' ).
l_column->set_position( value = '10' ).
l_column->set_cell_editor( lr_input_10 ).
WHEN re_cycle.
CREATE OBJECT lr_input_11 EXPORTING value_fieldname = re_cycle.
l_header->set_text( value = 'RH Eng Start' ).
l_column->set_position( value = '11' ).
l_column->set_cell_editor( lr_input_11 ).
WHEN le_cycle.
CREATE OBJECT lr_input_12 EXPORTING value_fieldname = le_cycle.
l_header->set_text( value = 'LH Eng Start' ).
l_column->set_position( value = '12' ).
l_column->set_cell_editor( lr_input_12 ).
WHEN ltext.
CREATE OBJECT l_link.
l_link->set_image_source( value = 'ICON_CREATE_TEXT' ).
l_link->set_text_fieldname( ltext ).
l_link->set_tooltip( value = 'Create Log' ).
l_header->set_text( value = 'Enter Log').
l_column->set_cell_editor( l_link ).
l_column->set_h_align( cl_wd_table_column=>e_h_align-center ).
l_column->set_position( value = '13' ).
WHEN OTHERS.
l_column->set_visible( '01' ).
ENDCASE.
ENDLOOP.
ENDMETHOD.
Your any help is highly appreciated. Thank you.
Regards,
VinodOk, here you go.
In your context, apart from your display fields, add another attribute READ_ONLY, type char01. And lets assume you want the field by name field_1 to be editable or not based on some validation. Your code will be like this to initialize the ALV.
DATA:
l_alv_model TYPE REF TO cl_salv_wd_config_table,
lr_column_settings TYPE REF TO if_salv_wd_column_settings,
lr_column TYPE REF TO cl_salv_wd_column,
lt_col TYPE SALV_WD_T_COLUMN_REF,
ls_col TYPE SALV_WD_S_COLUMN_REF,
lr_input_field type ref to cl_salv_wd_uie_input_field.
l_alv_model = l_ref_interfacecontroller->get_model( ).
l_alv_model->IF_SALV_WD_TABLE_SETTINGS~SET_READ_ONLY( abap_false ).
lr_column_settings ?= l_alv_model.
lt_col = lr_column_settings->get_columns( ).
LOOP AT lt_col INTO ls_col where ID = 'FIELD_1'.
create object lr_input_field exporting value_fieldname = ls_col-id.
lr_input_field->set_read_only_fieldname( 'READ_ONLY' ).
ls_col-r_column->set_cell_editor( lr_input_field ).
ENDLOOP.
In your event handler, you read your node, do a get_static_attributes_table. Perform all validations. Loop through your internal table and set the field READ_ONLY as 'X' when validation succeeds. Do READ_ONLY = space when validation fails. Then do a bind_elements. Now the rows for which read_only is false, will be editable and vice versa.
Hope I was clear enough. Get back if you have any doubts.
Regards,
Nithya -
How To Edit Selected Row In ALV Table
Hello Experts,
In My Webdynpro Application, I am displaying records from database table into an ALV Table.
I want to edit only selected record from ALV table.
Please Suggest How to achieve this.
Thanks,
PratibhaThe link given above is for the UI element 'Table' and does not pertain to ALV.
To Make an ALV Editable on lead selection for that particular lead selected row.
1. The ALV should be made lead selectable, when initializing
2. The ON_LEAD_SELECT function should be invoked.
3. Withing this function the index has to be retrieved to know which row was selected.
4. Based on the index retrived all the columns have to pass FALSE to read_only in the column properties.
Regards,
Pramod -
How to set selected row on startup of an alv tree build with cl_salv_tree
HI,
I have a cl_salv_tree and want the tree structure to open a specific node when starting the report. My coding is something like that:
DATA: lr_selections TYPE REF TO cl_salv_selections_tree,
lr_nodes TYPE REF TO cl_salv_nodes,
lr_node TYPE REF TO cl_salv_node,
lv_node_index(12) TYPE c,
lt_nodes TYPE salv_t_nodes,
ls_nodes TYPE salv_s_nodes,
lr_item TYPE REF TO cl_salv_item.
lr_selections = lr_tree->get_selections( ).
lt_nodes = lr_selections->get_selected_nodes( ).
lr_item = lr_selections->get_selected_item( ).
IF lr_item IS NOT BOUND.
lr_nodes = lr_tree->get_nodes( ).
lr_node = lr_nodes->get_node( lv_node_index ). "lv_node_index is the index of the node i want to be open on startup
ls_nodes-key = lv_node_index.
ls_nodes-node = lr_node.
APPEND ls_nodes TO lt_nodes.
lr_selections->set_selected_nodes( lt_nodes ).
ELSE.
ls_nodes-node = lr_item->get_node( ).
ls_nodes-key = ls_nodes-node->get_key( ).
APPEND ls_nodes TO lt_nodes.
lr_selections->set_selected_nodes( lt_nodes ).
ENDIF.
This coding is also used, when the report is running and someone clicks an a row. So thats why I check if a item is marked
or the total row.
But the tree always starts without opening the node.
Do I use the right methods or am I totally wrong ????
Thx for your help in advance
dinodini
Edited by: dinodini on Nov 16, 2010 6:51 PMWhat you are looking for is the similar functionality which could be achieved by the method EXPAND_NODE of the ALV Tree created using CL_GUI_ALV_TREE. In SALV Tree, you can use the method EXPAND of the class CL_SALV_NODE to show all the subnodes of that node, not by using the SELECTION.
Once you add the Node using the method ADD_NODE, you should call the method EXPAND to expand that subtree.
lr_nodes = lr_tree->get_nodes( ).
lr_node = lr_nodes->ADD_NODE( ... )
lr_node->EXPAND( COMPLETE_SUBTREE = 'X' ).
Regards,
Naimesh Patel -
Delete Selected rows in ALV display
Hi everyone,
I have a requirement where in my output display, I will have 3 buttons, like Select all, Deselect all and Delete selected.
For Select all and Deselect all I am able to write code and they are working fine. But for Delete selected I am not getting
its actual functionality in the output.
Please help me in this and provide some part of code which can fulfill this.
Regards.
Moderator Message: FAQ. Explore the already given answers and search the forum and the web for more.
Edited by: kishan P on Sep 15, 2010 12:45 PMHi Dieter,
I think the problem is smwhr else...Delete is a stanard functionality in the ALV Grid and would not fire your own code...
@Latha: I guess the row is getting deleted but your functionality is not working..If that is right then follow this approach:
When u delete a row it doesnot call your event handler and hence your code is not executed...You have to implement the toolbar event for this...In the toolbar event put a breakpoint and see the sy-ucomm for delete...you will then have to manually change this standard delete sy-ucomm to your custom sy-ucomm...
The code in the handle_toolbar method would be somthing like this
loop at mt-toolbar.
if sy-ucomm = standarad delete code
replace with your own custom code for exapmle 'DELETE'.
endif.
endloop.
Once you have done this then the Delete row would fire your own code for delete event...
Hope this helps...
Regards,
Sitakant -
Set specific rows in ALV grid ready for input
Hi everyone,
I have a question about how to set specific rows in ALV grid ready for input.
I know that I can make some columns ready for input before the ALV displayed,but I have no idea how to make specific rows displayed in the ALV ready for input.Hello Aaron
For editable columns we can use the fieldcatalog (LVC_S_FCAT-EDIT = 'X') but for rows you need to define editability on cell level.
The required steps are documented in sample report BCALV_EDIT_02. Below I point out a few crucial points:
*§1.Extend your output table for a field, e.g., CELLTAB, that holds
* information about the edit status of each cell for the
* corresponding row (the table type is SORTED!).
DATA: BEGIN OF gt_outtab occurs 0. "with header line
include structure sflight.
DATA: celltab type LVC_T_STYL.
DATA: END OF gt_outtab.
*§3.Provide the fieldname of the celltab field by using field
* STYLEFNAME of the layout structure.
gs_layout-stylefname = 'CELLTAB'.
CALL METHOD grid1->set_table_for_first_display
EXPORTING i_structure_name = 'SFLIGHT'
is_layout = gs_layout
CHANGING it_outtab = gt_outtab[].
Note: in the sample report only field SEATSMAX is editable. In your case you need
to fill CELLTAB for all fields in a row.
*§2.After selecting data, set edit status for each row in a loop
* according to field SEATSMAX.
LOOP AT gt_outtab.
l_index = sy-tabix.
refresh lt_celltab.
if gt_outtab-seatsmax ge 300.
perform fill_celltab using 'RW'
changing lt_celltab.
else.
perform fill_celltab using 'RO'
changing lt_celltab.
endif.
*§2c.Copy your celltab to the celltab of the current row of gt_outtab.
INSERT LINES OF lt_celltab INTO TABLE gt_outtab-celltab.
MODIFY gt_outtab INDEX l_index.
ENDLOOP.
ENDFORM. " SELECT_DATA_AND_INIT_STYLE
NOTE: LVC_T_STYL is a SORTED table type. Thus, take care that you are using the
INSERT ... INTO TABLE statement and not APPEND (because then nothing is appended
to the CELLTAB itab).
IF p_mode EQ 'RW'.
*§2a.Use attribute CL_GUI_ALV_GRID=>MC_STYLE_ENABLED to set a cell
* to status "editable".
l_mode = cl_gui_alv_grid=>mc_style_enabled.
ELSE. "p_mode eq 'RO'
*§2b.Use attribute CL_GUI_ALV_GRID=>MC_STYLE_DISABLED to set a cell
* to status "non-editable".
l_mode = cl_gui_alv_grid=>mc_style_disabled.
ENDIF.
ls_celltab-fieldname = 'SEATSMAX'.
ls_celltab-style = cl_gui_alv_grid=>mc_style_disabled.
INSERT ls_celltab INTO TABLE pt_celltab.
Regards
Uwe -
How to get column value of a selected row of ALV
Hello ,
I have application POWL POWL_UI_COMP uses another component POWL_TABLE_COMP.
This POWL_TABLE_COMP uses SALV_WD_TABLE.
I want to select value of ORDER id and it need to be passed whenever user selects a display order button(Which is self defined function generated in POWL_TABLE_COMP) . I am calling a display order on action of this display button(http://nap60.nalco.one.net:8042/sap/bc/webdynpro/sap/mt_order_app?IV_ACTIVITYTYPE=A&IV_EQUIPMENT=aaaa&IV_ORDERID=90001511&IV_ORDERTYPE=STD&IV_QMNUM=00&IV_TPLNR=00)
ORDERID is one column value of selected row of ALV table.
So please can you suggest , how to read ORDERID and pass it to the self defined function..
thanks in advance,
SharadaAnoop,
I have plcaed this code in event handler of on_lead_select.
Its giving error the element doesnt exist.
static_attributes should give me row data but it's giving short dump saying
Pl can you suggest.
data: set_of_element type WDR_CONTEXT_ELEMENT_SET,
element1 type ref to IF_WD_CONTEXT_ELEMENT,
result type POWL_CRESULT_STY,
table_helper type ref to CL_POWL_TABLE_HELPER,
context_node type ref to IF_WD_CONTEXT_NODE,
lt_selected_elements TYPE wdr_context_element_set,
static_attributes type ref to data.
table_helper = wd_comp_controller->mr_table_helper.
context_node = table_helper->get_data_node( ).
context_node = wd_comp_controller->mr_table_helper->get_data_node( ).
context_node->get_static_attributes( exporting index = r_param->index
importing static_attributes = static_attributes ).
thanks,
Sharada -
How to set special rows in jtable not selectable
Hello programmers,
anybody knows how to set special rows(p.E. row 0) in jtable not selectable.
in advance thanks for your answerstable = new JTable(...)
public void changeSelection(int row, int column, boolean toggle, boolean extend)
if (row == 0)
return;
else
super.changeSelection(row, column, toggle, extend);
}; -
HOW CAN I HAVE THE NUMBER OF SELECTED ROWS IN ALV GRID?
HI.
HOW CAN I HAVE THE NUMBER OF SELECTED ROWS IN ALV GRID????
GABRY =)You need to use
data : grid1 type ref to cl_gui_alv_grid.
call method grid1->get_selected_rows
importing
et_index_rows = i_sel_alvrows[].
a® -
How to set max row display rows in PO's PLD
Hi,
How to set max row display rows in PO's PLD
Thanks and Best Regards
BruceHi
Max. Rows per Page is depend on PLD Settings and Depend on Repetitive Area Fieds Height.
Try this,
1st Case:
->> Administration Module.
->> System Initialization.
->> Open the Print Perferences Window.
->> Click General Tab on Print Perferences Window.
->> Assign the Max. Rows per Page - 99 (or) your wishes.
->> Update the Print Perferences.
2nd Case:
->> Open your PLD.
->> Choose Repetitive Area on Field Index Window.
->> Click Format Tab on Properties Area Window.
->> Assign the Lines in Repetitive Area - Your Wishes .
->> Save the PLD.
Regards,
Madhan. -
How to get selected row index of a Table ?
hi gurus,I'm new to Webdynpro for abap
I'm displaying just Flight details in a Table so
how to get selected row index of a Table and need to be display in Message manager.Hi,
For getting the row index use the following code.
DATA lo_nd_node TYPE REF TO if_wd_context_node.
DATA lo_el_node TYPE REF TO if_wd_context_element.
DATA index TYPE i.
* navigate from <CONTEXT> to <NODE> via lead selection
lo_nd_node = wd_context->get_child_node( name = wd_this->wdctx_node ).
lo_el_node = lo_nd_node->get_lead_selection( ).
index = lo_el_node->get_index( ).
node is the name of the node which is binded to the table.
For printing the message u can use code wizard.
Press ctrl-F7. Now Select generate message.
IN this select the method REPORT_SUCCESS
In the code now u can give index to Message text Exporting parameter. Comment receiving parameter.
Write the whole code in onLeadSelect of the table.
Regards,
Pankaj Aggarwal -
How to get selected row keys from RichSelectManyCheckbox
Adf Table has getSelectedRowKeys but SelectManyChekcbox does not has anything similar. Can you tell me how to get selected row keys programmatically for RichSelectManyCheckbox?
Hi User,
selectManyCheckbox component's value property holds the selected items values. Bind this property to some bean variable(of type list) so that you can get the selected values by accessing the bean property.
Sireesha -
How to set forms 11g buttons to display icons
Hi,
How to set forms 11g buttons to display icons.Actually i have tried so many links
http://blog.newtrics.com/?p=936
Re: Icon image not showing in forms 11g RELEASE 2
but i am not getting image on the Oracle Form.Bad Image is always showing.
I am trying from 1 week So plz help me Its very urgent .
Thanks
Anup
Edited by: 888679 on May 22, 2012 4:37 AMam afraid u r configuring the wrong file path pls verify....
formsweb.cfg
path = c:\Oracle\Middleware\user_projects\domains\<my_domain>\config\fmwconfig\servers\WLS_FORMS\applications\formsapp_11.1.1\conf
registry entries as well
Hope this helps...
Regards,
Amatu Allah
Edited by: Amatu Allah on May 22, 2012 6:17 AM
Maybe you are looking for
-
Has anyone ever had this problem before? I would love some advice on how to restore my library with all my music. I have 841 songs on my iPod touch and yet my iTunes library on my account says I have none, ever since my sister made her account on my
-
Highight days with events in the calendar at bottom left
Hi, is there a way to have an indicator of which days have at least an event in the small calendar on the bottom left in iCal? This would allow to know at a glance what days are already (at least partially) busy without checking them one by one... Th
-
Help - photoshop elements 6 finding tags in My pictures (vista)
I have tagged my photo's in PE6, but when I want to send a photo from e.g my yahoo email and go into my pictures (windows vista) my tags are not showing How can I save my photo's so I can find them easily from yahoo email? thank you
-
Is there something better than CMD+Z for mass UNDOs?
After a month of superb Macprovideo training in FCPX and futile searches of the "worthless" FCPX help[less] document, I cannot find more on a VERY BASIC subject that pertains to everybody using FCPX. EDITING HISTORY: Since we have NO control over ou
-
WebLogic 10.2 Annotation Override/Deployment Plan Issue
We're migrating applications from WLS 9.2.1 over to 10.2. When we create the deployment plan and configure the overrides we find that some of the web service controls overrides are ignored and the defaults are used. This was not an issue for 9.2.1 an