Load data from spreadsheet to SAP - how to get cursor to move down a row in SAP?

sap

#1

Hi - I am now working on an automation to add data into a custom SAP screen. The for each row functionality is working fine to read each row of the input file and enter the data into SAP. There are only two columns of data in the input file. The first is a user id and the second is something called a profile number. On the SAP screen, there are about 20 open lines to enter data into. My input file only has 7 rows. When I run the automation, it properly enters the user id and profile number for the first row in the file. The data from the second row in the file, though, is typed over the first row in SAP. It cycles through all the rows in the input file but just keeps typing over and over the same line in SAP.

I have the SAP input set to enter the user ID, then tab, then enter the profile number, then enter ---- this advances the cursor to the next available line in SAP. But then the automation jumps back up to the first row in SAP with the data from the second row in the Excel file

How do I ‘convince’ UiPath that it’s Ok to stay on the next available row in SAP?

Thanks!!


#2

How will you manually go to the next available row in SAP?


#3

Hi @mgirishfan,
The data from the second row in the file, though, is typed over the first row in SAP. It cycles through all the rows in the input file but just keeps typing over and over the same line in SAP.
I understood your concern. :slight_smile:
My suggestion is to verify that tab key manually in SAP first. Whether it is going to the second row or it is going to the first row. If TAB Key is not pushing the cursor to next row then you have to change the method of your field selection or focus.
In addition you can use the Type Into Activity and give the number of tabs required(Performs quite similar task as Send Hotkey activity). Delay Between Keys property needs to be set for quality.Wait for Ready Property to be set to Complete. Try with this hope this will help.
Else we can change the method.
Regards,
Jiban


#4

Hello Jiban - thank you.

The SAP screen only has two columns for data entry - and about 20 blank rows.

If the work is done manually, the user enters a user ID in the first row, first column - for example, HALEA - and then presses tab. The user then enters the profile number in the first row, second column - for example, 101 - and then presses tab again. This - when performed manually - advances the cursor to the second row, first column, ready to input a second line of data.

I used the Type Into activity and have a tab after entering the user ID and a second tab after entering the profile number. When I run the process and use the For Each Row, UiPath does momentarily tab to the second row, first column after entering the first row of data from the data table, but then it hops back up to the first row, first column and enters the data from the second row of the data table from Excel. It will repeat this for all rows in the data table, typing over and entering them all in the first row in SAP. I think this is something to do with the selector but I’m don’t know how to tell UiPath to go to the second row in SAP to enter the data from the second row of the input table, etc.

This is a simple screen in SAP and there is no delay needed.

If there is some way to send my two scripts to you or attach them here I’m happy to do that - I just don’t know how.

Thanks!
Mare


#5

Hi @mgirishfan
In order to send the screenshot you have to earn the badges (No idea which badge has the function to grant access for attachments)
Coming to the problem, i doubt in that SAP screen something which is there that we are missing. Sometimes in SAP, we dont need a TAB Key because the field automatically accepts the value and after accepting it automatically jumps to the next field.
Request you to test by performing the same steps manually on SAP Screen, what your code is doing and please monitor the cursor. If the cursor is going somewhere else then we have to change the one TAB key or we may have to insert some other keys. Ex: Down Arrow.
It will be better if you can send a screenshot at least…
Thanks,
Jiban


#6

Hey @mgirishfan

you can post screenshot or images because you are a basic user privileges already and you can post links as well.

Regards…!!
Aksh


#7

Hello ----

Ok - I added a Down Arrow but the automation STILL refers to the first row, first column. I know why, now — here is my selector:

sap id=‘usr/tblSAPLZSRGTCTRL_ZSCTSTPRFLU’ tableCol=‘0’ tableRow=‘0’

The selector is telling UiPath to go to the first row,first column and then the For each row activity tells UiPath to repeat this For Each Row. If I pull this out and put in the main, though, it STILL does the same thing! This is quite frustrating. It seems like it should be so simple. Can anyone help?

Thanks,
Mare


#8

Hi,

you can create an increasing int variable for the tableRow, which you then just + 1 in each of your For Each iteration.

int rowIndex = 0

sap id=‘usr/tblSAPLZSRGTCTRL_ZSCTSTPRFLU’ tableCol=‘0’ tableRow=’" & rowIndex & "’

rowIndex = rowIndex + 1

Your loop will begin from the row at index 0, next is 1 and so on.

BR,
Topi


#9

Hello Topi -

This sounded very logical and simple but alas it still is not working. I actually declared an argument rowIndex in the main script and assigned a starting value of 0.

Then I invoke the workflow that represents the repetitive activity and imported the argument.

In the script OF the repetitive activity I changed the selector to:

sap id=‘usr/tblSAPLZSRGTCTRL_ZSCTSTPRFLU’ tableCol=‘0’ tableRow=‘rowIndex’ /

and then, after the steps to enter the user ID in the first column and the profile number in the second column,

I have a second assign on the argument to say

rowIndex = rowIndex+1

When I execute, uiPath STILL jumps up to row 0 every time, even though the initial assign (to set the rowIndex to 0) is outside of the repetitive tasks.

Help!!

Thanks,
Mare

The little image on the screen, from the original Type Into activity does indeed show the cursor at the front of row 0, column 0, but since the selector reads

sap id=‘usr/tblSAPLZSRGTCTRL_ZSCTSTPRFLU’ tableCol=‘0’ tableRow=‘rowIndex’ /

after the first pass - after rowIndex is set to = rowIndex+1, why doesn’t it Type into row 1 column 0?

Thanks!
Mare


#10

Hello,

thank you for your inquiry.

so this is your selector huh?
sap id=‘usr/tblSAPLZSRGTCTRL_ZSCTSTPRFLU’ tableCol=‘0’ tableRow=‘0’
change it to this one:
sap id=‘usr/tblSAPLZSRGTCTRL_ZSCTSTPRFLU’ tableCol=‘0’ tableRow=’{0}'
using curly brackets will allow you to increment the number. Note that I’ll select only column 0 or the first column. if you want to do it for both of your columns, you’ll have to do use curly brackets for column.

do something like this:

and looping evaluate the scenario where there is no more data.
inside the loop do this by using string.Format :slight_smile:

see, that way you will be able to iterate through the lines. Let me know if you have doubts so far.
lastly using type or click activity, use the selector we just built.

Regards.


#11

Hi @beesheep,

I am facing the same issue - The counter in the selector is not working, due to which the cursor jumps back to the 1st row. However, it increments in the Assign activity. I read your solution to assign the row to {0}. However, how are you using the selector variable in the actual selector?

Would it be possible for you to share the .xaml file ?

Thanks,
Oshin


#12

Hi @mgirishfan,

I am facing the same issue. Were you able to resolve it? The counter that I used in the selector is not working.

Thanks!


#13

Hello @oshinkavdia

Here are the selector variables:

There is a main and an invoked workflow. You see the rowIndex is intially set to 0. In the invoked workflow, here are the two selectors - one for the user id and one for the profile number:

After the invoked workflow process the first row of the input file, the rowIndex is increased by 1 in the mail file and the process repeats until all rows are entered:

Cheers!
Mare


#14

Thank you so much @mgirishfan! It worked :slight_smile:


#15

Hello mgirshfan,

can you please send the xaml file of the said solved project, or suggest any youtube video to get that.
Thanks.


#16

Please please share the image of “Load to SAP.xami” .


#17


#18

Thanks a lot.
I am trying to enter value from spreadsheet to SAP customized table by using SM30 T code.

Can you please explain following

  1. userID + “[k(tab)]” - What is “userID” ? Is it a variable or Excel Column Name?
  2. How do you manage to get the Last portion of Selector Variable’s default value i.e. . In my project it is coming like
    "sap id=‘usr/tblSAPLZMMT0031_CONFTCTRL_ZMMT0031_CONF’ tableCol=‘1’ tableRow=‘0’ /"
  3. How can we enter the String.Format(userIDSelecter,rowIndex,ToString) in Selector box?
    I am entering String.Format(IPSelecter,rowIndex,ToString) in my project but its throwing error.

Please please help me to resolve the issue.


#19

Please help to solve the issue.


#20

Please help by providing the details
userID + “[k(tab)]” - What is “userID” ? Is it a variable or Excel Column Name?