Customize automation generated through Recorder
- How to customize a Recorder generated Automation
Prerequisites
- Step 1
Open the Cloud Studio project where you recorded the application using Recorder.
- Select the Sales order Recorder application in the Cloud Studio project.
- Select the screen containing the order details.
- Select the field containing Material.
- Rename the material field.
- Select Remove the Id Criteria.
- Select Name to add it as a Criteria.
- Select Is a collection .
Is a collection is used to declare a field as a column containing multiple fields rather than just one field.
-
Repeat the steps 3-7 for the remaining two fields ( Order Quantity Field and Storage location Field ).
The application now recognizes Material, Order Quantity and Storage Location as columns and not as fields.
When do we declare an element as 'Is a collection'?
- Step 2
-
Create an Excel file with the order details.
This data is used to create the Sales order in SAP ERP. Change this data according to your SAP ERP system.
-
Select Sales Order Recorder Automation in the project.
-
Adding the required activities to the automation.
-
Add Open Excel Instance Activity before the Start Application activity.
-
Add Close Excel Instance Activity before the Terminate Application activity.
-
Add Excel Cloud Link activity after the Open Excel Instance activity.
-
-
Configure Excel Cloud Link activity.
-
Select the activity.
-
Select Edit Activity.
-
Browse and select the Excel file.
The file is loaded to the activity.
-
Put the path of the file in the field.
-
Select + From Excel Data to create the Order details Data Type.
A pop-up window opens.
- Set a name and a description for the Data Type.
- To add all the rows from the Excel file, you require adding a For each activity.
The For each activity is used for looping through Data.
-
-
Looping through data.
In the automation, go to the Create Standard Order: Overview screen and add a For each activity just above the fields that need to be included in the repetitive process ( Material, Order Quantity and Storage Location ).
Drag and drop the three Set Element - X activities inside the For each activity.
-
Select For each activity.
-
Select returned Values option on Set looping list.
returned Values references the data returned from the Excel Cloud link activity.
Map the excel data of the current row to the corresponding field.
-
Select the first field (Corresponding to Material).
-
Set the value as current Member and click currentMember.material on the drop down menu that shows up.
current Member references the excel row used in the iteration of the For each loop.
-
Select Open the target Editor.
-
Select Material Field.
-
Set Index of the Element to index.
-
Select confirm.
Some fields are stored as numbers in excel (such as Order Quantity and Storage Location). Convert them to strings (succession of characters).
-
Select the second field (Corresponding to Order Quantity).
-
Select Open expression editor.
-
Enter Step27.currentMember.orderQuantity.toString().
Step27 references the For each activity.
-
Select Open the target Editor.
-
Select Order Quantity Field.
-
Set Index of the Element to index.
-
Choose Confirm.
Repeat the same steps for Storage Location field as for the Order Quantity field in the previous steps.
-
What is the purpose of ForEach Activity ?
-
- Step 3
Environment variables allow you to reuse certain information for a given environment.
You use environment variables to pass parameters to automations. You can create environment variables in the Cloud Studio for which you can later set values across specified environments.
Create two environment variables (Password and Excel file path).
-
Select Manage this project properties.
-
Select Environment Variables.
-
Select Create.
-
Fill in the password environment variable’s Identifier, Description (optional) and Type then Select Create.
-
Repeat step 4 for excel_ file_ path environment variable.
Type of environment variables depends on the use case. It can be a String, Password, Number, Date, etc.. .
environment variables’ Identifier can’t contain spaces. Replace spaces with underscores.
Identifier Description (Optional) Type password SAP Logon password Password excel_ file_ path Excel file Path for Excel Cloud Link String The two environment variables are created.
When do we use Environment variables?
-
- Step 4
To use the created environment variables in the automation go to the activities corresponding them.
-
Select Set Element of password activity in the automation.
-
Search and select the password environment variable.
Environment Variables have the letter E on the left side to distinguish them.
-
Select the Excel Cloud Link activity in the automation.
-
Select Edit Activity.
-
Search and select the excel_ file_ path environment variable.
Both of the environment variables were assigned to their correct value fields.
-
- Step 5
Choose Test and you will be prompted to put in values for the environment variables.
The process operates as follows:
-
SAP ERP system is opened, enters the credentials and navigates to Sales order Transaction.
-
The Excel file which is stored on your local machine containing Sales order details is opened.
-
The Desktop Agent fills all the details in the screen.
-
Information is validated to move to the next detected screen.
-
These steps are repeated for all the screens that were captured.
-
The Sales order is created successfully with data in the Excel.
-