cancel
Showing results for 
Search instead for 
Did you mean: 

Check to determine if field is modifiable/editable?

0 Kudos

On the offchance that anyone knows this, i'm having a bit of an issue figuring out how to make my script determine if an SAP field is editable or if it is locked for editing.  The fieldname is constant with a coordinate value (which i'm accounting for in the script)

session.findById("wnd[0]/usr/tblSAPLCOMKTCTRL_0120/ctxtRESBD-CHARG[14,0]")

But either i've forgotten how to make this thing determine editable non-editable... as shown below, item 0035 can be edited.  Item 0010 phantom component is locked.

Accepted Solutions (1)

Accepted Solutions (1)

holger_khn
Contributor
0 Kudos

Hello.

When i Consider session.findById("wnd[0]/usr/tblSAPLCOMKTCTRL_0120/ctxtRESBD-CHARG[14,0]") as field-identifier for check it  should look like:


If session.findById("wnd[0]/usr/tblSAPLCOMKTCTRL_0120/ctxtRESBD-CHARG[14,0]").Changeable Then session.findById("wnd[0]/usr/tblSAPLCOMKTCTRL_0120/ctxtRESBD-CHARG[14,0]").Text = "NewValue"

Best regards

Holger

former_member611353
Discoverer
0 Kudos

Hi Holger,
I have used the changeable property in similar case, but it returns incorrect value. But it does not correspond to real state. For reading I used following code where reading the state and writing to excel sheet:
...

For f = 0 To visiblerows - 1

For g = 0 To tDataColumns - 1

...

changeable_1 = tTableID.getcell(f, g).changeable

myVariable = tTableID.getcell(f, g).Text

......

ActiveSheet.Cells(h + 13, e).Value = myVariable & "|" & f & "|" & g & "-" & changeable_1

....

next g
next f

But even every second "Batch" cell is unchangeable:

I get for differences in excel when reading the cells :

But for some cells it works. It's driving me crazy already second day. If you can help, I would be grateful.
Michal

Answers (1)

Answers (1)

0 Kudos

Thank you Holger.  I was banging my head against my monitor trying to figure that out.  Did not realize i could use .CHANGEABLE as a suffix.

Just out of curiosity... there isn't a listing anywhere that details this kind of field identification suffix somewhere, is there?  I never would have thought of changeable.

holger_khn
Contributor
0 Kudos

Hello.

There are a lot of interesting Information in SAP GUI Scripting Help Manual

Hope this helps

Holger