Hi all, I need your help about copy-paste activity.
I want to do copy-paste of data from sheet 1 to sheet 2 like :
1 - In sheet1 I have only column from A to E, here I write the data saved from SAP (this is done);
2 - in the second sheet I have in plus column F and G, here I write also the data saved from SAP based on the vendor no. from column D (somehow also this is done);
The result, as you can see is like in the table “what I have now”, but the quantity from the “source target qty” is 1544 +1200 = quantity from column E. Basically, I want to copy row by row but I need to count all the rows, the result to be like in the “what I want” with that empty row, for example, to be easier to see and read. I put also the image with activities but I don’t know if is ok or not. Can someone help with some solution, please ? I don’t know if you understand what I’m trying to do. Thank you very much!
Sorry - are you trying to get the data into ColumnH…not quite understanding
newTable.xlsx (12.5 KB)
I attach the file, maybe will help. The idea is that to copy the data from sheet1 to sheet2, row by row. The columns “F” and “G” from sheet2 will be write with data from SAP based on the name of vendor, column “D”. As you can see, the quantities in column “F” are not arranged next to those in column “E”.
I see - you need sums of Suppname if they have quantities which must be summed.
I believe that Source target qty on Sheet 2 is coming from SAP?
Hi! @ovidiu_2088 … Trying to understand you but Its not clear to me …
You have 2 excel sheets with data? right?
You want to copy from 1 to 2 … but what are the rules to do that? You said Row by Row but you need additional rules …just I am guessing …
Your sheet2 before copy the data from Sheet1 … what it is the data that have it? You said that will be F and G written with Data from SAP but my question is … when is happening it ? before copying the data from sheet1 of after?
My process is complicated, I will try to be short, bellow you have the steps of the process :
1 - the dates from sheet1 are saved from a pdf files;
2 - I open the SAP with vendor code and material (from sheet1) to find the good receipt number and quantity;
3 - in SAP I do data scrapping for good receipt number and quantity and write them to sheet2, in column F and G;
3 - my issue is to match the specific row from sheet1 with what I write in sheet2, good receipt number and qty;
What I’ve done, what you so in the excel are my steps, I copy the row every time when I read and do the data scraping from SAP for matching, somehow, but I can not.
I get it. Okay, when you scrape your data you need to put the data in a datatable. So, build a Datatable with build data table activity. Set the column for F with System.Double. Use an Add data row activity to add information to your new datatable. In a for each (or use LINQ…I use for each because to me it is habit)…create a variable that sums the figures in column F that you loaded to your new Datatable. Also, in your for each read the Vendor as that seems unique. Then, in a write range create an index variable index = yourSheet2Dtname.rows.indexof(row) +2. use an If statement that says, if your variable you created for vendor matches the vendor name in your sheet 2, then do a write cell within an excel application scope to write to column F of your sheet 2 with the summed variable + index. to string. This will populate column F. Make sense?
If not, hit me back and perhaps we can set up a zoom or teams call and I will walk you through it
Chris