cancel
Showing results for 
Search instead for 
Did you mean: 

How to make input field to read only dynamically in Interactive form in ABA

Former Member
0 Kudos

Hi,

How to make input field to read only dynamically in Interactive form in ABAP.

In the interactive form, based on the customer number I am populating customer details in the respective fields.During the validation, if the customer number entered by the user is valid, then I need to make the customer fied(input field) is read only.Please anybody know how to do it ABAP?.

Thanks,

John.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

hI John,

When a user submits the customer number, say by click of a button, after validation you can make the input field READ only by Javascript in the Designer.

If we have a subform, form2 in which we have an input field TextField1 whose value is "User Entered", initially, can be set to Read Only after validation by using the java script as

form2.TextField1.access = "readOnly" ;

Hope This helps,

Regards,

Siddhartha

Former Member
0 Kudos

Hi Siddharta,

Thanks for your reply. I am doing validation using ABAP. But to make it read only should I use Javascript, Will it work?. Anyway I am working on it and I will let you know.

Former Member
0 Kudos

Hi Siddharta,

I tried, it is not working if I click the button at first time, If I click the same button twice or thrice, it is working.

Former Member
0 Kudos

Hi Guys,

Please help me on this.

Former Member
0 Kudos

HI John,

you can do validation at two levels, at the client side, in the Interactive form using Form calc or javascript, or at the server side, using ABAP.

You can do validations as you are doing using ABAP, after that set the value of some context attribute, and use it in the form in the javascript to make the form input field read only.

In the click of the SUBMIT button on the form, you can do the validations and also write some Script in the form which can set the Field read only,

if there is a text field TextField1 in your form, and you have a context attribute in your data,select the button in the form and then in your events for scripts,select Click, select Language as Javascript(not FormCalc) and Run At Client and put the script as:

form1.TextField1.access = dataSource.access.rawValue ;

OR

form1.TextField1.access = "readOnly" ;

Hope This helps,

Regards,

Siddhartha

Former Member
0 Kudos

Thanks for your reply. It is not working.

If you guys have any other solution please.

Former Member
0 Kudos

Tried written the following code in the Sumbit Button's Calculate Event, it works fine

form1.Textfield1.access = "readOnly"