cancel
Showing results for 
Search instead for 
Did you mean: 

Make Readonly Inputfield mandatory

Former Member
0 Kudos

Hi,

How to make read only input-field mandatory?

I tried using link but it is not working when inputField is ReadOnly?

Any help?

thanks,

Prashant

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Prashant,

Quite strange requirement.. Making readonly field mandatory..

I think you need to manually check the value of bind context attribute and display the message in case it is empty.

Regards,

Vikram

Former Member
0 Kudos

Hi Vikram,

Thanks for your reply.

I have checked the value of context attribute assigned to the 'COST_ASSIGNMENT' input field. If that field is empty then I have raised the error using following code:

 
Data :  lv_cost_assign              type string,
           lr_api_controller             TYPE REF TO if_wd_controller,
           lr_message_manager    TYPE REF TO if_wd_message_manager.

  If lv_cost_assign EQ ''.

    lr_api_controller ?= wd_this->wd_get_api( ).
    lr_message_manager = lr_api_controller->get_message_manager( ).

    lr_message_manager->REPORT_ATTRIBUTE_ERROR_MESSAGE(
            message_text    = 'Enter WBS Element.'
            element         = lo_el_general_data_addon
            attribute_name  = 'COST_ASSIGNMENT' ). 
 endif.

Answers (1)

Answers (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

I agree that this is a strange requirement. Why produce an error message if there is nothing that the user can do to respond to the situation. Mandatory checks on read only fields seems like a way to torture your end users.

Former Member
0 Kudos

Hi Thomas,

This read only field takes the value from some other web dynpro component. Besides this read only field, there is one button, when user clicks on that button, new web dynpro component is open as pop-in and data is formulated and then assigned to the read only input field.

Reference:

Read only field : 'Cost Assignment'

Button : 'change Cost Assignment'.

Web Dynpro Component : FITE_VC_GENERAL_DATA

Thanks,

Prashant