Drop down in ALV List
Hi,
Is drop down feature available in ALV using
REUSE_ALV_LIST_DISPLAY ?
If Yes, How i can acheive that ?
Thanks.
Edited by: Maré Pretorius on Jun 9, 2009 7:09 PM
Edited by: Maré Pretorius on Jun 9, 2009 7:23 PM
Similar Messages
-
Used to, I could organize my drop down book mark list from the tool bar, in alphabetical order from A-Z by clicking on view, sort by, select . Now every time I add a new bookmark it goes to the bottom of my bookmark list in Unsorted bookmarks . I can go to the bookmarks and sort the menu in Alpha. order. However, when I go back and drop down the bookmark list from the tool bar, the new bookmarks are still in the Unsorted list at the bottom. The bookmark's menu may or not have them in assorted list. This occurred several updates back. Why can I no longer sort the drop down book marks list in A-Z alph. order? This is a major obstacle when trying to search for a particular bookmark that I have made in the not too distant past.
That did solve my problem. Madperson Thank You Very Much!!!!! I'm not real literate on the mechanics of working computers even though I use them all the time. Basically I'm a point & click kinda guy and beyond that I'm pure novice! This is going to save me a lot of wasted time.
Allen C. Geiser
ageiser34 -
On updating from FF3.5.10 (good :-) to FF3.6.6 (bad :-( ): No session-restore option; no menu drop-down "Recently bookmarked" list. (Sys=winXP sp3)
1. can a non-techy fix this? :-(
2. how do I recover to FF3.5.10? - I liked it very much ! - thanks to all at Mozilla :-)Make sure that you not run Firefox in [[Private Browsing]] mode.
In Private Browsing mode some menu items are disabled (grayed) and some features like visited links and others are disabled and not working.
You are in Private Browsing mode if you see "Tools > Stop Private Browsing".
See [[Private Browsing]] and http://kb.mozillazine.org/Issues_related_to_Private_Browsing -
How does one come to know this..drop down in ALV in WD
Hello Friends,
I had a requirement of adding a drop down in ALV, i eventually got it but I have some questions about it
I used the following code and got the drop down
lr_column = lr_column_settings->get_column( 'BWART' ).
CREATE OBJECT lr_input_field
EXPORTING
value_fieldname = 'BWART'.
lr_column->set_cell_editor( lr_input_field ).
DATA : LR_DROPDOWN TYPE REF TO CL_SALV_WD_UIE_DROPDOWN_BY_KEY.
CREATE OBJECT LR_DROPDOWN EXPORTING SELECTED_KEY_FIELDNAME = 'BWART'.
LR_COLUMN->SET_CELL_EDITOR( LR_DROPDOWN ).
DATA: LT_VALUESET TYPE TABLE OF WDR_CONTEXT_ATTR_VALUE,
LS_VALUESET TYPE WDR_CONTEXT_ATTR_VALUE,
LR_NODE TYPE REF TO IF_WD_CONTEXT_NODE,
LR_NODEINFO TYPE REF TO IF_WD_CONTEXT_NODE_INFO.
LR_NODE = WD_CONTEXT->GET_CHILD_NODE( 'RETURN_NODE' ).
LR_NODEINFO = LR_NODE->GET_NODE_INFO( ).
LS_VALUESET-VALUE = '973'.
LS_VALUESET-TEXT = '973'.
APPEND LS_VALUESET TO LT_VALUESET.
LS_VALUESET-VALUE = '222'.
LS_VALUESET-TEXT = '222'.
APPEND LS_VALUESET TO LT_VALUESET.
LR_NODEINFO->SET_ATTRIBUTE_VALUE_SET( EXPORTING NAME = 'BWART' VALUE_SET = LT_VALUESET ).
My question is ... how does 1 know which class to use? how to use that class... most of concepts about OOPS are clear.. but i still cant figure out how does 1 find out which class to use.. is it all by expericence..In short: Yes, by experience. Then again, for WD4A there is a class for each UI-Element available. Once you know this, you can easily search se24 for CLWD<UI-NAME>* or the like.
-
Drop-downs in ALV: display list of code & value
Hi All.
When you define a Drop-down in Screen-editor (SE51) you'll get a field that contains list of code & value (if you set the "Show key within dropdown lists" option in the SAPGUI).
I would like to see the same behaviour in ALV Drop-downs. Currently there are 2 options: create a list that shows codes only, or create a that shows the values and the codes are hidden.
Both these options are set via the tables in Method "SET_DROP_DOWN_TABLE" of the CL_GUI_ALV_GRID class ([this is an example of how to set it|List Box in ALV Grid;).
Any idea how to set it will be welcome and rewarded.
Regards.
Ayal Telem.Hi Ridhima,
I need a drop down field in ALV list for my ABAP report. The user will select one of them and the report will go with this selection. How do you make such thing? I need it too.. -
Issue in value set Drop down for ALV in Webdynpro with Index
Hi Experts,
We are unable to get the Drop down values in the ALV Table as shown below.
Code:
DATA lo_nd_table TYPE REF TO if_wd_context_node.
DATA lt_table TYPE wd_this->elements_table.
DATA ls_table TYPE wd_this->element_table.
DATA: lr_input TYPE REF TO cl_salv_wd_uie_input_field,
lr_column TYPE REF TO cl_salv_wd_column,
lt_node_info TYPE wdr_context_attr_info_map,
ls_node_info TYPE wdr_context_attribute_info,
lr_dropdown TYPE REF TO cl_salv_wd_uie_dropdown_by_idx,
lr_info TYPE REF TO if_wd_context_node_info.
DATA:lt_columns TYPE salv_wd_t_column_ref,
ls_columns TYPE salv_wd_s_column_ref,
lv_tabix TYPE sy-tabix,
lv_count TYPE c.
DATA: ls_valueset TYPE wdr_context_attr_value,
lt_valueset TYPE wdr_context_attr_value_list.
TYPES:BEGIN OF ty_name,
name TYPE string,
END OF ty_name.
DATA: lt_name TYPE TABLE OF ty_name,
ls_name TYPE ty_name.
* navigate from <CONTEXT> to <TABLE> via lead selection
lo_nd_table = wd_context->get_child_node( name = wd_this->wdctx_table ).
SELECT * FROM zemp_table INTO CORRESPONDING FIELDS OF TABLE lt_table UP TO 10 ROWS.
LOOP AT lt_table INTO ls_table.
lv_tabix = sy-tabix.
CLEAR: ls_table-leave_values.
DO 1 TIMES.
lv_count = lv_count + 1.
CONCATENATE 'Open' lv_count INTO ls_valueset-value.
CONCATENATE 'Open' lv_count INTO ls_valueset-text.
APPEND ls_valueset TO ls_table-leave_values.
CLEAR ls_valueset.
CONCATENATE 'Approved' lv_count INTO ls_valueset-value.
CONCATENATE 'Approved' lv_count INTO ls_valueset-text.
APPEND ls_valueset TO ls_table-leave_values.
CLEAR ls_valueset.
CONCATENATE 'Rejected' lv_count INTO ls_valueset-value.
CONCATENATE 'Rejected' lv_count INTO ls_valueset-text.
APPEND ls_valueset TO ls_table-leave_values.
CLEAR ls_valueset.
ENDDO.
MODIFY lt_table FROM ls_table INDEX lv_tabix TRANSPORTING leave_status leave_values.
ENDLOOP.
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_interfacecontroller->set_data( r_node_data = lo_nd_value_set ).
**Get the context node information
lr_info = lo_nd_table->get_node_info( ).
lt_node_info = lr_info->get_attributes( ).
LOOP AT lt_node_info INTO ls_node_info.
ls_name-name = ls_node_info-name.
APPEND ls_name TO lt_name.
ENDLOOP.
*Get all the columns to make row editable
CALL METHOD lo_value->if_salv_wd_column_settings~get_columns
RECEIVING
value = lt_columns.
* Make the field dropdown
CALL METHOD lo_value->if_salv_wd_column_settings~get_column
EXPORTING
id = 'LEAVE_STATUS'
RECEIVING
value = lr_column.
* Create Object for dropdown
CREATE OBJECT lr_dropdown
EXPORTING
selected_key_fieldname = 'LEAVE_STATUS'.
CALL METHOD lr_dropdown->set_valueset_fieldname
EXPORTING
value = 'LEAVE_VALUES'.
CALL METHOD lr_dropdown->set_type
EXPORTING
value = if_salv_wd_c_uie_drdn_by_index=>type_key_convert_to_value.
CALL METHOD lr_column->set_cell_editor
EXPORTING
value = lr_dropdown.
*Set the table Editable
lo_value->if_salv_wd_table_settings~set_read_only( value = abap_false ).
lo_nd_table->bind_table( new_items = lt_table ).
Please suggest me where we are going wrong.
Thanks in advance...!!!
Best Regard's,
Shashi KanthHi Shashi,
Your code looks okay. Debug & check if everything goes fine and all the required list of values getting bound to node.
Is any code after this logic, which sets data to table ? if so, that logic is wiping out the drop down list values from context node.
Final check point:
Read the context node 'TABLE' and fetch records into internal table in WDDOMODIFYVIEW( ) method to make sure that, every row of your table contains the drop down list entries in "LEAVE_VALUES" attribute
Hope this helps you.
Regards,
Rama -
Drop Down in ALV ABAP and NOT in OO - ABAP
Hello Everyone....
I m workin on an ALV which is in simple ABAP and not in OO-ABAP. There is some selection criteria on the first screen , as soon as the user fulfills the requirement an ALV GRID is displayed in which the last column is editable.
But the Problem is that i wanna make that editable field in ALV as drop down which would contain values from the database table.
Suggest me some method , so that i dont have to do much changes in my code .
A Sample code will be very benificial .
Thanx n Regards,
Harpreet.Hi Harpreet,
[compiled from sap online help - always a good chice]
To make an input/output field into a list box, you must set the value L or LISTBOX in the Dropdown attribute in the Screen Painter. The visLg attribute determines the output width of the list box and the field. You can assign a function code to a list box field. In this case, the PAI event is triggered as soon as the user chooses a value from the list, and the function code is placed in the SY-UCOMM and OK_CODE fields. If you do not assign a function code, the PAI event must be triggered in the usual way that is, when the user chooses a pushbutton or an element from the GUI status.
If you have assigned a list box to an input/output field, you can use the Value list attribute of the screen element to determine how the value list should be compiled. There are two options:
Value list from input help (recommended)
If you do not enter anything in the value list attribute, the text field uses the first column displayed in the input help assigned to the screen field. The input help can be defined in the ABAP Dictionary, the screen, or a POV dialog module. It should be laid out in two columns. The key is automatically filled.
Value list from PBO modules (not recommended).
If you enter A in the value list attribute, you must fill the value list yourself before the screen is sent (for example, in the PBO event) using the function module VRM_SET_VALUES. When you do this, you must pass an internal table with the type VRM_VALUES to the import parameter VALUES of the function module. VRM_VALUES belongs to the type group VRM. The line type is a structure consisting of the two text fields KEY (length 40) and TEXT (length 80). In the table, you can combine possible user entries from the KEY field with any texts from the TEXT component. You specify the corresponding input/output field in the import parameter ID.
Examples
Example
Dropdown box with a value list from input help (recommended)
*& Report DEMO_DROPDOWN_LIST_BOX *
REPORT demo_dropdown_list_box.
*& Global Declarations *
* Screen Interfaces
TABLES sdyn_conn.
DATA ok_code TYPE sy-ucomm.
* Global data
TYPES: BEGIN OF type_carrid,
carrid type spfli-carrid,
carrname type scarr-carrname,
END OF type_carrid.
DATA itab_carrid TYPE STANDARD TABLE
OF type_carrid WITH HEADER LINE.
*& Processing Blocks called by the Runtime Environment *
* Event Block START-OF-SELECTION
START-OF-SELECTION.
CALL SCREEN 100.
* Dialog Module PBO
MODULE status_0100 OUTPUT.
SET PF-STATUS 'SCREEN_100'.
ENDMODULE.
* Dialog Modules PAI
MODULE cancel INPUT.
LEAVE PROGRAM.
ENDMODULE.
MODULE user_command_0100 INPUT.
CASE ok_code.
WHEN 'SELECTED'.
MESSAGE i888(sabapdocu) WITH sdyn_conn-carrid.
ENDCASE.
ENDMODULE.
* Dialog Module POV
MODULE create_dropdown_box INPUT.
SELECT carrid carrname
FROM scarr
INTO CORRESPONDING FIELDS OF TABLE itab_carrid.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'CARRID'
value_org = 'S'
TABLES
value_tab = itab_carrid
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
ENDIF.
ENDMODULE.
The next screen (statically defined) for screen 100 is 100. The only input field on the screen is the component SDYN_CONN-CARRID. Its Dropdown attribute is set to L, and it has the output length 20. The Value list attribute is empty, and it has the function code SELECTED. The function codes of the buttons EXECUTE and CANCEL. CANCEL are defined in the GUI status as having the function type E.
The screen flow logic is as follows:
PROCESS BEFORE OUTPUT.
MODULE status_0100.
PROCESS AFTER INPUT.
MODULE cancel AT EXIT-COMMAND.
MODULE user_command_0100.
PROCESS ON VALUE-REQUEST.
FIELD sdyn_conn-carrid MODULE create_dropdown_box.
Users cannot enter any values into the screen fields. When they choose the input field on screen 100, the system displays a list box. The Value list attribute is empty, so the system launches the input mechanism. In this case, the event block PROCESS ON VALUE-REQUEST is created in the screen flow logic. This event block controls all other mechanisms. A two-column internal table is filled in the appropriate dialog module and passed to the input help using the F4IF_INT_TABLE_VALUE_REQUEST function module. The system inserts the two columns of the table into the list box.
When the user chooses a line in the list box, the PAI event is triggered using the function code SELECTED and the value in the first column of the internal table is copied to the input field.
Regards,
Clemens -
Check box and Drop down in ALV
Hi all ,
I am using ALV to display my output . I am narrating my question in a example ,
For eg : In my ALV in 1st column i am getting check boxes in all the rows but i want the check boxes oly in specific line no's and in the 3rd column i want to use dropdown list , so user can select some datas from the list , Depend upon the user selection in the drop down list i want to display the values in the 4th column .For every selection in a drop down list
4th column should refresh and give the values . So kindly provide some inputs to finish this task .
Note : I am using set table for 1st display and Function Module LVC_FIELDCATALOG_MERGE .Hi Saravanan.
FOLLOW THIS .
data : gd_layout TYPE lvc_s_layo, "slis_layout_alv,
gd_repid LIKE sy-repid.
TYPES: BEGIN OF TY_ITAB,,
LINE TYPE CHAR10,
CHECK TYPE CHAR1,
.....................................END OF TY_ITAB..
DATA: ITAB TYPE TABLE OF TY_ITAB,
WA TYPE TY_ITAB.
wa_fieldcat-fieldname = 'CHECK'.
wa_fieldcat-scrtext_m = 'CHECK BOX'.
wa_fieldcat-col_pos = 8.
wa_fieldcat-edit = 'X'.
wa_fieldcat-checkbox = 'X'.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
loop at itab into wa.
if wa-line <> 3 or 6 or 7.
ls_stylerow-fieldname = 'CHECK' .
ls_stylerow-style = cl_gui_alv_grid=>mc_style_disabled.
"set field to disabled
APPEND ls_stylerow TO wa-field_style.
MODIFY itAB FROM wa.
ENDIF.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
EXPORTING
i_callback_program = gd_repid
i_callback_user_command = USER_COMMAND
is_layout_lvc = gd_layout " Use this Parameter
it_fieldcat_lvc = it_fieldcat
i_save = 'X'
TABLES
t_outtab = ITAB
EXCEPTIONS
program_error = 1
OTHERS = 2.
REGARDS
MURTHY. -
Hi,
i have a problem to insert value in drop down list in ALV. (I want to use this call function CALLFUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC' or 'REUSE_ALV_GRID_DISPLAY)
How can i insert directly in ABAP 3 value. Example of code you can test this :
report ZCO_AFFACT_TEST.
* type pools
TYPE-POOLS: SLIS.
* declarations for alv and internal tables
DATA: IT_FIELDCAT TYPE LVC_T_FCAT,
WA_FIELDCAT TYPE LVC_S_FCAT,
WA_LAYOUT TYPE LVC_S_LAYO,
V_POSITION TYPE I ,
LS_CELLCOLOR TYPE LVC_S_SCOL,
L_INDEX TYPE SY-TABIX.
DATA: BEGIN OF IT_VBAP OCCURS 0,
VBELN LIKE VBAP-VBELN,
POSNR LIKE VBAP-POSNR,
flag LIKE ztypfac-flag,
CELLCOLOR TYPE LVC_T_SCOL,
END OF IT_VBAP.
* start of selection
start-of-selection .
*---get data from db table
perform get_data .
*---build layout for alv
perform build_layout .
*---build fieldcat for alv
perform build_fieldcat .
*---modify fieldcat for colors in alv
Perform modify_fieldcat .
*---display alv
perform display_alv .
*& Form get_data
FORM get_data .
SELECT VBELN
POSNR
UP TO 25 ROWS
INTO CORRESPONDING FIELDS OF TABLE IT_VBAP
FROM VBAP.
ENDFORM. " get_data
*& Form build_fieldcat
FORM build_fieldcat .
WA_FIELDCAT-FIELDNAME = 'VBELN'.
WA_FIELDCAT-REPTEXT = 'VBELN'.
WA_FIELDCAT-edit = 'X'.
WA_FIELDCAT-drdn_hndl = '1'. "I have had
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-FIELDNAME = 'POSNR'.
WA_FIELDCAT-REPTEXT = 'POSNR'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
WA_FIELDCAT-FIELDNAME = 'FLAG'.
WA_FIELDCAT-REPTEXT = 'FLAG'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
ENDFORM. " build_fieldcat
*& Form build_layout
FORM build_layout .
WA_LAYOUT-CTAB_FNAME = 'CELLCOLOR'.
WA_LAYOUT-ZEBRA = 'X'.
ENDFORM. " build_layout
*& Form modify_fieldcat
FORM modify_fieldcat .
LOOP AT IT_VBAP.
L_INDEX = SY-TABIX.
if l_index = 5 or l_index = 15.
LS_CELLCOLOR-FNAME = 'VBELN'.
LS_CELLCOLOR-COLOR-COL = '6'.
LS_CELLCOLOR-COLOR-INT = '1'.
APPEND LS_CELLCOLOR TO IT_VBAP-CELLCOLOR.
MODIFY IT_VBAP INDEX L_INDEX TRANSPORTING CELLCOLOR.
endif.
if l_index = 10 or l_index = 20.
LS_CELLCOLOR-FNAME = 'VBELN'.
LS_CELLCOLOR-COLOR-COL = '4'.
LS_CELLCOLOR-COLOR-INT = '1'.
APPEND LS_CELLCOLOR TO IT_VBAP-CELLCOLOR.
MODIFY IT_VBAP INDEX L_INDEX TRANSPORTING CELLCOLOR.
endif.
if it_vbap-VBELN is initial .
delete it_vbap.
endif.
ENDLOOP.
ENDFORM. " modify_fieldcat
*& Form display_alv
FORM display_alv .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
IS_LAYOUT_LVC = WA_LAYOUT
IT_FIELDCAT_LVC = IT_FIELDCAT
TABLES
T_OUTTAB = IT_VBAP .
ENDFORM. " display_alv
Thank you for your answers!
Edited by: Emilien P. on Jun 30, 2010 10:42 AMFinaly i have user OO because all the example use the Object...
With my old ALV i have used User command and Hotspot, it is very easy to use.
Now with the OO i have a problem to manage the hot spot and a cell, when i am in mode debug /h when i click on the cell with the hotspot nothing happen !!! I don't undertand what is missing
report ZCO_AFFACT_TEST.
Tables : VBRK, VBRP,ZTYPFAC.
*-- Global data definitions for ALV
*--- ALV Grid instance reference
DATA gr_alvgrid TYPE REF TO cl_gui_alv_grid .
*--- Name of the custom control added on the screen
DATA gc_custom_control_name TYPE scrfname VALUE 'CC_ALV' .
*--- Custom container instance reference
DATA gr_ccontainer TYPE REF TO cl_gui_custom_container .
*--- Field catalog table
DATA gt_fieldcat TYPE lvc_t_fcat .
*--- Layout structure
DATA gs_layout TYPE lvc_s_layo.
types : begin of wls_facture,
... END OF wls_facture.
types : begin of wls_resultat,
... END OF wls_resultat.
data : wlt_facture type TABLE OF wls_facture,
wls_facture type wls_facture,
wlt_final type TABLE OF wls_resultat,
wls_final type wls_resultat.
PERFORM BUILD_DATA.
PERFORM display_alv.
end-of-selection.
call SCREEN 1000.
"display_alv OUTPUT
*& Form display_alv
* text
FORM display_alv .
IF gr_alvgrid IS INITIAL .
*----Creating custom container instance
CREATE OBJECT gr_ccontainer
EXPORTING
container_name = gc_custom_control_name
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
others = 6.
IF sy-subrc <> 0.
*--Exception handling
ENDIF.
*----Creating ALV Grid instance
CREATE OBJECT gr_alvgrid
EXPORTING
i_parent = gr_ccontainer
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
others = 5.
IF sy-subrc <> 0.
*--Exception handling
ENDIF.
*----Preparing field catalog.
PERFORM prepare_field_catalog CHANGING gt_fieldcat .
*----Preparing layout structure
PERFORM prepare_layout CHANGING gs_layout .
PERFORM prepare_drilldown_values.
*----Here will be additional preparations
*--e.g. initial sorting criteria, initial filtering criteria, excluding
*--functions
CALL METHOD gr_alvgrid->set_table_for_first_display
EXPORTING
is_layout = gs_layout
CHANGING
it_outtab = wlt_final
it_fieldcatalog = gt_fieldcat
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4 .
IF sy-subrc <> 0.
*--Exception handling
ENDIF.
ELSE .
CALL METHOD gr_alvgrid->refresh_table_display
EXCEPTIONS
finished = 1
OTHERS = 2 .
ENDIF .
ENDFORM . "display_alv
If anybody have an idea Thanks a lot !
Emilien
Edited by: Emilien P. on Jul 1, 2010 4:21 PM -
Abt Drop Down For ALV Data cells
Hi,
I m unable to create drop down for each cell of ALV table.
Reply me as soon as possible.
Thks.You need to create an object of type CL_SALV_WD_UIE_DROPDOWN_BY_KEY, which is the UI element for dropdown by key, and set that to be your individual cell editor.
For whichever column you want a dropdown box, use the method set_cell_editor to make the editor as a dropdown box. Hope this helps.
Regards
Nithya -
Drop down in ALV for Webdynpro ABAP
Hi Experts,
I was trying to implement one Web dynpro ABAP application that will show one ALV and ALV will content one dropdown so that user can select data from the drop down. Addtion to that, my dropdown should have data based on another column of ALV.
I have followed one article which is available in Net.
At the end of development, ALV is displayed with dropdown. Also dropdown has data binded. However, no data is visible in dropdown.
I have created one context node having four dictionary element and one elemt for dispplaying the dropdown.
In the DoInit method of view, i have written below code:
Data Declaration
DATA:
lo_node_cskt TYPE REF TO if_wd_context_node,
lo_el_cskt TYPE REF TO if_wd_context_element,
ls_cskt TYPE wd_this->element_cskt,
lt_cskt TYPE wd_this->elements_cskt,
lo_cmp_usage TYPE REF TO if_wd_component_usage,
lv_value TYPE REF TO cl_salv_wd_config_table,
lr_column TYPE REF TO cl_salv_wd_column,
lr_drdn TYPE REF TO cl_salv_wd_uie_dropdown_by_idx,
ls_value_set TYPE wdr_context_attr_value,
lv_tabix TYPE sy-tabix,
lv_count(2) TYPE c,
lo_interfacecontroller TYPE REF TO iwci_salv_wd_table.
Navigate from <CONTEXT> to <CSKT> via lead selection:
lo_node_cskt = wd_context->get_child_node( name = wd_this->wdctx_cskt ).
get element via lead selection
lo_el_cskt = lo_node_cskt->get_element( ).
Get Data:
SELECT kokrs kostl datbi ktext FROM cskt INTO CORRESPONDING FIELDS OF TABLE lt_cskt.
lv_count = 0.
Populate value set
LOOP AT lt_cskt INTO ls_cskt.
lv_tabix = sy-tabix.
CLEAR ls_cskt-ktext.
DO 3 TIMES.
lv_count = lv_count + 1.
CONCATENATE 'TEST' lv_count INTO ls_value_set-text.
CONCATENATE 'TEST' lv_count INTO ls_value_set-value.
if lv_tabix = 2.
if sy-index = 2.
EXIT.
endif.
endif.
APPEND ls_value_set TO ls_cskt-valueset.
ENDDO.
MODIFY lt_cskt FROM ls_cskt INDEX lv_tabix TRANSPORTING ktext valueset.
ENDLOOP.
Bind data
lo_node_cskt->bind_table( lt_cskt ).
Instantiate ALV
lo_cmp_usage = wd_this->wd_cpuse_alv( ).
IF lo_cmp_usage->has_active_component( ) IS INITIAL.
lo_cmp_usage->create_component( ).
ENDIF.
lo_interfacecontroller = wd_this->wd_cpifc_alv( ).
Bind Data to Interface Controller Node
lo_interfacecontroller->set_data(
r_node_data = lo_node_cskt
Get ALV reference table
lv_value = lo_interfacecontroller->get_model( ).
Make KTEXT column as drop down
CALL METHOD lv_value->if_salv_wd_column_settings~get_column
EXPORTING
id = 'KTEXT'
RECEIVING
value = lr_column.
Create Object for Drop down
CREATE OBJECT lr_drdn
EXPORTING
selected_key_fieldname = 'KTEXT'.
CALL METHOD lr_drdn->set_valueset_fieldname
EXPORTING
value = 'VALUESET'.
CALL METHOD lr_drdn->set_type
EXPORTING
value = IF_SALV_WD_C_UIE_DRDN_BY_INDEX=>TYPE_KEY_CONVERT_TO_VALUE.
CALL METHOD lr_column->set_cell_editor
EXPORTING
value = lr_drdn.
CALL METHOD lv_value->if_salv_wd_table_settings~set_read_only
EXPORTING
value = abap_false.
I am still finding the answer why data in drop down is not visible. However, I can select by clicking dropdown and blank elements (since data is not visible) can be selected.Hey
i am using the same code except i have just modified little bit the select statement to restrict the number of entries.
and also besides writing the code in wddoinit i have added the compenent usage of alv component and added the node
having the structure ckst and after that deleting the dictionary reference to add the attribute valueset in both places
component controller and view controller and mapped them and mapped the data node of interface controller of comp
usage to this node in comp contrlr.
and adding the view container and embeding table view of alv comp there.
that's it
and here is the code which is almost same as yours except small change in select statement.
method WDDOINIT .
DATA:
lo_node_cskt TYPE REF TO if_wd_context_node,
lo_el_cskt TYPE REF TO if_wd_context_element,
ls_cskt TYPE wd_this->element_cskt,
lt_cskt TYPE wd_this->elements_cskt,
lo_cmp_usage TYPE REF TO if_wd_component_usage,
lv_value TYPE REF TO cl_salv_wd_config_table,
lr_column TYPE REF TO cl_salv_wd_column,
lr_drdn TYPE REF TO cl_salv_wd_uie_dropdown_by_idx,
ls_value_set TYPE wdr_context_attr_value,
lv_tabix TYPE sy-tabix,
lv_count(2) TYPE c,
lo_interfacecontroller TYPE REF TO iwci_salv_wd_table.
* Navigate from <CONTEXT> to <CSKT> via lead selection:
lo_node_cskt = wd_context->get_child_node( name = wd_this->wdctx_cskt ).
* get element via lead selection
lo_el_cskt = lo_node_cskt->get_element( ).
* Get Data:
SELECT kokrs kostl datbi ktext FROM cskt INTO CORRESPONDING FIELDS OF TABLE lt_cskt up to 10 rows .
lv_count = 0.
* Populate value set
LOOP AT lt_cskt INTO ls_cskt.
lv_tabix = sy-tabix.
CLEAR ls_cskt-ktext.
DO 3 TIMES.
lv_count = lv_count + 1.
CONCATENATE 'TEST' lv_count INTO ls_value_set-text.
CONCATENATE 'TEST' lv_count INTO ls_value_set-value.
if lv_tabix = 2.
if sy-index = 2.
EXIT.
endif.
endif.
APPEND ls_value_set TO ls_cskt-valueset.
ENDDO.
MODIFY lt_cskt FROM ls_cskt INDEX lv_tabix TRANSPORTING ktext valueset.
ENDLOOP.
* Bind data
lo_node_cskt->bind_table( lt_cskt ).
* Instantiate ALV
lo_cmp_usage = wd_this->wd_cpuse_alv( ).
IF lo_cmp_usage->has_active_component( ) IS INITIAL.
lo_cmp_usage->create_component( ).
ENDIF.
lo_interfacecontroller = wd_this->wd_cpifc_alv( ).
* Bind Data to Interface Controller Node
lo_interfacecontroller->set_data(
r_node_data = lo_node_cskt
* Get ALV reference table
lv_value = lo_interfacecontroller->get_model( ).
* Make KTEXT column as drop down
CALL METHOD lv_value->if_salv_wd_column_settings~get_column
EXPORTING
id = 'KTEXT'
RECEIVING
value = lr_column.
* Create Object for Drop down
CREATE OBJECT lr_drdn
EXPORTING
selected_key_fieldname = 'KTEXT'.
CALL METHOD lr_drdn->set_valueset_fieldname
EXPORTING
value = 'VALUESET'.
CALL METHOD lr_drdn->set_type
EXPORTING
value = IF_SALV_WD_C_UIE_DRDN_BY_INDEX=>TYPE_KEY_CONVERT_TO_VALUE.
CALL METHOD lr_column->set_cell_editor
EXPORTING
value = lr_drdn.
CALL METHOD lv_value->if_salv_wd_table_settings~set_read_only
EXPORTING
value = abap_false.
endmethod.
thanks
sarbjeet -
Down loading ALV List to local file /print
hi ,
We have a program that displays data on an ALV list. Then, when you click on the 'Print' icon, or try to download to a local file, it gives a short dump with a message 'OBJECTS_NOT_CHARLIKE'.
Any solutions on the same ....
thanksHi,
i hope you have all your data in and internal table.
If this is so use the following code,
*--- Down load the file
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
filename = lv_file
filetype = 'DAT'
TABLES
data_tab = gt_excel1
EXCEPTIONS
file_open_error = 1
file_write_error = 2
invalid_filesize = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
OTHERS = 10.
IF sy-subrc = 0.
MESSAGE i000(zf) WITH text-017.
ELSE.
MESSAGE e939(zf) WITH lv_file. "Errors while downloading.
ENDIF.
Following should be passed,
v_file --> file path with file name (provide filename with '.xls' extension)
gt_excel --> Internal table which has to be downloaded to excel.
thanks
vijay
reward points if helpful. -
It was located just to the right of the backward/forward buttons in the upper left of the screen. This was very convenient and allowed one to go directly to a past screen without having to click on the "back" button repeatedly until there.
If I am right and this has been eliminated, how can I replace FF4 with the previous version?
Thanks!You can get the drop down list by either right-clicking on the back/forward buttons, or holding down the left button until the list appears.
If you want the drop-down arrow you can add it with the Back/forward dropmarker add-on - https://addons.mozilla.org/firefox/addon/backforward-dropmarker -
Drop down like behavior list in a query
I would like to have drop-down list behaviour in a query. I could do it using with a UDF (U_TipoMat) with 2 valid values set in a user table.
DECLARE @TM Float
SET @TM=(SELECT T0.U_TipoMat FROM .[@PARAMETROS] TO WHERE T0.U_TipoMat = )
here it lets me select one of the 2 values stored in these UDF but it does not pass the value to the query
Any ideas?
Edited by: Héctor Ramón Santos Anaya on Mar 13, 2008 1:36 AMHector,
Can I know what is the end result you are trying to achieve.
What are you trying to do with the value in the variable @TM. Where are you planning to use this query?
Also [dbo\].[@PARAMETROS\] TO ...you have use TO instead of T0.
DECLARE @TM Float
SELECT @TM = T0.U_TipoMat FROM [dbo\].[@PARAMETROS\] TO WHERE T0.U_TipoMat = '[%1\]' -
Adding a "blank" selection for drop-down menus under list items.
A lot of people on this form are accidentally selecting items that shouldn't be selected and need to be able to change the drop down menu back to blank if they have made a mistake and selected a wrong drop down item in the wrong area.
Please help,
Thanks!Add an item to your Dropdown list with Blank as text and some value to it.
When you want to rest to blank, just simply set the rawValue to the value against the blank text.
For example if I add a blank text and assign a value "1" to it.
Then in the code I may use like below to rest it to Blank Text.
DropDown1.rawValue ="1";
Thanks
Srini
Maybe you are looking for
-
Sender Mail Adapter - html body mail
Hello Everybody, I'm facing this strange problem: I receive an e-mail with an XML attachment with a sender mail adapter and I use the PayloadSwapBean to let the attachment be the real payload as explaned in this blog <a href="/people/michal.krawczyk2
-
Does the 8GB touch get the OS upgrade if it was sold as 3G?
The way I understand it, the 8GB model of the Ipod touch was unchanged from 2G to 3G. Since the iOS5 page says the upgrade is for 3G Ipod Touch, will my ipod get the upgrade if its 8GB? Or does it count as a 2G? Or am I not understanding something?
-
Upgrading from OS 10.0.4
Hello Everyone! I currently have an iMac 500MHz computer with OS X 10.0.4 and OS 9.22. I just purchased a Jaguar Update 10.3 that claimed that it will install only if OS X is already on your computer. I made the assumption that OS 10.0.4 would qualif
-
I want to convison the mail body 's Content-Transfer-Encoding to base64
Return-Path: <[email protected]> Received: from tobacco ([130.130.160.76]) by webapp.tobacco (Netscape Messaging Server 3.6) with ESMTP id AAA70AC; Tue, 6 Nov 2001 18:26:28 +0800 type: ���� intra@ius_center 1670 subject: ������gggggg�� Content-Type:
-
Error #2032 SAP Netweaver BI Connection
We are experiencing intermittent #2032 connection error in qualty environment. We worked through #2032 error in sandbox and development environment by following existing posts and SAP notes. We configured qualty environment the same but continue to g