Capture specific text from SAP message windows

Dear all

Please your help with how extract a document number from SAP message

I only need the Document number (image)
I’m trying with get full text, but no works for me.

thanks for your help

Have you enabled SAP scripting.

If not, please check the below link. If you enable it, you will be able to access those elements directly.

Still if you dont have access,

  • use Get OCR Text and read the whole window.
  • Use Match Activity with Pattern “\d{10}”.
  • Use For Each item in Match.
  • Assign DocNumber = Item.tostring

Hi @Vivek_Arunagiri
Yes my SAP scripting is enabled

Then try Match activity (Regex)

I’ve used the OCR to get dialog text

but, I don’t know how to do with matches activities

Also, after that I need to assign activity to insert the Document number in excel field

Thanks for your help

Hi @Vivek_Arunagiri
I have a doubt… with scripting enabled, should I write a script from SAP recording and run it with uipath?


No need to write scripts.

After you enable scripting, UiPath will have direct access to selectors inside SAP. and you will be able to indicate the elements in SAP.

I understand, I’ll check it.

Thanks @Vivek_Arunagiri

1 Like
  • In Match, provide pattern as “\d{10}”,
  • Use For each item in Matches, give variable type as Match.
  • Assign DocNumber = item
  • Use Write cell to write in Excel.