How to split a table, and cycle searches on SAP

Hi to all,
i need some help on how to work on a table with several thousand rows.
I have to read an excel file with several thousand lines, a list of SAP IDs, on a single column.

The number of lines in the file may change over time.

I can’t do a single SAP search for the whole list. Data could freeze and slow down SAP.
So I have to divide the master file into smaller tables (ex 1000 rows at a time) and then do many extractions, up to the end of the list.

The list of IDs is on an excel sheet, but it would not be a problem to import it to DB if it simplifies the work.

I don’t know how to create this flow.
Can someone help me?



Hello Aaron,
can you please clarify your requirements.
As far as I understand you correctly, you have a long list with SAP IDs in an Excel sheet and you want to search for all these in SAP. You want to have a search query that contains several thousand search values.
Thanks and best regards

Hi Stefan,
Thanks for your interest.
Yes, I have a list of several thousand lines. A list of IDs, in a single column.
The File starts at 10k lines and could reach 50k-100k lines over time.

Not being able to search the entire list “one shot”, I have to assume to break it into smaller groups.

The idea was to create 1k tables and do 10, 50, 100 searches on SAP until the initial table was exhausted.

Since the initial list is dynamic, I don’t know how to subdivide and cycle through the lists until all the lines are exhausted.

for first part:

Thanks for the tips.
I have tried using the workflows that have been shared but have not solved yet.
I take a few days to figure out what I’m doing wrong.

Hello PPR,
sorry for the delay in my feedback.
Unfortunately, I was unable to understand exactly what to do.
Also, when I try to open the attached WF, Uipath doesn’t react, forcing me to kill it.

If I can, and someone has patience, could they help me conceive the bot?

The goal is to run a very thoughtful query on SAP. Extract the data and save it on the network.
The process is very simple. But I still ran into problems.

IDList.xlsx (105,6 KB)

I have this ID list.
The number is almost always the same. It could increase by a few units.
The lines are not many. Just under 10k, but if I top up the whole list, SAP could stay saturated for a long time.
Perhaps because he is looking for activities from 2018 to today.

The idea was to create segmented searches.
ex: 1000 lines at a time, up to the end of the list.
and of course, save each chained extraction in a single file.

financial_control.xaml (113,5 KB)
I glue my current WF, but as it is made it is not performing.
the problem is that SAP gets stuck and slow in the network, and random, it goes into error.

Can anyone help me if it’s not too complex?
Thanks a Lot.

Hello @AaronMark,

the main thing is: what you’d like to do with this IDs? Just checking if they exist? What SAP table/transaction are you using to do this?



Hi Artur,
The transaction is FBL5N - I need to extract all payments / balances made, within that time frame.

I don’t know the administrative details, but only the list of activities to be performed with the bot.
I know that the final, complete file weighs 40MB. and reaches 800k lines

Have you tried to use SE16n to extract the data? Export it to the Excel sheet after entering filtering data?



ouch… sorry…
I do not understand what you mean.
Unfortunately I do not have great computer programmer skills, I am recently approaching this complex world.

No problem. :slight_smile: Let me be more specific: use transaction SE16n in SAP to take the data, not FBL5N. FBL5N uses tables with names: BSID and BSAD. You can check if it’ll take the data more efficently.

I checked.
it is an unregistered transaction in the profile I am using.
I believe that it is not possible to request it, because costs are expected that the company certainly does not intend to bear for this use case.

So we’d need to stick to the segmentation. Are you able to split the table to separate files and then search for each one in SAP? Or maybe read the input file and search for 1000 records in one time and repeat the process? :slight_smile:

Unfortunately, that’s my problem.
It’s an activity I’ve never done, and, I’m not sure I’m capable of it. I should read up on it but the instructions I found didn’t help me much.

In my mind I imagine a flow that, after starting SAP,

  • read the IDList
  • Count of lines. (I think it is useful to determine when
    stop the flow of searches)
  • Split of the table, into smaller tables by taking (‘XX’ number of rows - 100, 1000 … at the moment I have not defined)
  • Start the search on SAP x the first indexed table - extract the values - Save the extract in the “output.xlsx” file.
  • Start the search on SAP x the second table … extract the values, and append the results to the Output.xlsx file.

And so, down to the last row of the initial table.

I have a design in my mind but it would be hard to explain it easily on the forum. Could you please message me?

The WF that I have shared are my current bot,
which as it is conceived is likely to often go wrong.
I was looking for a way to optimize it by dividing the initial list into smaller ones.

I am still looking for a solution.