Alv table title
Hi guys,
how can we provide title for alv table . Please give me the exact method names
Regards
Srinivas
Try this..
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' ).
or
data: lr_table_settings type ref to if_salv_wd_table_settings.
data: lr_header type ref to CL_SALV_WD_HEADER.
lr_table_settings ?= l_value.
lr_header = lr_table_settings->get_header( ).
lr_header->set_text( 'FLIGHT LIST SEARCH' ).
Cheers,
Kris.
Similar Messages
-
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 -
Page title duplicating in the grid ALV table header when run on portal
Hi Experts,
I am facing an issue with the ALV display. My object contains three screens.
The first screen is a selection screen.
The second one is an overview screen which displays the data in a Grid ALV table corresponding to the "supplier id" entered in the first screen.
The grid ALV has a header(contains name,location etc) and a table to display data.
I have created a SAP Transaction iView on the portal for this object.
The issue here is that when I run this in ABAP, everything is fine.
But when I preview it on the portal, the first screen is displayed correctly but in the second screen the title of the page is duplicated in the table header and the header that is supposed to display the name, location etc. is replaced by the duplicated title.
Please suggest an alternative or solution for this.
Thanks and Regards,
Aditi Sharma<< Do not post the same question across a number of forums. There are 4 threads with the same issue now. Violating SDN forum rules may result in deletion of your user. >>
-
Hello Folks,
I have an ALV table view, after selecting any line item in the view i have button "DETAIL" which would pop up another view with the details in ALV view again.
I have done the below steps but iam unable to get the alv pop-up with details. I would really appreciate if anyone can help me with this.
My main view <i>V_OVERVIEW</i> is the initial Table view and i have created another View <i>V_POPUP</i> which just has a Viewcontainer. <i>V_OVERVIEW</i> is embeded in window <i>W_MAIN</i> and <i>V_POPUP</i> is embeded in <i>W_POPUP</i>.
The view V_POPUP has the following code in its MODIFYVIEW method.
DATA:node_wage TYPE REF TO if_wd_context_node,
node_detail type ref to if_wd_context_node,
lt_sltd_elmnts TYPE wdr_context_element_set,
lr_element TYPE REF TO if_wd_context_element,
wa_detail TYPE if_v_pop_up=>element_wage_benefit,
it_detail TYPE if_v_pop_up=>elements_wage_benefit.
data : lt_ssn type table of ZUT_XFERRED_SSN,
lt_return type table of bapiret2.
node_wage = wd_context->get_child_node( 'WAGE_BENEFIT' ).
lt_sltd_elmnts = node_wage->get_selected_elements( abap_true ).
lr_element->get_static_attributes(
IMPORTING static_attributes = wa_detail ).
CALL FUNCTION 'ZZ_GET_DETAIL'
EXPORTING
i_ob_key = objectkey
i_quarter = -quarter
TABLES
T_DTL = lt_dtl
T_RETURN = lt_return.
navigate from <CONTEXT> to <TP_RATES> via lead selection
node_detail = wd_context->get_child_node( name =
ig_componentcontroller=>wdctx_ssn_details ).
node_detail->bind_elements( new_items = lt_dtl ).
The main View V_OVERVIEW has the button "DETAIL" which calls the window W_POPUP to show view V_POPUP embeded in it as a popup, here is the code in the Button handler
DATA:
l_api_main TYPE REF TO if_wd_view_controller,
l_window_manager TYPE REF TO if_wd_window_manager,
l_popup TYPE REF TO if_wd_window,
l_cmp_api TYPE REF TO if_wd_component.
* Pop to confirm
CLEAR : l_api_main, l_cmp_api,
l_window_manager, l_popup.
l_api_main = wd_this->wd_get_api( ).
l_cmp_api = wd_comp_controller->wd_get_api( ).
l_window_manager = l_cmp_api->get_window_manager( ).
l_popup = l_window_manager->CREATE_WINDOW(
WINDOW_NAME = 'W_POP_UP'
TITLE = 'Details' ).
l_popup->open( ).hey folks nevermind i got it.
Thanks -
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, -
Hello,
I'm trying to create an alv table and when clicking on a hotspot go to a different ALV table.
In the layout I define the second table in a view container and not in a table, because I want to click on one of its cells and go to another table (third table).
I define each table in a separated view in one window
My problem is that when I click on the first hotspot I get the error message :
<b><i>window ZSET_WEB does not exist with in component SALV_WD_TABLE</i></b>
<b>The code:</b>
DATA: l_window_manager TYPE REF TO if_wd_window_manager,
l_cmp_api TYPE REF TO if_wd_component,
l_window TYPE REF TO if_wd_window.
***** call the second table ************
l_cmp_api = wd_comp_controller->wd_get_api( ).
l_window_manager = l_cmp_api->get_window_manager( ).
l_window = l_window_manager->create_window_for_cmp_usage(
interface_view_name = 'ZSET_WEB' <i>window name</i>
component_usage_name = 'ALV1' <i>componenet used name</i>
message_display_mode = if_wd_window=>co_msg_display_mode_selected
l_window->open( ).
Please advise,
Best Regards,
Efratthanks for your help,
ZSET_WEB is a window,
my problem is that when I use<i> create_window( )</i> like Thomas suggested, I don't know how to send the right view (the window as I mention has 2 views)
and I get the error message: <b>An Instance of the View ZSET_WEB Already Exists in the Component</b> <b>Code</b>
l_cmp_api = wd_comp_controller->wd_get_api( ).
l_window_manager = l_cmp_api->get_window_manager( ).
l_window = l_window_manager->create_window(
* modal = modal
window_name = 'ZSET_WEB'
* title = title
* close_button = close_button
button_kind = if_wd_window=>co_buttons_yesnocancel
message_type = if_wd_window=>co_msg_type_question
l_window->open( ).
should I use another function along with this function or another function?
when I use
wd_comp_controller->open_popup(
i_popup_name = 'POPUP_DETAILS' ' second view
i_button_kind = if_wd_window=>co_buttons_close
i_message_type = if_wd_window=>co_msg_type_none ).
it open a new window but doesn't show me the table
Thanks for your help
Efrat -
Hi all,
is it possible to print a different title for each page when you use ALV hierarchy?
For example I need to print the PO number for each page as thet title.
Thanks,
MelTry this..
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' ).
or
data: lr_table_settings type ref to if_salv_wd_table_settings.
data: lr_header type ref to CL_SALV_WD_HEADER.
lr_table_settings ?= l_value.
lr_header = lr_table_settings->get_header( ).
lr_header->set_text( 'FLIGHT LIST SEARCH' ).
Cheers,
Kris. -
Displaying default value for a field in ALV table
Hai all,
I am having an ALV table in which I want to display Requisition number by default using a value which i generated randomly and it is stored in a variable.
While displaying ALV table my req number field should display that value by default when ever user is inserting a row( all the coloumns n my alv are editable.
Is it possible??
Kindly give some suggestions.
Thanks in Advance,
Nalla.BHai Kris,
I took help from ur link and i declared a global attribute request_number.
and i created an event handler ON_ALV_INSERT and did the follwing coding for giving default value wen ever am inserting new row.
FIELD-SYMBOLS: <wa_row> LIKE LINE OF r_param->t_inserted_rows.
DATA bill_details TYPE REF TO zdom_bill_detail.
LOOP AT r_param->t_inserted_rows ASSIGNING <wa_row>.
bill_details ?= <wa_row>-r_value.
IF bill_details->REQ_NUMBER IS INITIAL.
DATA lo_nd_bill_detail TYPE REF TO if_wd_context_node.
DATA lo_el_bill_detail TYPE REF TO if_wd_context_element.
DATA ls_bill_detail TYPE wd_this->Element_bill_detail.
navigate from <CONTEXT> to <BILL_DETAIL> via lead selection
lo_nd_bill_detail = wd_context->get_child_node( name = wd_this->wdctx_bill_detail ).
lo_el_bill_detail = lo_nd_bill_detail->get_element( index = <wa_row>-index ).
lo_el_bill_detail->set_attribute(
EXPORTING
name = 'REQ_NUMBER'
value = wd_comp_controller->request_number
Wen am setting the value of wd_comp_controller->request_number to my context attribute am getting NULL object ref error.
lo_el_bill_detail->set_attribute(
name = `REQ_NUMBER`
value = wd_comp_controller->request_number ).
Pls give some suggestions,
Thanks in Advance,
Nalla.B -
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. -
How to delete a particular row in ALV table
Hi,
How to delete a particular row in ALV table based on some condition(by checking value for one of the columns in a row)
Thanks
Bala DuvvuriHello Bala,
Can you please be a bit more clear as to how you intend to delete the rows from your ALV? By the way deleting rows from an ALV is no different from deleting rows from a normal table. Suppose you have enabled selection property in ALV & then select multiple rows and click up on a button to delete the rows then below would be the coding: (Also keep in mind that you would have to maintain the Selection property of the context node that you are binding to your ALV to 0..n)
data : lr_table_settings TYPE REF TO if_salv_wd_table_settings,
lr_config TYPE REF TO cl_salv_wd_config_table.
lr_table_settings ?= lr_config.
** Setting the ALV selection to multiple selection with no lead selection
lr_table_settings->set_selection_mode( value = cl_wd_table=>e_selection_mode-multi_no_lead ).
Next delete the selected rows in the action triggered by the button:
METHOD onactiondelete_rows .
DATA: wd_node TYPE REF TO if_wd_context_node,
lt_node1 TYPE ig_componentcontroller=>elements_node,
wa_temp TYPE REF TO if_wd_context_element,
lt_temp TYPE wdr_context_element_set,
row_number TYPE i VALUE 0.
wd_node = wd_context->get_child_node( name = 'NODE' ).
CALL METHOD wd_node->get_selected_elements
RECEIVING
set = lt_temp.
LOOP AT lt_temp INTO wa_temp.
wd_node->remove_element( EXPORTING element = wa_temp ).
ENDLOOP.
CALL METHOD wd_node->get_static_attributes_table
EXPORTING
from = 1
to = 2147483647
IMPORTING
table = lt_node1.
wd_node->bind_table( new_items = lt_node1 ).
ENDMETHOD.
If in case this isn't your requirement please do let me know so that I can try come up with another analysis.
Regards,
Uday -
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 -
UI Element : MessageArea : How to I show a ALV table instead of messages
UI Element : MessageArea : How to I show a ALV table (Message Log) instead of all the messages.
Hi,
Create a View Container UI Element at the bottom of the View and Embed ALV into it. Catch the Errors and populate into ALV instead of report message.
hope this helps u.,
Thanks & Regards,
Kiran -
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 -
Hi,
Does any one have a code sample for the ALV Table Delete button? When I hit the DELETE button the selected row gets deleted but how can I save this deletion to the database table so that when I do a refresh the deleted row does not re-appear.
Thanks. KimHi Kim,
i am sorry but I dont have a sample code for this .. but yes i can tell you a very simple logic here that should work fine ..
When the user clicks on Delete Entry call method say "Delete_entry" and within this you can write code based on this logic..
1) On_Action_Lead_Select should copy the content of that row to another context node say "Selected_Entry"
2) Search for this entry in your internal table/database that was bound to the ALVs context node(data source) and remove it using standard functions
3) again read the database/internal table data and bind it to the context node ..
Your changes will be reflected in your ALV..
I hope this helps and if it does please do award points
Also please close the thread if the issue gets resolved ..
Regards,
Anoop -
How to create a context menu in ALV table cell editor(Webdynpro abap )
Hello Experts,
I am having a problem in creating a context menu in a table cell editor in the ALV table output.I have assigned a 'lta' as the cell editor.But befor assigning the lta as cell editor I have assigned the menu to the lta.But when the view is rendered I can see the lta with the actioned assigned to it.But I cannot see the context menu.
The code snippet below:
"Create menu for each coloumn
create OBJECT lo_menu_actions type CL_SALV_WD_VE_MENU EXPORTING
id = 'MITM_ACTIONS'.
lo_menu_actions->set_visible( value = abap_true ).
lo_menu_actions->set_visible_fieldname( value = 'ACTIONS' ).
"ADd menu items
CREATE OBJECT lo_menu_item_create type CL_SALV_WD_VE_MENU
exporting
id = 'MITM_CREATE_EXPRESSION'.
lo_menu_item_create->set_visible( value = abap_true ).
lo_menu_item_create->set_visible_fieldname( value = 'Create' ).
"Add item 1
lo_menu_actions->ADD_ITEM( VALUE = lo_menu_item_create ).
" Set the cell editor for each column cell(link to an action)
LOOP AT lt_node_dec_tab_cols INTO ls_node_dec_tab_cols .
lv_column_name = ls_node_dec_tab_cols-object_name.
lr_column = lr_column_settings->get_column( lv_column_name ).
"Create 'lta' Ui item
CREATE OBJECT lo_lta TYPE cl_salv_wd_uie_link_to_action.
lo_lta->set_menu( value = lo_menu_actions ).
lo_lta->set_text_fieldname( lv_column_name ).
lr_column->set_cell_editor( lo_lta ).
IF ls_node_dec_tab_cols-is_result EQ abap_true.
lr_column->set_cell_design( value =
cl_wd_table_column=>e_cell_design-key_medium ).
ENDIF.
ENDLOOP.Hi Prakash,
I have not come across this requirement till now to have context menu in a cell editor of alv.
Unfortunately the implementation of method SET_MENU of alv ui elements ( ex: cl_salv_wd_uie_text_view ) is not updating alv configurable table, instead it just stores in a global attribute as string. Hence has no effect on context menu.
If your user is very particular about this requirement of having context menu in cell editor, you can go for a normal table. Because, normal table's cell editor has the property to set the menuID as we do it for other ui elements.
Regards,
Rama
Maybe you are looking for
-
Syncing & maximum number of devices for one app?
I am setting up five iPads for a small business. They are supposed to be identical -- same Apple ID for all of them, same apps, files, settings, &c. I am still working out some of the syncing and access restriction settings. However the business p
-
How to transform node name in XML data source for SSIS
I have the following xml file; I want to change the node name of Emp.location to Emp_location, Edu.location to Edu_location, Addr.location to Addr_location as it was not supported by SSIS. I have multiple files like that. I am thinking to use SSIS X
-
Hi, I am using Microsoft Biztalk 2010 on Windows Server 2007(SP2). I am want to use WCF-SQL adapter but I am not able to see any adapter when I tried to create new adapter at "Platform Setting -> Adapter -> New Adapter dropdown.". Windows Communicati
-
Hi friends i need some help now , i created one ALV TABLE , and one node name as flighinfo and im retriving the 4 FIELDS ONLY from SFLIGHT TABLE and i binded it to the Data node ALV context but in t
-
Apple programs won't open on mountain lion
The program icons in the dock just bounce and do open the programs in Mountain Lion.