cancel
Showing results for 
Search instead for 
Did you mean: 

SAP GUI script recording using different spellings for the same field

Why is SAP GUI script recording using different spellings for the same field?

e.g.

session.findById("wnd[0]/usr/ctxt$8A-YEAR").text

session.findById("wnd[0]/usr/ctxt[1]").text

And how to influence it?

thanks

Marco

Accepted Solutions (1)

Accepted Solutions (1)

stefan_schnell
Active Contributor

Hello Marco,

last night I thought about your problem and I had an idea which I tested this morning: There is an option "Low Speed Connection" at the network properties in the SAP logon. If it is enable you don't get the field names, only an enumeration.

In SAP note 161053 we find the reason: As of SAP GUI 4.6D, the "Low Speed Connection" function was changed in such a way that the system no longer transfers screen field names either because this is too resource-intensive in the LSC environment.

In my case this option is always disabled, so it is no wonder that it works differently as in your case. If it is possible for you, disable that, because to work with the dynpro fieldnames is better. On this way the script identifies the object definitely with its name, not with the position. If the position was changed, your script don't work anymore or not correctly, but with the name is the position all the same.

Let us know your results.

Cheers
Stefan

Answers (8)

Answers (8)

0 Kudos

Hello Stefan,

yes, you are right. This Network Seeting is excatly the switch that steers the Syntax of the code in SAP Logon 730. Now I can handle the different codes much better. Great help!

Thanks

Marco

0 Kudos

Hello Stefan,

probably there is a relation between the scripting Syntax and the SAP GUI Version. My colleagues have SAP GUI Version 730 and I have got SAP GUI Version 740. Does the GUI Version influence the Spelling and Syntax of a script recording?

br

Marco

0 Kudos

Hello Stefan,

I use here transaction KE5Z "profit center actual line items". But the described different spellings occur in all transactions, in standard as well as in custom transactions.

thanks

Marco

stefan_schnell
Active Contributor
0 Kudos

Hello Marco,

the example use a custom transaction code YSLOFLOCAL. What transaction code do you use? Is it a standard or also a custom?

Cheers
Stefan

0 Kudos

please find attached another internet site example, where also other people show spelling like

session.findById("wnd[0]/usr/ctxt[1]").text

example-field-id-with-number.jpg

0 Kudos

Hello Stefan,

I have checked with other SAP users in the same System ID, who don't use scripts as often as I do. In their SAP Login they record and playback still with the old spelling, e.g.

session.findById("wnd[0]/usr/ctxt[1]").text

Could you please check again?

Kind regards

Marco

0 Kudos

Hello Stefan,

I recorded entries in the same field in a selection screen of a report with "script recording & playback" at two different point of times.

At the first point of time the Recorder wrote:

session.findById("wnd[0]/usr/ctxt[1]").text.

A few weeks later the Recorder wrote, while doing exactly the same as before:

session.findById("wnd[0]/usr/ctxt$8A-YEAR").text.

If I try to run the older scripts with the first spelling, then they don't run anymore. Only if I record a new script with the second spelling, it runs well again. But I would like have that under control. Is there an individual Setting, that might have changed?

stefan_schnell
Active Contributor
0 Kudos

Hello Marco,

in your example is $8A-YEAR the fieldname from the dynpro. If you have an enumeration like [1] it means that there are a few objects of the same type on the same level, e.g. like tbar[0] and tbar[1] on /app/con[0]/ses[0]/wnd[0]. In your example it seems that there are a few combo boxes (ctxt) on the same level. I have never seen an enumeration on this kind of object. I tried it and I got an error message that wnd[0]/usr/ctxt[1] is not an existing ID. As far as I know you have no influence from SAP GUI Scripting to the fieldnames or the enumerations of the objects.

Cheers
Stefan

0 Kudos

could you please regard my Responses below?