Merge columns in an ALV Table
Hi colleagues,
is it possible to merge two or more columns in ALV Table (like ColSpan in the Matrix-Layout) to write a text over more than one column?
I haven't found any solution for it until now.
Best regards
Stefan
Although it may not be exactly what you were looking for, you can create a table ColumnGroup:
http://help.sap.com/saphelp_nw70/helpdata/EN/f0/5d9041d3c72e7be10000000a1550b0/frameset.htm
Similar Messages
-
Merge of Cells in ALV table in ABAP webdynpro.
Hi All,
We have a requirement to merge cells vertically if the consecutive cells have same data.(The merge of cells happens when we click on sort of a column.) This functionality needs to be achived with out sorting the cells.Sorted data is populated in the ALV table.
I will be greatfull if any one can help us on this issue.
Thanks in advance
Regards,
SharathHi Sarath,
Check this..
http://help.sap.com/saphelp_nw70ehp2/helpdata/en/9b/46bb0d339b42cc8d30636ca0c9f5b6/frameset.htm
and go through this..
merging cells in table
http://forums.sdn.sap.com/click.jspa?searchID=71460300&messageID=9768692
cheers,
Kris.
Edited by: kissnas on Apr 18, 2011 12:10 PM -
Hi Experts,
I need single column to be selected from a ALV table...selected in da sense to be highlighted....as it happens..by default for a row.....
I hope u understood my query...
Please help me out in this..
I know u all will surely help me...
Thks and Regards,
Runali.Hi Runali,
Get the reference to the column settings of your ALV Model. Then you can get the reference of each column by passing the column ID. There is a method set_selected_state in the column class, but that does not highlight the column as it does for a row. So what you can use is a cell design for a column that will highlight the column with a color or whatever.
lr_column = lr_column_settings->get_column( ID = id ).
lr_column->set_cell_design( preferred design ).
Hope this helps. Please award points if it solves your purpose.
Regards,
Nithya -
Column name in ALV table dissapeared after new language package installatio
Hi,
We have a custom field in an ALV table in SAP system. In english everything was just fine with our custom field.
But when we installed a new languaged the column name dissapeared.
My question is:
Where does the ALV get the column name from? Is there a standard method which I can search for which is used for this purpose in ALV?
regards
Baranthe field name comes from data element FIELD name you have specified when creating ur custom field..
try to change that field name for that field..
hope it works
award points if helpful -
How can I change column name in ALV table in WebDynpro ABAP?
Hi Everyone,
I have created an ALV table in WebDynpro ABAP. I have created a context node and added the required attributes there - for the ALV display.
Now I want to change one columnn name of the ALV table.... Currently it is showing the description of the data element, which I don't want to show. I cannot create a new DE only for this purpose.
Please let me know how can I change the name of the column.
RegardsHi,
This may help you to define your own column text in the ALV Table of webdynpro.
see the below code.
Here 'STATUS_ICON' is the column of the the output display of the ALV Table of webdynpro.
"change the label of the report.
DATA: lr_weeknum TYPE REF TO cl_salv_wd_column.
CALL METHOD l_value->if_salv_wd_column_settings~get_column
EXPORTING
id = 'STATUS_ICON'
RECEIVING
value = lr_weeknum.
SET THE LABEL OF THE COLUMN
DATA: hr_weeknum TYPE REF TO cl_salv_wd_column_header.
CALL METHOD lr_weeknum->get_header
RECEIVING
value = hr_weeknum.
CALL METHOD lr_weeknum->set_resizable
EXPORTING
value = abap_false.
hr_weeknum->set_prop_ddic_binding_field(
property = if_salv_wd_c_ddic_binding=>bind_prop_text
value = if_salv_wd_c_ddic_binding=>ddic_bind_none ).
set the text of the column
CALL METHOD hr_weeknum->set_text
EXPORTING
value = 'C Form'.
regarads,
balu -
How to merge the Rows in ALV table?
Hi All,
I want to merge the Rows in my ALV table(SALV_WD_TABLE). Is it possible?
Regards,
Yugesh A.Yogi1729 wrote:
Hi All,
how to Restrict the Row in the Pivot table.
My Requirement is like this.
i have to show the top 10 values in the pivot table but My report is show all the values.
how can we achieve this.
any quick solution for this appreciated.
Thanks,
Yogi.You can't really restrict the rows in a pivot table, but you can do this:
http://oraclebizint.wordpress.com/2008/01/17/oracle-bi-101332-pagination-in-pivot-tables/ -
How can I do a Header Group Using Group columns for WD ALV tables
Hi
I want to group columns into a header group.
Eg:
from Date
Availability
to date
Any ideas if it is possible with WD ALV tables?Hi,
Try to use the if_salv_wd_field_settings for the column grouping of the Model object.
Also check the class CL_SALV_WD_FIELD.
Regards,
Lekha. -
Visual Composer 7.2 SP3 - Adjust column widths of ALV tables by end user
Hello,
we're using ALV tables with values coming out of function modules and queries.
Unfortunately I can't see an opportunity to adjust column widths at runtime by the end user. This is in contrast to VC 7.0 using flex.
Is there a way to archieve this?
Kind regards
StefanHello Stefan,
This is a feature of Webdynpro Flex runtime. You can adjust column widths at Flex runtime in 720 SP3 also.
This is not supported by Webdynpro HTML runtime.
Regards,
Talia -
How to fix the width of the column when using alv table
Hi ,
I am displaying the contents in a table. Of course using alv component i displayed the content. Now the problem is the column width is not fixed with value of the table entries( based on the domain length level). As length of field increases or decreses as the length of the content increases or decreases. I wanted to fix the column width whatever be the length of the contents.
Can any one help in this regard ?
Thanks Pons.Hi,
Please find the code related to your problem.
METHOD configure_alv .
data declaration for column settings
DATA : lr_column_settings TYPE REF TO if_salv_wd_column_settings,
lr_col_header TYPE REF TO cl_salv_wd_column_header,
lt_columns TYPE salv_wd_t_column_ref,
ls_column TYPE salv_wd_s_column_ref.
data declaration for table settings
DATA : lr_salv_wd_table_ctr TYPE REF TO iwci_salv_wd_table,
lr_table_settings_ctr TYPE REF TO if_salv_wd_table_settings,
lr_header_ctr TYPE REF TO cl_salv_wd_header.
Variables for drop-down and inpufield reference
DATA : lr_drdn_by_key TYPE REF TO cl_salv_wd_uie_dropdown_by_key,
lr_input_field TYPE REF TO cl_salv_wd_uie_input_field,
l_header TYPE string.
get ALV Component <CONTRACT_DETAILS>
lr_salv_wd_table_ctr = wd_this->wd_cpifc_payment_detail( ).
wd_this->alv_config_table = lr_salv_wd_table_ctr->get_model( ).
set visible row count
lr_table_settings_ctr ?= wd_this->alv_config_table.
lr_table_settings_ctr->set_visible_row_count( '5' ).
lr_table_settings_ctr->set_read_only( abap_false ).
lr_table_settings_ctr->set_grid_mode( ).
lr_table_settings_ctr->set_width(
EXPORTING
value = '980PX' ).
wd_this->alv_config_table->if_salv_wd_table_settings~set_data_check( if_salv_wd_c_table_settings=>data_check_on_cell_event ).
wd_this->alv_config_table->if_salv_wd_std_functions~set_pdf_allowed( abap_false ).
wd_this->alv_config_table->if_salv_wd_std_functions~set_view_list_allowed( abap_false ).
wd_this->alv_config_table->if_salv_wd_std_functions~set_edit_insert_row_allowed( abap_false ).
wd_this->alv_config_table->if_salv_wd_std_functions~set_edit_delete_row_allowed( abap_true ).
wd_this->alv_config_table->if_salv_wd_std_functions~set_export_allowed( abap_false ).
wd_this->alv_config_table->if_salv_wd_std_functions~set_edit_check_available( abap_false ).
CLEAR: l_header.
l_header = wd_assist->if_wd_component_assistance~get_text( '030' ).
lr_header_ctr = lr_table_settings_ctr->get_header( ).
lr_header_ctr->set_text( l_header ).
set text header for Columns.
CLEAR: l_header,lt_columns.
lr_column_settings ?= wd_this->alv_config_table.
lt_columns = lr_column_settings->get_columns( ).
LOOP AT lt_columns INTO ls_column.
CASE ls_column-id.
WHEN 'PAYMENT_METHOD'.
get header details
lr_col_header = ls_column-r_column->get_header( ).
disable DDIC field label
CALL METHOD lr_col_header->set_prop_ddic_binding_field
EXPORTING
property = if_salv_wd_c_ddic_binding=>bind_prop_text
value = if_salv_wd_c_ddic_binding=>ddic_bind_none.
set user defined column header
l_header = wd_assist->if_wd_component_assistance~get_text( key = '020' ).
lr_col_header->set_text( l_header ).
CREATE OBJECT lr_drdn_by_key
EXPORTING
selected_key_fieldname = ls_column-id.
ls_column-r_column->set_cell_editor( lr_drdn_by_key ).
ls_column-r_column->se_width( '100PX' ).
lr_drdn_by_key->set_key_visible(
EXPORTING
value = abap_true ).
WHEN OTHERS.
ENDCASE.
CLEAR: l_header,ls_column.
ENDLOOP.
ENDMETHOD.
Regards
Manoj Kumar -
How can i change the column label text in a alv table display
how can i change the column label text in a alv table display??
A similar kinda of question was posted previuosly where the requirement was the label text was needed and following below code was given as solution :
<i>* declare column, settings, header object
DATA: lr_column TYPE REF TO cl_salv_wd_column.
DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings.
DATA: lr_column_header type ref to CL_SALV_WD_COLUMN_HEADER.
get column by specifying column name.
lr_column = lr_column_settings->get_column( 'COLUMN_NAME1' ).
set Header Text as null
lr_column_header = lr_column->get_header( ).
lr_column_header->set_text( ' ' ).</i>
My specific requirement is i have an input field on the screen and i want reflect that value as the column label for one of the column in the alv table. I have used he above code with slight modification in the MODIFYVIEW method of the view since it is a process after input. The component gets activated without any errors but while run time i get an error stating
<i>"The following error text was processed in the system CDV : Access via 'NULL' object reference not possible."</i>
i have checked in debugging and the error occured at the statement :
<i>lr_column = lr_column_settings->get_column( 'CURRENT_YEAR' ).</i>Please can you provide me an alternative for my requirement or correct me if i have done it wrong.
Thanks,
SuriI found it myself how to do it. The error says that it is not able to find the reference object i.e it is asking us to refer to the table. The following piece of code will solve this problem. Have to implement this in WDDOMODIFYVIEW method of the view. This thing works comrades enjoy...
DATA : lr_cmp_usage TYPE REF TO if_wd_component_usage,
lr_if_controller TYPE REF TO iwci_salv_wd_table,
lr_cmdl TYPE REF TO cl_salv_wd_config_table,
lr_col TYPE REF TO cl_salv_wd_column.
DATA : node_year TYPE REF TO if_wd_context_node,
elem_year TYPE REF TO if_wd_context_element,
stru_year TYPE if_alv_layout=>element_importing,
item_year LIKE stru_year-i_current_year,
lf_string TYPE char(x),
DATA: lr_column TYPE REF TO cl_salv_wd_column.
DATA: lr_column_header TYPE REF TO cl_salv_wd_column_header.
DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings.
Get the entered value from the input field of the screen
node_year = wd_context->get_child_node( name = 'IMPORTING_NODE' ).
elem_year = node_year->get_element( ).
elem_year->get_attribute(
EXPORTING
name = 'IMPORT_NODE-PARAMETER'
IMPORTING
value = L_IMPORT_PARAM ).
WRITE L_IMPORT_PARAM TO lf_string.
Get the reference of the table
lr_cmp_usage = wd_this->wd_cpuse_alv( ).
IF lr_cmp_usage->has_active_component( ) IS INITIAL.
lr_cmp_usage->create_component( ).
ENDIF.
lr_if_controller = wd_this->wd_cpifc_alv( ).
lr_column_settings = lr_if_controller->get_model( ).
get column by specifying column name.
IF lr_column_settings IS BOUND.
lr_column = lr_column_settings->get_column( 'COLUMN_NAME').
set Header Text as null
lr_column_header = lr_column->get_header( ).
lr_column_header->set_text( lf_string ).
endif. -
Hi,
One of the table column in my ALV table displays Sales order with line item separated by "-".
For Ex : 70000174 - 10.
The sales order number should be a link in the table. When we click on Sales order number it should display another view.
How can I make only sales order number as a link?
Please note: Line item number should not be a link.
It should appear as below in the table.
70000174 - 10
70000175 - 10
70000176 - 10
70000177 - 10
Thanks in advance,
PrathapHi,
Having concatenatedvalue into once column and showing link to part of cell is not possible. Try to have salesorder and lineitem in 2 columns, and provide the link for salesorder.
Let your cleint know that the above case(original post) is not possible.
One more thing, POPINS are not possible for ALV. Youcan use TABLE UI element for popins.
Regards,
Lekha. -
Hi
My requitrement is that i want to merge Columns (not Rows) in my ALV layout.
the condition is that i have to merge columns of only 1 row of my layout.
Cell_Merge will Merge Rows but how can i merge columns
suitable points will be awarded.
with regards
RakshanHi rakshan,
could you give some kind of example?
ALV does not allow to change the structure of the table displayed. If your goal is to put the contents of more than one column into one column, you need a destination column.
I could imagine to concatenate all columns into a string:
FORM MERGE_CELLS using ps_itab type any changing pv_string type string.
data:
lv_tmp(100) type c,
lv_string type string.
field-symbols: <f> type any.
do.
assign component sy-index of ps_itab to <f>.
if sy-subrc <> 0.
exit.
endif.
write <f> to lv_tmp left-justified.
concatenate lv_string lv_tmp into lv_string separated by space.
enddo.
pv_string = lv_string.
endform.
Note: ABAP does not allow (yet) the use of write to <string variable>, that's why we use a temporary CHAR field.
Regards,
Clemens -
Dynamically Merging Columns in a table
Hello All,
Is it possible to merge columns in table based on some set of condition.
The current output is as follows:
Column 1 Column 2 Column 3 Column 4 Column 5
Row1 "" "" "" ""
SubRow1 "" "" "" ""
Value 1 Value 2 Value 3 Value 4 Value 5
The output which we need is as follows:
Column 1 Column 2 Column 3 Column 4 Column 5
Merged Row 1 (merged columns)
Sub Row 1 (merged columns)
Value 1 Value 2 Value 3 Value 4 Value 5
Merged Row 2 (merged columns)
Sub Row 2 (merged columns)
Value 1 Value 2 Value 3 Value 4 Value 5
Merged Row 3 (merged columns)
Sub Row 3 (merged columns)
Value 1 Value 2 Value 3 Value 4 Value 5
Thanks.
KiranThe merge is simple if you do not think about it as in word:))
The merge can be done using scripting: just concatenate the values of the fields into one variable, fill in the value to the first column, change its width (to the width of the previous 4 cols) and hide te remaining/ blank cols.
Have fun, Otto -
How to set title/text for ALV table column header in WD ABAP
Hello,
I am working in WDA using SALV_WD_Table to display data in table. I need to change the column header text, the obvious way is to get the column header and call the method SET_TEXT to set new text / title. However, this method does NOT work, it does not change the column header text. I also tried the SET_TOOLTIP, this one works, but SET_TEXT does not work. Anyone has idea why this not working and do you find any go-around solution?
My version is NW 7.0
Thank
JaysonHi jason ,
For setting Heder text for your ALV table
ip_confing type ref to CL_SALV_WD_CONFIG_TABLE.
"set alv table header
ip_config->if_salv_wd_table_settings~r_header->set_text( 'Test ALV Header functionality' ).
first you have to hide the DDIC text and then try to set your own text .
"modify columns
LOOP AT lt_columns INTO ls_column.
lr_column = ls_column-r_column.
CASE ls_column-id.
WHEN 'MANDT'.
"hide this field
lr_column->set_visible( cl_wd_abstr_table_column=>e_visible-none ).
WHEN 'SEQNR'.
"set header to different string
lr_column->r_header->set_ddic_binding_field( if_salv_wd_c_column_settings=>ddic_bind_none )." use this line to hide ddic text
lr_column->r_header->set_text( 'Position' ).
endcase.
endloop.
Regards
Chinnaiya P -
How to remove a column from alv table
Hi All
How to remove a specific column from alv table.?
Thanks & Regards
SUNFor delete u can follow the above post..
Fo making invisible :
data m_col type ref to cl_salv_wd_column.
m_col = alv_mode->IF_SALV_WD_COLUMN_SETTINGS->GET_COLUMN (' col1' ).
m_col->SET_VISIBILITY( '01' ).
Maybe you are looking for
-
Events not showing time in iCal
I just lost my hard drive last week and now I'm re-entering everything. I'm trying to put my calendar events back into iCal and it no longer shows the time next to the event on the calendar. It used to say for example: "Dr. Appt-3:15" but now it only
-
I have a new computer. I transferred all my data files and installed my programs. Now, when I try to print a page ti pdf using Adobe Acrobat 9, Firefox crashes, and Adobe hangs up.
-
How do I move my production users (stored in the portal database using a RDBMS realm) to QA and Dev. I can't simply do a database refresh due to the desktop stuff. Thanks Kunal
-
Re : Excise Capture for dEpot Scenerio.
Hi All, I have an issue, where in the user has captured excise duties during MIGO. Later he has captured the same duties in J1IG. Now in the material doc - Excise Tab, the Excise duty are doubled, and also in table J_1IEXCDTL, I can see postings in f
-
HT201401 How do i reduce the size of my Other file to increase storage capacity?
How do i reduce the size of my Other file to increase storage capacity? I have almost 4.5g taken up of storage in Other on my 8g phone.