cancel
Showing results for 
Search instead for 
Did you mean: 

how to make a field non editable

Former Member
0 Kudos

Hi all,

I want to make some fields non editable.Even though i didnt use the editable mode = 'X' it is editable.How can i make it non editable.

Thanks,

Ranjith.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Ranjith,

If you want to make only somefields editable in the tableview ,then you have to create the iterator class.

Please check this blog:

/people/brian.mckellar/blog/2003/10/31/bsp-programming-htmlb-tableview-iterator

You need to create the iterator class in SE24,

1. You need to make IF_HTMLB_TABLEVIEW_ITERATOR as interface for this class. Once you save it you should see the 3 methods in your class.

2. Now you re-define the methods of the class - in the change mode there is a button for redefining the method. Place your cusor on the method and click the re-define button.

4. You need to use GET_COULUMN_DEFINITIONS method to

define what columns you want to dispaly in the table view

the required columns needs to be populated in the table of type TABLEVIEWCONTROL (look at the structure to uderstand what needs to be done)

5. You use RENDER_ROW_START method to get the data for the current row of the table.

6. You use RENDER_CELL_START for accessing each cell with in your table view. This is the most important method which will allow you to change the cell rendering during runtime.

7. Once you have done all of this activate your class. Declare a page attribute type ref to this iterator class you created.[r_iterator TYPE REF TO MY_ITERATOR ]

8. create a instance of this iterator in OnCreate [CREATE OBJECT ITERTOR] and use this in your table view attributes.

<htmlb:tableView id = "myTableView"

visibleRowCount = "<%= count %>"

width = "<%= width%>"

selectionMode = "SINGLESELECT"

selectedRowIndex = "<%= var_selectedindex %>"

table = "<%= itab %>"

iterator = "<%= r_iterator %>"

</htmlb:tableView>

regards,

Bhanu.

Former Member
0 Kudos

Hi Ranjith,

Use the foll code in OnLayout,


    <htmlb:inputField     id        = "ip1"
                                type       = "BCD"
                              disabled="TRUE"
        />

Rgds,

Jothi.P

  • let me know the outcome.

Former Member
0 Kudos

hi jyothi,

its actually a coloumn in the table view.In that the editable parameter is not set,still its an editable field.

Thanks,

Ranjith.

Former Member
0 Kudos

Hello Ranjith,

Check the standrd BSP Appln bc/bsp/sap/<b>sbspext_htmlb</b>/default.htm

By default all the column in the tableview will be non editable.If yu want to achieve tablecolumn editable, use iterator as described in the standard appln.

Rgds,

Jothi.P

<i><u>

    • Reward pts for useful answers..</u></i>