web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / SAP script in Power Au...
Power Automate
Unanswered

SAP script in Power Automate

(0) ShareShare
ReportReport
Posted on by 20

Hi all,

I am using Power Automate Desk to automatically create sales order in SAP system based on the Excel Data. The workflow is: Read Data from Excel>>>Launch SAP>>>Run VB script (obtained via the recording of SAP)>>>Store the sales order number in Excel.

However, I have two problems in running the VB script:

  1. If Excel Data input into SAP system contain a character, e.g., "kg" input in Unit Field, the information will not be input successfully. In contrast, if Excel Data only contain numbers, e.g., "990" input in Weight Field, then it is input successfully.
  2. The hyphen between two numbers is identified as Minus Symbol, and calculation is made when Excel Data input into SAP field. For example, the input Data should be "21-7398", but "-7377" is input into the SAP field. In order to fix this problem, I have tried to set the Data format as Text or set a variable "a"=Data and input "a" into the field, but neither of them worked. 

Can anyone please suggest me to resolve the issue?

Thank you!

I have the same question (0)
  • xanddix Profile Picture
    17 on at

    What a suggest you is: You can create a cloud flow and "Run Script"(is a action from excel connector). The script only work for some plans of office. For see if you have this option, check in excel online--> open any excel file (on excel web) and check if you have "automate" option:

    xanddix_0-1684592516274.png

     

    after that, you can record a script in "record actions".

    So now, you have so many possibilities: now you can create a new column and use "left" or "right" formula to remove the "kg" sufixe or prefixe. Looks like that:

    xanddix_1-1684592734837.png

     

    and for the problem with Hyphen I suggest you use the SUBSTITUTE formula from excel:

     

    xanddix_2-1684592852594.png

     

    So, you record these action and then stop and save the script. After that you can run the script in any excel sheet.

    After that you run the flow desktop and see if SAP is getting the new cells.

     

    Hope thats help

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 784

#2
Valantis Profile Picture

Valantis 581

#3
Haque Profile Picture

Haque 545

Last 30 days Overall leaderboard