cancel
Showing results for 
Search instead for 
Did you mean: 

Make a field read-only when you click on SAVE button in WEBUI

0 Kudos
518

Hi,

I have an attribute ZZINV_25 in context node BTAdminH of component BTCATEGORIES.

I have to make this field read-only when I click on Save Button . The method EHONSAVE is present in a different Component SRQM_INCIDENT_H .

Initially I changed the field to read-only in GET_I method but the requirement is that this field should be made read-only when the user clicks on SAVE button.

I want to use an object of interface if_genil_obj_attr_properties in order to change the attribute property to read-only , but I am unable to use it .

Is there any alternate solution available?

View Entire Topic
kumar_rituraj
Active Participant
0 Kudos

Hi Tejas,

Please check my understanding of your question is correct as below : -

When you create a transaction your custom field should be in editable and after you save your transaction from that moment onwards this custom field should be a non-editable field. Even if user edit that transaction further that custom field should be in edit mode.

If this understanding is correct , please try reading transaction id in Get_I Method, this will only be available when transaction is created. If you see a transaction id make that filed as disabled. You can read transaction id by using get_parent method.

Please let me know if this works or else we will try to see alternate approach.

Regards

Rituraj



0 Kudos

Hi Rituraj ,

The field ZZINV_25 is a drop down field (having possible values 1 or 2 or 3) , this field should be in edit mode for values 1 and 2 .

But when the value in this field will be 3 , this field should become a read-only field after the user clicks on SAVE button .

I tried implementing my logic in the GET_I method , the problem with this is that as soon as I click on drop down value 3 , this field becomes read only field . If the user selects value 3 by mistake , then he wont be able to change the value again if the logic is written in GET_I method .

I want to make this field read-only only when the value in this field is 3 and user has clicked on save button so that next time when the ticket is opened this field should be a read - only field.

0 Kudos

Hi Rituraj ,

Its working as expected using the ABAP_MEMORY concept .

In EH_ONSAVE I updated a local variable value and using abap_memory concept , I accessed the value this variable in GET_I method of ZZINV_25 and then made the field read-only.

I was also able to implement it by creating a global static variable in Genil class of EH_ONSAVE event .

In EH_ONSAVE I updated this global variable and in GET_I method of field ZZINV_25 , I accessed this value based on which I made the field read-only .

However using abap memory concept is more efficient than the second approach.

Thank-you.

kumar_rituraj
Active Participant
0 Kudos

Glad that you solved it !