cancel
Showing results for 
Search instead for 
Did you mean: 

INPUTFIELD IN ALV TABLE

Former Member
0 Kudos

Hi experts,

I am working on webdynpro abap, i am working with ALV TABLE,in this alv one column should be inputfield (ui). please give good reference.

waiting for reply.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi krishna ,

You can do it easily. The above mentioned referrence are enough to make you understand that in alv if you want to make any field editable than you have to make it as input field.

I am giving you some sample scenario :-

In your coding

1. Instantiate your alv component. (by using create component )

2. Use set data to display the requiered node in alv.

3.In your alv component use method get model

4. If you want to make one full column as a input field than you have to do it uising colulmn referrence like below:-

DATA: LR_COLUMN TYPE REF TO CL_SALV_WD_COLUMN.

DATA: LR_COLUMN_SETTINGS TYPE REF TO IF_SALV_WD_COLUMN_SETTINGS. " to do any change in alv column

DATA: LR_TABLE_SETTINGS TYPE REF TO IF_SALV_WD_TABLE_SETTINGS.

DATA LT_COLUMNS TYPE SALV_WD_T_COLUMN_REF.

DATA LS_COLUMN TYPE SALV_WD_S_COLUMN_REF.

DATA LR_INPUT_FIELD TYPE REF TO CL_SALV_WD_UIE_INPUT_FIELD.

  • configure columns

LR_COLUMN_SETTINGS ?= LV_VALUE.

LT_COLUMNS = LR_COLUMN_SETTINGS->GET_COLUMNS( ).

In your LT_COLUMN you will get instance of all the field of your context node.

now create a loop and use case statement to implement various thing according to your requierment like input field, check box etc.

->

LOOP AT LT_COLUMNS INTO LS_COLUMN . "

CASE LS_COLUMN-ID .

WHEN ' FIELD_NAME '. " this is my requiered field for input field

CREATE OBJECT LR_INPUT_FIELD EXPORTING VALUE_FIELDNAME = LS_COLUMN-ID .

LR_COLUMN = LV_VALUE->IF_SALV_WD_COLUMN_SETTINGS~GET_COLUMN( ID = LS_COLUMN-ID ).

LR_COLUMN->SET_CELL_EDITOR( LR_INPUT_FIELD ).

ENDCASE.

ENDLOOP.

*set read only mode to false (and display edit toolbar)

LR_TABLE_SETTINGS ?= LV_VALUE.

LR_TABLE_SETTINGS->SET_READ_ONLY( ABAP_FALSE ).

Thanks & Regards,

Monishankar C

sahai
Contributor
0 Kudos

hi,

1) add table ui element in the layout.

2) right click on the table ui element and then add table column to it.

3) right click on the table column and add cell editor as input field.

so this particular column will have input field .

hope this may help you in solving your problem

thanks and regards,

sahai.s

Former Member
0 Kudos

hi,

see this wiki [https://wiki.sdn.sap.com/wiki/display/WDABAP/SAPListViewer-ALV|https://wiki.sdn.sap.com/wiki/display/WDABAP/SAPListViewer-ALV]

see also this thread [|]

Basically you need to create a inputfield of type as below.

Get the alv column and bind the cell_editor property to inputfield.

gill367
Active Contributor
0 Kudos

HI

use the following link ..

[editing ALV |http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3133474a-0801-0010-d692-81827814a5a1]

thanks

sarbjeet