Loop through in SAP its bit urgent please help me

Hi All,

I have to loop through these all below values from excel

  • so i have put it to the DT.

There are 2 columns which i have to put it to SAP
I have written the for each loop and i have put the typeinto Activity

But all the values are written in the same cell in the SAP.

How shall i resolve this problem

Please find the .xaml file

Rgards,
Sonika

You must change the selector to dynamic in the TypeInto activity.
Use variable to dynamically change the row index of the selector in TypeInto Activity.

Hi @KarthikByggari

I am having the below selector
<wnd app='saplogon.exe' cls='SAP_FRONTEND_SESSION' title='Enter Inventory Count: Overview' />
<wnd cls='Afx:*' idx='4' />

So do i need to pass the row(8) in the idx=β€˜4’???
The value in the DT is present in the 8th column …
And i see in the selector that the idx - is the field where i saw a numeric value

You have to increase the idx everytime you loop through.
You can use UIExplorer for finding the right idx of each row and use the variable with the right increment.

1 Like

@KarthikByggari

i got complete selector , need to increase the row…
<sap id='usr/tblSAPML04ID2051' tableCol='6' tableRow='0' />

how shall i do it in selector

Create a variable, for example iRowIndex of Integer Type with a default value 0.

In the selector,

<sap id=β€˜usr/tblSAPML04ID2051’ tableCol=β€˜6’ tableRow =β€˜" + iRowIndex + "’" />

After each loop, increment iRowIndex using Assign activity, iRowIndex = iRowIndex+1

1 Like

@KarthikByggari
No its not working, again its putting in the same cell in the same row…
The counter - iRowindex is incremented…

I have changed the column number i.e - tablecol= 6 … or 7 or what is suitable

But there is some prob with selector

Can u send me the selectors using UIExplorer for 2 or 3 cells.
We can see how each element is differentiated.

@KarthikByggari
Ok sure,

I tried it and i saw the row value is the one which is changing

  1. <sap id='usr/tblSAPML04ID2051' tableCol='6' tableRow='0' />

  2. <sap id='usr/tblSAPML04ID2051' tableCol='6' tableRow='1' />

3
<sap id='usr/tblSAPML04ID2051' tableCol='6' tableRow='2' />

so your type into selectors will be like below.

Counted Qty:
β€œ<sap id=β€˜usr/tblSAPML04ID2051’ tableCol=β€˜6’ tableRow='”+DT3.Rows.IndexOf(row)+β€œβ€™ />”
…
…
Aun:
β€œ<sap id=β€˜usr/tblSAPML04ID2051’ tableCol=β€˜7’ tableRow='”+DT3.Rows.IndexOf(row)+β€œβ€™ />”
…
…
Name:
β€œ<sap id=β€˜usr/tblSAPML04ID2051’ tableCol=β€˜8’ tableRow='”+DT3.Rows.IndexOf(row)+β€œβ€™ />”
…
…
based on your DT3 loop and variable name you should be using this
Do not use tab in the 1st type into

Try and let me know

Like you said your col will be fixed to 6, 7, 8 respectively and your rows increase for each invoice loop from 0, 1, 2…n(length of your DT3)

1 Like

Updated selectors:
"<sap id='usr/tblSAPML04ID2051' tableCol='6' tableRow='"+iRowIndex+"' />"
"<sap id='usr/tblSAPML04ID2051' tableCol='7' tableRow='"+iRowIndex+"' />"
"<sap id='usr/tblSAPML04ID2051' tableCol='8' tableRow='"+iRowIndex+"' />"

1 Like

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