How can I use UiPath to download attachments from SAP TCode FB03

Hi, I would like to use UiPath to automate the download process of all attachments from an SAP invoice from the TCode FB03. However, each invoice may have a variable number of attachments or no attachments at all.

What activities in UiPath could I use to implement this logic? I tried to use For Each UI Element, but this only works for Web Applications which SAP isn’t.

Thanks for the help!

1 Like

Hi

Welcome to UiPath forum

If you want to interact with sap using UiPath we need to enable GUI scripting in sap settings
Then you will be able to interact with simple click and type into activity to download the attachments

Have a view on this for enabling gui scripting in sap

Cheers @anauditor

Hello @anauditor

  1. Attach Window: Target the SAP GUI window.

  2. SAP Logon: Log in to SAP.

  3. SAP BAPI Invoke (or equivalent): Use the appropriate BAPI or RFC to retrieve invoice data and attachment information.

  4. If attachments exist:
    a. Download File: Download the attachments to a specified folder.

  5. Error Handling: Use Try-Catch activities to handle exceptions.

  6. Repeat for multiple invoices (if needed).

  7. SAP Logoff: Log out of SAP.

  8. Close the SAP GUI window.

Thanks & Cheers!!!

Hi thank you so much for the reply. Do you have any specific activity you are referring to on SAP for Step 4? Because I’ve tried “For Each UI Element” but it can’t work because it isn’t a web application.

@anauditor

  1. Check for Attachments:

    • Use “Element Exists” or “Image Exists” to determine if attachments exist.
  2. If Attachments Exist (based on the result of the check):
    a. Click on the attachment link(s) to initiate the download.
    b. Use “Type Into” to specify the download location.
    c. Use “Send Hotkey” (e.g., Enter) to confirm the download.

  3. Implement error handling as needed to handle exceptions during the download process.

  4. Continue with your automation or workflow after downloading the attachments.

Hi, where can I find the “Element Exists” activities because I can’t seem to find it in the left panel.

Thanks for the reply. However, due to security concerns I GUI Scripting has been disabled. Is there a way to work around this? Perhaps I could use Computer Vision instead?

1 Like

Left side in activities panel

I would recommend to get this enabled with your admin support
Because this makes your life easy by using simple click and other Ui based activities

If you go with computer vision still it’s fine but will be very complex
Same applies even when u try to interact with hotkeys… it’s is possible but it will be complex

If you really don’t have an option to enable that then

  1. first try with back end SAP Queries if it can possibly fetch u the details u need
    Use the activity to interact with sap using query
  1. Or use hot keys to interact which is likely better than using computer vision

  2. Finally go for computer vision activities

Cheers @anauditor

1 Like

image

This is all I see :confused:

Is it possible to enable that gui scripting

@anauditor

@anauditor

  1. Open your UiPath project in UiPath Studio.
  2. In the “Activities” pane on the left side, click on the “Manage Packages” button. This will open the “Manage Packages” window.
  3. In the “Manage Packages” window, make sure you are in the “Official” tab.
  4. In the search bar, type “UiAutomation” to search for the package.
  5. Once you find the “UiPath.UIAutomation.Activities” package, click the “Install” button to install it.
  6. After the package is installed, you can access the “Element Exists” activity in your project.
  7. Drag and drop the “Element Exists” activity into your workflow where you need to check if an element exists on the screen.