Compare and pick values

Hi Experts,

I was working on an requirement and was facing an issue so needed Experts help.

in Sap i have a data which i need to copy to Excel/Data Table and once i copied i need to compare and pick some values from the table .

Ex: in the below screenshot, i need to search for a value ABC from column ‘E’ and once i get the ABC in Column E i need to pick corresponding value from Column A and store it in some variable.

Cheers,
Vikram.G

1 Like

hey @vikram.g1
yes you can achieve this using lookup data table.
I am attaching two video links that will help you solve this problem.

Cheers,
Parth

@Palaniyappan please can u suggest your view on this.

Thanks and Regards,
Vikram

1 Like

Hi

Hope these steps would help you resolve this

—use a excel application scope and pass the file path as input
—inside the scope use a read range activity and get the output with a variable of type datatable named dt
—you can use Lookup datatable activity
But for this to be very simple we can use a FOR EACH ROW activity with a if condition like this
Pass the variable dt as input to for each row activity and inside the loop use a IF activity with condition
row(4).ToString.ToUpper.Contains(“ABC”)
If true it will go to THEN part where we can use a Assign activity like this
str_output = row(0).ToString.Trim

Cheers @vikram.g1

Hi @Palaniyappan ,
The above solution worked for me… just one more clarification data in the excel file iam getting from SAP tables, how can i get the sap tables values to a data table and den i want to apply the above logic like i need to search for a value ABC from column ‘E’ and once i get the ABC in Column E i need to pick corresponding value from Column A and store it in some variable

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.