cancel
Showing results for 
Search instead for 
Did you mean: 

Personas 3.0 - Unable to change field label with script

shane_kelly2
Participant
0 Kudos

I'm trying to change the name of a field label with the following code:

session.findById("wnd[0]/usr/subSCREEN:SAPLWB2A:*/subGENERAL_SUB:SAPLWB2A:0104/txtKOMWBHD-SUPERFIELD_NAME").text = 'Supplier';

but I get the following error:

A running Personas script could have caused this error. Please check your active scripts.

Received "failed to set value: readonly" on batch step: {"post":"value/wnd[0]/usr/subSCREEN:SAPLWB2A:*/subGENERAL_SUB:SAPLWB2A:0104/txtKOMWBHD-SUPERFIELD_NAME","content":"Supplier","__added_by_personas_scripting__":"X"}

The complete batch was:
[{"post":"vkey/0/ses[0]","__added_by_personas_scripting__":"X"},{"post":"value/wnd[0]/usr/subSCREEN:SAPLWB2A:*/subGENERAL_SUB:SAPLWB2A:0104/txtKOMWBHD-SUPERFIELD_NAME","content":"Supplier","__added_by_personas_scripting__":"X"},{"get":"state/ur/","__added_by_personas_scripting__":"X"}]

Accepted Solutions (0)

Answers (1)

Answers (1)

clemens_gantert
Active Participant
0 Kudos

Hello Shane,

there are two things going on. First, the field your looking at is acutally a disabled input field and not a label. You can see this by the "txt" id prefix, a label would be "lbl". Now, in your script you're trying to change the value of a disabled standard text field and the ABAP backend does not like that. Note that you cannot simply enable a backend-disabled standard input field via scripting and then change the text. Instead, you might want to hide this standard field and replace it with a custom label (or disabled input field if you prefer) and then change the text of this custom field through scripting.

Best Regards,

Clemens