cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with Cell Variants

anand_nidamanuru
Active Participant
0 Kudos

Hi All,

We have a scenario in which we have to change the cell editor of a column (Requester_ID) based on the value of another column (Request_type). The column Request_type can have 4 different values.

The requirement is to make the column REQUESTER_ID editable, if the value of REQUEST_TYPE is anything other than '4'. when it is '4', REQUESTER_ID has to be non editable.

We created a cell editor of type input field for the column REQUESTER_ID. Then we created a cell variant of type text view for this field. The cell variant key is set to '4' and the field name is set to REQUEST_TYPE.

But this approach gives a dump when there is any value other than '4' in REQUEST_TYPE. It is not taking the default cell editor as input field for other values 1,2,3.

Do we have to create a cell variant for each possible value, or is there any other approach.

If there is no other way, we are thinking of creating a new field, with only two values. One indicating REQUEST_TYPE as 4, otherwise initial.

This is very urgent requirement. Any help in this regard will be great.

Also please provide the reference/help for cell variants. I am not able to find one in help.sap.com.

Thanks,

Anand

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Anand,

You can create two cell variants, one as TextView, one as InputField. You could also use only the InputField and set enabled = false when the value is '4'.

Here's the [documentation|http://help.sap.com/saphelp_nw70/helpdata/en/56/5e9041d3c72e7be10000000a1550b0/frameset.htm] for the same.

Regards,

Neha

anand_nidamanuru
Active Participant
0 Kudos

Hi Neha,

Thanks for your reply.

I have created one cell variant with editor text view, key value '4' and variant field as 'REQUEST_TYPE'.

The default cell editor of the column is input field.

But this approach gives me dump when the value of REQUEST_TYPE is anything other than '4'.

I checked the dump and the reason being that the runtimes checks for a variant for each value. As we dont have any other variant for value other than 4, it is giving me dump.

For setting the enabled flag of input field, do I have to use SET_ENABLED_FIELDNAME? if I have used this how to mention the key name? i.e. how to make it disable only when the value is '4'.

Please let me know.

Thanks,

Anand

Former Member
0 Kudos

Hi Anand,

Firstly, I am not sure why you are getting the dump. Are you clearing the value for selectedCellVariant correctly?

Secondly, you need not call any method for enabling/disabling the input field. You can simply bind this property to an attribute in your context and set the value of the attribute to 'X' or SPACE depending on your conditions.

Hope this helps.

Regards,

Neha