on 04-29-2009 3:06 PM
Wihin one column is it possible to have some cell as input fields, some as text view ?
regards
Yes, you have mutliple Cell Editors and control which cell editor is active based upon an attribute binding.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well first of all if you just want to switch between input enabled input field and one that isn't input enabled, I would suggest going an easier route and just binding to the readOnly property. Why actually switch between InputField and TextView.
However it is possible to switch between different UI elements at the cell level. You have to create more than one cell variant for a column. Look at the help for the tableColumn property selectedCellVariant:
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/85/48a841c1dae034e10000000a1550b0/frameset.htm
You data binding the selectedCellVariant to a context attribute and the value in this attribute controls which of the column cell variants will be used for that particular value.
Here is also the help for the TableStandardCell (the UI element child of the Table Column you create to make alternative cell variants):
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/56/5e9041d3c72e7be10000000a1550b0/frameset.htm
Hey!
Yes,you can use input field,text view ,link,checkbox or button and so on in column of the same alv gird.
Sample of code:
DATA: LR_CMP_USAGE TYPE REF TO IF_WD_COMPONENT_USAGE,
LR_INTERFACECONTROLLER TYPE REF TO IWCI_SALV_WD_TABLE,
LR_CONFIG_TABLE TYPE REF TO CL_SALV_WD_CONFIG_TABLE,
LR_SALV_SETTINGS TYPE REF TO IF_SALV_WD_TABLE_SETTINGS,
LR_COLUMN TYPE REF TO CL_SALV_WD_COLUMN,
LR_INPUTFIELD TYPE REF TO CL_SALV_WD_UIE_INPUT_FIELD,
LR_TEXTVIEW TYPE REF TO CL_SALV_WD_UIE_TEXT_VIEW.
LR_CMP_USAGE = WD_THIS->WD_CPUSE_ALV_GRID( ).
IF LR_CMP_USAGE->HAS_ACTIVE_COMPONENT( ) IS INITIAL.
LR_CMP_USAGE->CREATE_COMPONENT( ).
ENDIF.
LR_INTERFACECONTROLLER = WD_THIS->WD_CPIFC_ALV_GRID( ).
LR_CONFIG_TABLE = LR_INTERFACECONTROLLER->GET_MODEL( ).
LR_SALV_SETTINGS ?= LR_CONFIG_TABLE.
CALL METHOD LR_SALV_SETTINGS->SET_READ_ONLY
EXPORTING
VALUE = ABAP_FALSE.
LR_COLUMN = LR_CONFIG_TABLE->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( 'LUGGWEIGHT' ).
CREATE OBJECT LR_INPUTFIELD
EXPORTING
VALUE_FIELDNAME = 'LUGGWEIGHT'.
CALL METHOD LR_INPUTFIELD->SET_READ_ONLY
EXPORTING
VALUE = ABAP_FALSE.
CALL METHOD LR_INPUTFIELD->SET_ALIGNMENT
EXPORTING
value = CL_WD_ABSTRACT_INPUT_FIELD=>E_ALIGNMENT-CENTER.
CALL METHOD LR_COLUMN->SET_CELL_EDITOR
EXPORTING
VALUE = LR_INPUTFIELD.
LR_COLUMN = LR_CONFIG_TABLE->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( 'SMOKER' ).
CREATE OBJECT LR_TEXTVIEW.
CALL METHOD LR_TEXTVIEW->SET_TEXT_FIELDNAME
EXPORTING
VALUE = 'SMOKER'.
CALL METHOD LR_TEXTVIEW->SET_DESIGN
EXPORTING
VALUE = CL_WD_TEXT_VIEW=>E_DESIGN-EMPHASIZED.
CALL METHOD LR_TEXTVIEW->SET_SEMANTIC_COLOR
EXPORTING
VALUE = CL_WD_TEXT_VIEW=>E_SEMANTIC_COLOR-NEGATIVE.
CALL METHOD LR_COLUMN->SET_CELL_EDITOR
EXPORTING
VALUE = LR_TEXTVIEW.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Stephan,
here is a document explains how make columns editable
Regards,
Abdul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.