Robotic Process Automation (RPA)

 View Only
  • 1.  How to Get Value from SAP GUI Status Bar?

    Posted Sun January 01, 2023 02:58 AM
    Hello guys,

    I tried to use command Get Value to get the result from SAP GUI Status bar like below screenshot. But when I used the XPath or id as selector both were not work. Can anyone tell me how to get the sap status bar value ? Thank you.









    ------------------------------
    傑仁 柯
    ------------------------------


  • 2.  RE: How to Get Value from SAP GUI Status Bar?

    Posted Mon January 02, 2023 09:00 PM
    The status bar can befoundbyID

    ------------------------------
    Yan Hai Zhao
    ------------------------------



  • 3.  RE: How to Get Value from SAP GUI Status Bar?

    Posted Tue January 03, 2023 01:34 AM
    I have try selector by id , but still not work.



    ------------------------------
    傑仁 柯
    ------------------------------



  • 4.  RE: How to Get Value from SAP GUI Status Bar?

    Posted Tue January 03, 2023 03:25 AM
    Hi!

    I faced the same problem, the workaround I use is as follows:
    - Is the statusbar wisible (wnd[0]/sbar) ?
       - If yes, click on it.
       - After the click, if the statusbar is empty, nothing will happen, otherwise a new window should appear named "Performance Assistant"
       - If this window appeared, you can see items on it with XPath values /root/pane[1]/pane[1]/pane[1]/pane[1]/pane[1]/pane[1]/pane[1]/pane[1]/pane[1]/pane[1]/pane[1]/text[${index}] (where ${index} can be any number from 1 to let's say 12. I only use the 2 last ones, so if there are 6 items, then I use the 5th and 6th. On the screen these are the first 2 messages, they appeares in backward order.
       - So I get these 2 last items value, and these are my status bar messages.

    Also, for the "Performance Assistant" window, you need to go into the setup, to tell the SAP, you want these statusbar messages in the "Performance Assistant" window.

    - To close the "Performance Assistant" window, send an Esc or F3 key.

    Hope this hepls.
    Kind regards
    István

    ------------------------------
    István Nagy
    ------------------------------



  • 5.  RE: How to Get Value from SAP GUI Status Bar?

    Posted Sun February 19, 2023 08:39 PM

    Hi, Do you have resolve this issue? I use [getValue --selector "Id" --id "wnd[0]/sbar" logonFailMsg=value] and get the value correctly.



    ------------------------------
    Yan Hai Zhao
    ------------------------------



  • 6.  RE: How to Get Value from SAP GUI Status Bar?

    Posted Mon February 20, 2023 04:08 AM

    Hi!

    Unfortunatelly no. At least not with InnerText property, which is pretty frustrating, that recorder can see the innerText, but the runtime environment is not able to get it...

    So I had to make a workaround for this, which looks like:

    • I check if the statusbax oblect exists 
      • waitControl --forcerefresh  --selector "Id" --id "wnd[0]/sbar" --timeout "00:00:02" MessageBarFound=value
    • If yes, I clik on it.
      • click --selector "ClassName" --clickonposition  --controlsimilarity 100 --position "10,10" --simulatehuman  --forcerefresh  --classname GuiStatusbar --timeout "00:00:02"
    • If it was embty, nothing will happen
    • If there is a message in the statusbar, a new window (Performance Assistant * - see more down!) will appears.
    • In this window, the error or warning message and the SAP message code number appeares in a text list.
    • I have no idea how many can appear here, so I assumed no more than 12 items, thus I made a for loop (${index}), and check if exists
      • waitControl --selector "XPath" --xpath "/root/pane[1]/pane[1]/pane[1]/pane[1]/pane[1]/pane[1]/pane[1]/pane[1]/pane[1]/pane[1]/pane[1]/text[${index}]" --timeout "00:00:00.1000000" ControlFound=value
    • In my case only the last 2 of these are interesting (those will be the first 2 items in the window!!), one is the message itself, the other is the message code
    • You can check the codes here Messages - consolut to decide if it's an error, or just a warning.
    • After collecting the info I send an Esc key to close the Performance Assistant window. 

    However this technic may takes several seconds in rintime (waiting for window to appear) which slows down the code if you have to check it for many data input, also not too elegant.:-( It would be much better, if the runtime would ba able to do what the recorder can: read out that bloody innerText.

    *

    • There are 2 kind of windows can appeares when you click the status bar. Performance Assistant and modal R/3 window.
    • I only use the Performance Assistant, so I have to be be sure SAP use this!
    • To make it, go into the menu: Help / Setup, and on the first tab you can select this kind of window.
    • This is a standard SAP setup, so it will use it on next logons also.
    • Otherwise you have to handle the other window also.

    Hope this helps. :-)

    Regards

    István



    ------------------------------
    István Nagy
    ------------------------------



  • 7.  RE: How to Get Value from SAP GUI Status Bar?

    Posted Mon February 20, 2023 04:42 AM

    Hi!

    Thanks for the help, it's working!

    (My only problem is that why I was so stupid, that I didn't try or find the getValue... but you don't have to answer... :-D )

    Kind regards

    Istvan



    ------------------------------
    István Nagy
    ------------------------------