cancel
Showing results for 
Search instead for 
Did you mean: 

Set 1 row in an assignment block to read-only

nisha_vinod
Advisor
Advisor
0 Kudos

Hello Experts,

I have the following requirement for an Assignment Block :

-------------------------------------
A       AA
B       BB
C      CC
D      DD
E      EE
-----------------------------------
T1    T2
-----------------------------------

Here the last rows indicate sum of the column values and it need to be read-only field but it should be sets with the column sum.

Any suggestions as to how to achieve this requirement?

Regards

Nisha

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Nisha,

Depending on whether tablview is model/value node and when should the sum be calculated - you can write in do_init_context or do_prepare_output or on event handler of some button (if it's on button click).

Looping on the collection wrapper - create one more entity when you reach last row of collection - keep adding sum to a variable, create new entity in last, set attribute of the entity column with the sum and add it to collection.

Also, to make only last row editable - you can either implement iterator and write code to enable/disable in IF_HTMLB_TABLEVIEW_ITERATOR~GET_COLUMN_DEFINITIONS method of iterator class or write code in GET_I method to make the field disabled if the column name of tableview is 'SUM' or whatever name has been fixed for it.

Thanks,

Rohit

Former Member
0 Kudos

try to set a debug point in get_i method of the attribute.

The sum should be calculated when you do an action. On action you can set a value of a global parameter and read that parameter in get_i method and return the value as false.

Regards

Sohit