$(function () { pageContext.i18n.modTalk = 'moderation talk'; pageContext.i18n.replyToComment = 'Reply'; pageContext.i18n.modTalkEmpty = 'moderation talk is empty'; pageContext.url.getModTalk = "/comments/%25ID%25/listModTalk.json"; pageContext.url.possibleCommentRecipients = "/comments/%ID%/possibleRecipients.json"; pageContext.url.commentEdit = '/comments/%25ID%25/edit.html'; pageContext.url.commentView = '/comments/%ID%/view.html'; pageContext.i18n.commentVisibility = { 'full': 'Viewable by all users', 'op': 'Viewable by the original poster', 'mod': 'Viewable by moderators', 'opAndMod': 'Viewable by moderators and the original poster', 'other': 'Advanced visibility', 'dialogTitle': 'Comment visibility', 'selectGroups': 'Visible to groups', 'selectOther': 'Other recipients', 'selectOriginalPoster': 'Original poster', 'selectModerators': 'Moderators', 'selectAssignees': 'Asked to answer users' }; pageContext.i18n.commentMenuLabels = { 'comment-edit': 'comments.menu.edit', 'comment-delete': 'comments.menu.delete', 'comment-convert': 'comments.menu.convert' };pageContext.i18n.answer= { bestAnswer: 'Best Answer', controlBar : { accept: 'Accept', unaccept: 'Unaccept', acceptCommand: 'Accept this answer as correct', cancelAcceptedCommand: 'Remove this answers accepted status' } }; window.croles = { u: false, op: false, m: false, og: false, as: false, ag: false, dc: false, doc: false, eo: false, ea: false }; tools.init({ q: { e: false, ew: false, eo: false, r: false, ro: false, d: false, dow: false, fv: false, c: false, co: false, p: false, tm: false , ms: false, mos: false }, n: { f: false, vf: false, vfo: false, vr: false, vro: false, c: false, co: false, vu: false, vd: false, w: false, wo: false, l: false }, c: { e: false, eo: false, d: false, dow: false, ta: false, tao: false, l: false }, a: { e: false, ew: false, eo: false, d: false, dow: false, a: false, aoq: false, ao: false, tc: false, tco: false, p: false, tm: false }, pc: croles }, { tc: true, nsc: true }); commandUtils.initializeLabels(); }); Skip to Content

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

9 Answers

  • Best Answer
    Nov 16, 2016 at 06:18 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 08, 2016 at 07:58 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 08, 2016 at 02:40 PM

    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?

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 10, 2016 at 11:59 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 10, 2016 at 01:17 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 11, 2016 at 06:15 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 13, 2016 at 08:30 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 15, 2016 at 02:26 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 18, 2016 at 10:53 AM

    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

    Add comment
    10|10000 characters needed characters exceeded