Skip to Content
Technical Articles
Author's profile photo Maximiliano Gonzales

Challenge Submission – SAP Intelligent RPA: mass creation of deliveries and invoices

This is a submission for the SAP Intelligent RPA Tutorial Challenge

Case selection

We are currently making some prototypes in the innovation and development department of Invenzis Uruguay (SAP Partner).
This prototype was created to solve a very frequent inconvenience in the clients, since it takes several hours of resources and the task is completely monotonous.

Case of use


Mass creation of deliveries (VL01N) and invoices (VF01)

In SAP ERP transactions, VL01N is used to create outbound deliveries, in this transaction the product is shipped from stock.
After posting the delivery, the invoice is made in transaction VF01.
This process flow requires several transactional hours per day and the process is completely monotonous and without added value, making it a great candidate to be automated.

IRPA solution

With the SAP GUI connector that has SAP IRPA Desktop integrated we can capture all the transactional movements of the ERP, in this way we can easily interact taking data from an alternative database such as Excel and making transactions in the ERP for each line read from the Excel sheet.


  • The excel sheet will place orders that are already ready to generate delivery, post and invoice.
  • The bot will take the excel sheet records
  • The bot will log in to SAP and perform the creation of the delivery / accounting and billing.
  • Bot reads the following record from the spreadsheet, if you are already logged in, continue making transactions.
  • if it is the last record of the spreadsheet, the bot performs the SAP logout



Flow IRPA:




Step 1 – create variables


In this step, the variables that are then stored in the values acquired in the Excel spreadsheet are created.


Step 2 – Sequence



In this step a sequence is created in which excel starts, a book is read and a cell is set.
here we will also save the value of the loop, our spreadsheet always starts in row 7, so its initial value is 7, for every lap you will add 1 until you reach the last record.
Javascript code:


Explanation of some points in the Javascript code:

  • In the first point we create a variable called “ultimacelda” in it we store the position of the last empty cell in the spreadsheet. For this we use ctx.excel.sheeet.getLastRow (‘F6’); (F6 = cell with first value in our spreadsheet).
  • Second IF point to validate if we have to go to the Output “salir”, this output closes session in SAP and is done when we are in the last record of the spreadsheet.
  • We keep in the variable “loop count” the position of the row in which we have the first data in excel.
  • In the last point we store in the variables center / postexp / warehouse and order the data we obtain from the excel cells.


The sequence we create has three outputs (login / normal and salir)

  • login: it is the first step and that is when we log into SAP
  • normal: if the bot detects that we are already logged in, it continues with the transactions without going through the login.
  • salir: Log out of SAP.


Step 3 – Login

In this step we perform the SAP login, create the delivery, post and invoice.
The delivery number is saved in the excel form.
In the last step of this block we save the value in excel and increase the value of the variable “contadorFor” by + 1 to move to the next row.


Step 4 – normal flow


This step is the same as the previous one but without login.


Step 5 – log out.


In this step we close session in SAP.



I hope this little tutorial will help you and that it can motivate you to make new developments in SAP IRPA, this tool is excellent and has no limits to create really complex automations.
I share a video with the automation in progress.






Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Veselina Peykova
      Veselina Peykova

      What is the reason for using VL01N and VF01 in the first place?

      With good business practices and with a correctly configured system VL01N and VF01 are used for exception handling, so I really hope that this combination is not "a very frequent inconvenience in the clients".

      There are well-known transactions for creating documents and billing documents in collective runs.

      And there are also various ways to generate SD documents via file upload (with or without additional coding).

      It is probably worth pointing out that with the alternatives the documents can be posted in the background, which is probably a more efficient solution if you have a really high number of transactions.

      Would you please add a bit more background to the story?

      Author's profile photo Maximiliano Gonzales
      Maximiliano Gonzales
      Blog Post Author

      Hi Veselina,

      Thank you for your comment, as I wrote in the post this is a prototype and the idea was to experience the tool in situations where you have to relate to several transactions.

      As you comment there are more efficient transactions to make these documents and massively managing resources efficiently.

      The intention of the post is to show in detail the flow of delivery and invoice since if in any case a delivery does not pickea 100% we must modify the amount of the picking and we could do it this way.



      Author's profile photo Veselina Peykova
      Veselina Peykova

      Hi Maximiliano,

      Intelligent RPA is a nice tool, but maybe it can benefit more by demonstrating use cases where it is clearly a superior option, e.g. if you have to retrieve some of the data needed for transaction processing from multiple external websites.

      I had a similar problem understanding the benefit of the demo for creating purchase orders in the nutshell openSAP course, so please do not be offended. 🙂

      There are cases where Intelligent RPA is suitable, and there are cases like this one where it is hard to justify its use to customers with good process and system knowledge.


      Author's profile photo Maximiliano Gonzales
      Maximiliano Gonzales
      Blog Post Author

      I have a prototype that extracts the price of the dollar currency and imputes it in SAP ERP in the course of the week I put together a post and upload the steps.

      As this process says, it may not justify the use of IRPA but it shows cases such as interacting with Excel and SAP at the same time. This question is quite frequent in the forum and I think this post can evacuate the doubts of those users.

      Thank you very much for your comment.



      Author's profile photo Pierre COL
      Pierre COL

      Hi Maximiliano,

      We created a specific tag for our SAP Intelligent RPA Tutorials Challenge : "SAPIntelligentRPA_2020TutorialChallenge"

      Do you mind tagging this blog post?

      Author's profile photo Maximiliano Gonzales
      Maximiliano Gonzales
      Blog Post Author

      Hi Piere,
      right now I add the tag !.


      Author's profile photo Sonu Agarwal
      Sonu Agarwal

      very good information. Thanks  for sharing it 🙂

      Author's profile photo Edgar Chavez
      Edgar Chavez

      Hola Maximiliano

      Estoy frente a un problema con ventanas emergentes en el ERP, estoy trabajando en la Tx ME21N

      -he intentado enviar un KeyStore, tiempo de espera hasta que se desocupe el servidor pero no logro solucionar esto, me enfrento a un mensaje de sesión ocupada.


      estabas en alguna situación igual con las ventanas emergentes, como resolviste esto?


      imágenes de referencia




      Author's profile photo Anne Li
      Anne Li

      Hi Maximiliano,

      very good information,you can share the project to see how you did the excel reading?
      Author's profile photo Srinivas Rao
      Srinivas Rao

      Hi Maximiliano Gonzalez - Did you get all the data from the excel at ones and stored it in one of the context variable? If yes, I assumed you looped over it....What was the exit criteria put in ? I am struggling to find a way to put an exit criteria for a data context which is NOT an item...

      Kindly help !