cancel
Showing results for 
Search instead for 
Did you mean: 

How to make an alv column required

Former Member
0 Kudos

Hello all,

Is there any way to make a column in an alv table required?

Thanks,

raymond

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Raymond,

In layout, You just Rightclick on the Table and select Insert Column and then Select TableCellEditor for the Column U just created.

Regards

Sarvanan K

Former Member
0 Kudos

Hello Sarvanan,

I think I did not explain myself correctly.

The alv table is a ViewContainerUiElement with an alv attached to it. Also, I need to set the 'required' setting dynamically. Doi you know if there is a method to do this.

Thanks,

Raymond

Former Member
0 Kudos

Hi Raymond,

You can set the Stateproperty of the Inputfield or anything in cellEditor.

Regards

Saravanan K

Former Member
0 Kudos

Hi Saravanan,

I tried your suggestion and at first I thought it should work as I als had used that solution to make fields read only or editable.

However, when I use 'SET_STATE_FIELDNAME' and fill the fields with value '00' or '01' nothing happens.

The technique works fine with 'SET_READ_ONLY_FIELDNAME'.

Any suggestion?

Regards,

Raymond

thomas_szcs
Active Contributor
0 Kudos

Hi Raymond,

Just as a quick additional note, it is better to use the constants provided for state enum instead of using values like 00 or 01 directly. The constants are CL_WD_INPUT_FIELD=>E_STATE-REQUIRED and CL_WD_INPUT_FIELD=>E_STATE-NORMAL. Of course, if you have already a pointer to that input field just write i.e. my_input_field_pointer->e_state-required.

Best regards,

Thomas

Former Member
0 Kudos

Hi Thomas,

Thanks for your advice. I have changed the constants now.

Can you tell me what required fields in an ALV look like.

You see, I have done the coding and debugged to check the values but I cannot see any changes that would indicate that the field is now required.

Please let me know.

Regards,

Raymond

thomas_szcs
Active Contributor
0 Kudos

Hi Raymond,

There should be a red asterix (*) next to the text of the header of the column.

Best regards,

Thomas

Former Member
0 Kudos

Thank,

I solved the problem by using 'SET_STATE' instead of the 'SET_STATE_FIELDNAME' variant. This method does work.

Regards,

Raymond

Answers (0)