Skip to Content
0

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

Mar 01 at 10:34 AM

41

avatar image

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?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Kumar Rituraj Mar 02 at 12:22 PM
0

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



Show 3 Share
10 |10000 characters needed characters left characters exceeded

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

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.

0

Glad that you solved it !

0
Kumar Rituraj Mar 05 at 05:23 PM
0

Hi Tejas,

In such case I can suggest two approach :-

1. On EH_ONSAVE of srqm_incident_h , check value of custom field is 3. if it is 3 use abap_memory concept and register some value.Now your get_I is a roundtrip method which will be called on each action.In Get_I read value set in eh_onsave using ABAP_memory and thus you can disable the field.

2. Else read about do_finish_input, it might help.

Do let me know if you happen to solve the issue.

Regards

Rituraj

Share
10 |10000 characters needed characters left characters exceeded