In ALV fix 3 rows of staring of alv.
Hello all
I am stuck up in one problem .
In ALV I want to fix 3 no of rows.
i.e. 3 these 3 lines should be display in all pages
Thanks in advance
Nitin
Hi Nitin,
You can make a seperate internal table with those three records. Then you can call the ALV display in top-of-page event. This ALV display will be common for all the pages.
Then you can call the ALV display for other records as usual.
Note: You cannot use ALV_GRID_DISPLAY to do this. You need to use ALV_LIST_DISPLAY.
Also you need to change the parameter LAYOUT-APPEND = 'X'.
Try this. I think this should work.
Best Regards,
Ram.
Similar Messages
-
ALV fixed row possible, scroll or resizel event present?
Hi, I'm afraid the answer will be a clear no to all:
1. we can give 'key' characteristic to a column, that prevents it to be scrolled out of sight. Can we do the same for the first, or any specific rows?
2. Can we catch the event of horizontal and/or vertical scrolling?
3. Can we catch a container resize event? I have a docking container that docks at bottom and extends dynamically to just below the selection-screen fields. If the user resizes the sapgui window, I would like to resize my container dynamically.
Thanks for input.
Regards,
Clemenseven nobody has nerve to say: No. No. No.
Regards,
Clemens -
ALV Table row not selected, on_lead_select not fired
Hi all,
I build a ALV grid with a dynamic node:
IF lv_check_child_node NE 'X'.
CALL METHOD lo_nd_root->add_new_child_node
EXPORTING
* supply_method =
* supply_object =
* dispose_method =
* dispose_object =
* static_element_type =
name = 'ALV_RESULT'
is_mandatory = abap_true
is_mandatory_selection = abap_false
is_multiple = abap_true
is_multiple_selection = abap_false
is_singleton = abap_true
is_initialize_lead_selection = abap_false
static_element_rtti = lr_strucdescr
is_static = abap_true
* attributes =
RECEIVING
child_node_info = lo_nd_alv_result.
ENDIF.
lo_nd_result = wd_context->get_child_node( name = lv_tab_name ).
lo_nd_result->bind_table( new_items = <lt_alv_tab> ).
* Instantiate ALV component
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.
lo_nd_result = wd_context->get_child_node( name = lv_tab_name ).
l_ref_interfacecontroller = wd_this->wd_cpifc_alv( ).
l_ref_interfacecontroller->set_data(
r_node_data = lo_nd_result ).
l_ref_interfacecontroller->get_model( RECEIVING value = lr_cmdl ).
lr_cmdl->if_salv_wd_std_functions~set_export_allowed( abap_false ).
lr_cmdl->if_salv_wd_std_functions~set_pdf_allowed( abap_false ).
lr_cmdl->if_salv_wd_table_settings~set_fixed_table_layout( abap_true ).
* lr_cmdl->if_salv_wd_table_settings~set_design( cl_wd_table=>e_design-alternating ).
lr_cmdl->if_salv_wd_table_settings~set_selection_mode( cl_wd_table=>e_selection_mode-single ).
lr_cmdl->if_salv_wd_table_settings~set_cell_action_event_enabled( value = abap_true ).
lr_cmdl->if_salv_wd_table_settings~set_data_check( if_salv_wd_c_table_settings=>data_check_on_cell_event ).
* lr_cmdl->if_salv_wd_table_settings~set_read_only( value = abap_false ).
* lr_cmdl->if_salv_wd_table_settings~set_enabled( value = abap_true ).
lr_cmdl->if_salv_wd_table_settings~set_row_selectable( value = abap_true ).
IF lt_fieldcat IS NOT INITIAL.
lt_col = lr_cmdl->if_salv_wd_column_settings~get_columns( ).
LOOP AT lt_fieldcat INTO ls_fieldcat.
READ TABLE lt_col INTO ls_col WITH KEY id = ls_fieldcat-fieldname.
IF sy-subrc = 0.
ls_col-r_column->set_position( ls_fieldcat-col_pos ).
CALL METHOD ls_col-r_column->get_header
RECEIVING
value = lr_header.
lr_header->set_ddic_binding_field( if_salv_wd_c_ddic_binding=>ddic_bind_none ).
lv_headertx = ls_fieldcat-seltext_l.
lr_header->set_text( lv_headertx ).
ELSE.
ls_col-r_column->set_visible( cl_wd_uielement=>e_visible-none ).
ENDIF.
ENDLOOP.
ENDIF.
But when I execute the dynpro, I get all the data I want. But I cannot select any row and the ON_LEAD_SELECT is not executed (an eventhandler is made in the method tab, and the event is bind to this handler).
When I change from selection_mode single to single_no_lead, I can select the row but the event is still not executed (not strange).
Is there anybody who can help me. We have support package SAPKB70020.
Regards,
MichaelHave you set the Initialization Lead Selection of the node as abap_true?
Also Check the below thread:
Unable to selelct a Row in ABAP Webdynpro ALV table -
How to increase the ALV visible row count
Hi Experts,
My standard ALV display is displaying only 10 rows.
My requirements is to display 20 rows.
Please advise.
Regards,
Chitrasenhi ,
u can set the row count to any number , here I am setting it to 5 using the method set_visible_row_count
1 Change the visible row count to u20185u2019
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 lo_value TYPE REF TO cl_salv_wd_config_table.
lo_value = lo_interfacecontroller->get_model(
lo_value->if_salv_wd_table_settings~set_visible_row_count( '5' ).
u can also go thru this useful links for CONFIGUIRING ALV :
http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/40794172-b95a-2910-fb98-b86d8a0918b4;jsessionid=(J2EE3417400)ID0488867050DB10849380333905377829End
SAP List Viewer (ALV) [original link is broken]
Configuring ALV
http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1190424a-0801-0010-84b5-ef03fd2d33d9?overridelayout=true
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/db22242d-0701-0010-28a2-aeaa1fefd706;jsessionid=(J2EE3414800)ID0133346050DB00727847586176044227End?overridelayout=true&bcsi_scan_06B6B0A4B65849C2=0
I hope it shud solve ur query.
regards,
amit -
Hey,
How to know number of rows and columns in alv grid are used.Hi,
You can count the number of rows , by using describe statemet,
describe table itab lines v_lines.
itab is table used to display in ALV
Thanks & Regards,
Navneeth K. -
Getting row information after an ALV sort
I am using cl_gui_alv_grid. My problem occurs after a user sorts the table. All of the index values no longer match to the original table I passed to the class. How do I match the results from
CALL METHOD my_catlistgrid->get_selected_rows
IMPORTING
et_index_rows = selected_rows.
to my original itab?Let me be more specific. I have an object that is handling the events double_click(), I have a button on the APP toolbar that will end up calling any or all of the following methods.
CALL METHOD my_catlistgrid->get_selected_rows
IMPORTING
et_index_rows = selected_rows.
CALL METHOD my_catlistgrid->get_selected_cells_id
IMPORTING
ET_CELLS = selected_cells_id.
CALL METHOD my_catlistgrid->get_selected_cells
IMPORTING
ET_CELL = selected_cells.
Each of this methid returns to me the index(position) of the selected row in the ALVgrid. After a sort in the ALV grid, row 1 does not relate to row 1 in the itab I passed to the ALV grid anymore. -
ALV multiple rows in single cell....
Hi Experts,
I am using ALV report, it is more than 132 coloms. I want to display balance columns on second line of same row.
For e.g. :
Sr.No. O.A. No.
Invoice No.
1 12345
00001
2 124567
000002
it is possible ?
YAB
Message was edited by:
YUSUF BHORIHi
I think it is not possible in ALV reports.
Simple ALV report
http://www.sapgenie.com/abap/controls/alvgrid.htm
http://wiki.ittoolbox.com/index.php/Code:Ultimate_ALV_table_toolbox
ALV
1. Please give me general info on ALV.
http://www.sapfans.com/forums/viewtopic.php?t=58286
http://www.sapfans.com/forums/viewtopic.php?t=76490
http://www.sapfans.com/forums/viewtopic.php?t=20591
http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you use - ABAP Objects calls or simple function modules.
2. How do I program double click in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=11601
http://www.sapfans.com/forums/viewtopic.php?t=23010
3. How do I add subtotals (I have problem to add them)...
http://www.sapfans.com/forums/viewtopic.php?t=20386
http://www.sapfans.com/forums/viewtopic.php?t=85191
http://www.sapfans.com/forums/viewtopic.php?t=88401
http://www.sapfans.com/forums/viewtopic.php?t=17335
4. How to add list heading like top-of-page in ABAP lists?
http://www.sapfans.com/forums/viewtopic.php?t=58775
http://www.sapfans.com/forums/viewtopic.php?t=60550
http://www.sapfans.com/forums/viewtopic.php?t=16629
5. How to print page number / total number of pages X/XX in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=29597 (no direct solution)
6. ALV printing problems. The favourite is: The first page shows the number of records selected but I don't need this.
http://www.sapfans.com/forums/viewtopic.php?t=64320
http://www.sapfans.com/forums/viewtopic.php?t=44477
7. How can I set the cell color in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=52107
8. How do I print a logo/graphics in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=81149
http://www.sapfans.com/forums/viewtopic.php?t=35498
http://www.sapfans.com/forums/viewtopic.php?t=5013
9. How do I create and use input-enabled fields in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=84933
http://www.sapfans.com/forums/viewtopic.php?t=69878
10. How can I use ALV for reports that are going to be run in background?
http://www.sapfans.com/forums/viewtopic.php?t=83243
http://www.sapfans.com/forums/viewtopic.php?t=19224
11. How can I display an icon in ALV? (Common requirement is traffic light icon).
http://www.sapfans.com/forums/viewtopic.php?t=79424
http://www.sapfans.com/forums/viewtopic.php?t=24512
12. How can I display a checkbox in ALV?
http://www.sapfans.com/forums/viewtopic.php?t=88376
http://www.sapfans.com/forums/viewtopic.php?t=40968
http://www.sapfans.com/forums/viewtopic.php?t=6919
13. Top-of-page in ALV
selection-screen and top-of-page in ALV
14. ALV Group Heading
http://www.sap-img.com/fu037.htm
How to add list heading like top-of-page in ABAP lists?
http://www.sapfans.com/forums/viewtopic.php?t=58775
http://www.sapfans.com/forums/viewtopic.php?t=60550
http://www.sapfans.com/forums/viewtopic.php?t=16629
Go thru these programs they may help u to try on some hands on
ALV Demo program
BCALV_DEMO_HTML
BCALV_FULLSCREEN_DEMO ALV Demo: Fullscreen Mode
BCALV_FULLSCREEN_DEMO_CLASSIC ALV demo: Fullscreen mode
BCALV_GRID_DEMO Simple ALV Control Call Demo Program
BCALV_TREE_DEMO Demo for ALV tree control
BCALV_TREE_SIMPLE_DEMO
BC_ALV_DEMO_HTML_D0100
<b>Reward points for useful Answers</b>
Regards
Anji -
Unable to select any row(s) in table/ALV
Hi ,
I am having a problem while selecting a row in a table/ALV.
I am displaying data in a table which is NOT set to 'Initialize lead selection' in the context.When it is displayed and I try to select a row the row does not get selected(highlighted) in the view.
However,I am able to perform tasks on 'Onselect' event on the rows.Just that its not getting highlighted neither in table nor in ALV.
What could be the reason for this ? I do not want the context element to be set as 'Initialize lead selection' as that would highlight the first line of the table when the view is rendered first time.
Thanks for your help,
Sandip.hi sandip,
Try this method
lo_table_sett TYPE REF TO if_salv_wd_table_settings.
lo_config_tab TYPE REF TO cl_salv_wd_config_table.
lo_config_tab = lo_ref_interface_controller->get_model( ).
lo_table_sett ?= lo_config_tab.
lo_table_sett ->SET_SELECTION_MODE( value ).
value- '00' for auto
'02' for single
'04' for multi
'06' for none
'07' for singleNolead
'08' for multi Nolead
Regards,
janakiram -
How to make all the rows editable in webdynpro alv output
Hi,
How to make all the rows editable in webdynpro alv output.
Thanks
RaksharHi Rakshar,
Check this wiki:
http://wiki.sdn.sap.com/wiki/display/WDABAP/HowtoeditconditionallyrowofaALVtableinWebDynprofor+ABAP
Regards -
Hello ABAP Expert,
I have to set the first row displayed in an ALV grid using ABAP.
In fact the list contains a lot of lines but the user need that the list after refresh keep the position without to repeat the scrolling from the top of the list.
The ALV is displayed using FM REUSE_ALV_GRID_DISPLAY_LVC.
I have try several methods but without success.
Our help is welcome.
ChristopheHello REUSE_ALV_GRID_DISPLAY_LVC
You can achieve your goal using fm REUSE_ALV_GRID_DISPLAY_LVC (although it would be much easier to use class CL_GUI_ALV_GRID).
The EXIT routine for command handling (parameter I_CALLBACK_USER_COMMAND) has a parameter R_UCOMM with the following fields (and more of them):
refresh : (exporting) list is to be refreshed
col_stable:(exporting) keep column positions in refresh
row_stable:(exporting) keep row positions in refresh
If you set COL_STABLE = 'X' and ROW_STABLE = 'X' you achieve the same when using go_grid->REFRESH_TABLE_DISPLAY ( using parameter IS_STABLE).
Regards
Uwe
PS: See documentation of fm REUSE_ALV_LIST_DISPLAY. -
JTable fixed Row and Column in the same window
Hi
Could anyone tip me how to make fixed row and column in the same table(s).
I know how to make column fixed and row, tried to combine them but it didnt look pretty.
Can anyone give me a tip?
Thanks! :)Got it to work!
heres the kod.. nothing beautiful, didnt clean it up.
* NewClass.java
* Created on den 29 november 2007, 12:51
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
package tablevectortest;
* @author Sockan
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.table.*;
import javax.swing.event.*;
public class FixedRowCol extends JFrame {
Object[][] data;
Object[] column;
JTable fixedTable,table,fixedColTable,fixedTopmodelTable;
private int FIXED_NUM = 16;
public FixedRowCol() {
super( "Fixed Row Example" );
data = new Object[][]{
{ "","A","A","A","",""},
{ "a","b","","","",""},
{ "a","","c","","",""},
{ "","","","d","",""},
{ "","","","","e",""},
{ "","","","","","f"},
{ "","b","","","",""},
{ "","","c","","",""},
{ "","","","d","",""},
{ "","","","","e",""},
{ "","b","","","",""},
{ "","","c","","",""},
{ "","","","d","",""},
{ "","","","","e",""},
{ "","","","","","f"},
{ "I","","W","G","A",""}};
column = new Object[]{"A","B","C","D","E","F"};
AbstractTableModel fixedColModel = new AbstractTableModel() {
public int getColumnCount() {
return 1;
public int getRowCount() {
return data.length;
public String getColumnName(int col) {
return (String) column[col];
public Object getValueAt(int row, int col) {
return data[row][col];
public boolean CellEditable(int row, int col) {
return true;
AbstractTableModel model = new AbstractTableModel() {
public int getColumnCount() { return column.length-2; }
public int getRowCount() { return data.length - FIXED_NUM; }
public String getColumnName(int col) {
return (String)column[col+1];
public Object getValueAt(int row, int col) {
return data[row][col+1];
public void setValueAt(Object obj, int row, int col) {
data[row][col+1] = obj;
public boolean CellEditable(int row, int col) {
return true;
AbstractTableModel fixedTopModel = new AbstractTableModel() {
public int getColumnCount() { return 1; }
public int getRowCount() { return data.length - FIXED_NUM; }
public String getColumnName(int col) {
return (String)column[col];
public Object getValueAt(int row, int col) {
return data[row][col];
public void setValueAt(Object obj, int row, int col) {
data[row][col] = obj;
public boolean CellEditable(int row, int col) {
return true;
AbstractTableModel fixedModel = new AbstractTableModel() {
public int getColumnCount() { return column.length-2; }
public int getRowCount() { return FIXED_NUM; }
public Object getValueAt(int row, int col) {
return data[row + (data.length - FIXED_NUM)][col+1];
table = new JTable( model );
table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
fixedTable = new JTable( fixedModel );
fixedTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
fixedTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
fixedColTable= new JTable(fixedColModel);
fixedColTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
fixedColTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
fixedTopmodelTable = new JTable(fixedTopModel);
fixedTopmodelTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
fixedTopmodelTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
JScrollPane scroll = new JScrollPane( table );
scroll.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
scroll.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
JScrollPane fixedScroll = new JScrollPane( fixedTable ) {
public void setColumnHeaderView(Component view) {}
fixedScroll.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
fixedScroll.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
JScrollBar bar = scroll.getVerticalScrollBar();
JScrollBar dummyBar = new JScrollBar() {
public void paint(Graphics g) {}
dummyBar.setPreferredSize(bar.getPreferredSize());
scroll.setVerticalScrollBar(dummyBar);
final JScrollBar bar1 = scroll.getHorizontalScrollBar();
JScrollBar bar2 = fixedScroll.getHorizontalScrollBar();
bar2.addAdjustmentListener(new AdjustmentListener() {
public void adjustmentValueChanged(AdjustmentEvent e) {
bar1.setValue(e.getValue());
JViewport viewport = new JViewport();
viewport.setView(fixedColTable);
viewport.setPreferredSize(fixedColTable.getPreferredSize());
fixedScroll.setRowHeaderView(viewport);
fixedScroll.setCorner(JScrollPane.UPPER_LEFT_CORNER, fixedColTable
.getTableHeader());
JViewport viewport2 = new JViewport();
viewport2.setView(fixedTopmodelTable);
viewport2.setPreferredSize(fixedTopmodelTable.getPreferredSize());
scroll.setRowHeaderView(viewport2);
scroll.setCorner(JScrollPane.UPPER_LEFT_CORNER, fixedTopmodelTable
.getTableHeader());
scroll.setPreferredSize(new Dimension(600, 19));
fixedScroll.setPreferredSize(new Dimension(600, 100));
getContentPane().add( scroll, BorderLayout.NORTH);
getContentPane().add(fixedScroll, BorderLayout.CENTER);
public static void main(String[] args) {
FixedRowCol frame = new FixedRowCol();
frame.addWindowListener( new WindowAdapter() {
public void windowClosing( WindowEvent e ) {
System.exit(0);
frame.pack();
frame.setVisible(true);
} -
What is the difference between ALV list FM display and OO ALV Display?
What is the difference between ALV Function Modules and Object Oriented ALV Display?
Hi Sathish ,
There is not much diffrence , it is only another way of implementing it.
Regards
Arun -
Dear All
Does anyone know how to fix a row in a JTable, for example, to fix the bottom row in a JTable, so that users can scroll through the rest of the rows in the table without affecting this row. But when if a column size is changed, it will resize its cell simultaneously.
if you know the answer, please provide sample code as well.
Thanks in advance
KenHi,
to do that, you need an own DataModel in the table, I guess. What is displayed in a cell is asked from the JTable by the getValueAt(...)-method of the datamodel. If you want to fix a row that way, you have to answer this "question" with the right response - that will be not the original cell there but another one while scrolling during a row is fixed.
You also must keep track of the messages that are to be fired to synchronize the display of the table with the answers you return on the getValueAt(...)-method. The "fixing" is a kind of shifting the fixed row in the table, that must be reflected by the messages you have to fire. fireTableDataChanged() would be an idea but that cause rerendering of all the visible cells of the table - other messages are more precise, but you need to do more and have to worry about more things while programming this.
In the case of the bottom line it is possible to use a second JTable in the south of the panel which has only one row - the fixed row - in it - if you discard the header of it, it would look like the row is fixed in the original table, but by using this possibility you must synchronize the changing of the column-width and ofcourse the reordering of columns too done in the original table with the second table. I guess the method in the above paragraph would be the better approach to it.
I have no code for it, but I have tried, to give you a guideline how this can be done.
greetings Marsian -
To create a fixed row in the bottom of table and to merge three columns
Hi,
I have a table displaying some values but is there any way to get a fixed row at the bottom which will sum the values above.
ie
service business jan feb mar april
table cut 900 100 100 200
chair blade 100 200 300 400
sum 1000 300 400 600
so the final row i need it to be constant even if i scroll down the table, this row should be always fixed and visible. and the table data are filled dynamically.. so i dont know the no of rows available as well.
How can I do it. Any insight on it will be helpful.
Thanks and Regards
TenzinHi,
CL_WD_TABLE - >SET_FOOTER_VISIBLE where you can provide that summation in the footer.
As you are calculating the sum there will be the Name for that field to hold summation value right.
Based on the name of that field you can set it to the footer by passing the necessary paramters to that
method.
How are you filling the table.
Regards,
Lekha. -
Fixed Rows/Columns in Web Interfaces
Hello,
Does anybody has the How to paper about Fixed Rows/Columns in Web interfaces?
I found one link (By Olaf Fischer) that was expired.
Thanks a lot!
Buenoand here is a copy of the download link:
<a href="For download follow the link https://sapmats-de.sap-ag.de/download/download.cgi?id=WEJDT0MZ18U0W5NXAQJU92HI46IH82UZYO7X84BH8RZ7T1V00M">For download follow the link https://sapmats-de.sap-ag.de/download/download.cgi?id=WEJDT0MZ18U0W5NXAQJU92HI46IH82UZYO7X84BH8RZ7T1V00M</a>
Regards, Olaf
Maybe you are looking for
-
You have any idea how to fix an accelerometer in iphone 4 void of warranty?
do you have an idea how to fix the accelerometer in an iphone 4? (the warranty is void)
-
here is another example of a sound application that does not work. can any one help me fix it?? import java.awt.*; import java.applet.*; import java.net.URL; public class AnotherAudioAttempt{ public static void AlertSound(){ try{ java.io.
-
WRT54GS2 - Random Disconnect help.
I am baffled as to why my wireless internet disconnects. It seems that after visiting certain flash sites, I will lose internet connectivity. I have no idea why. If anyone has any ideas as to why, I would greatly appreciate the help. I will provide a
-
I deleted an app from iPad 2 and attempted to reinstall from app store but the icon says "Installed". I don't see the icon on screen so how can I get the app deleted to reinstall?
-
hi.. i am a beginner in applet programming and have some problem in passing parameters. If anyone could help me, how can i pass a dynamic parameter in the <param name="username" value="user"> tag. what i meant was i wanted to assign different value f