Hi All,
I got solution for mapping one data to many data..
Here i enclose my coding.......
Dim intNoOfRows
Dim arrPONos()
intNoOfRows=DataTable.GetSheet(1).GetRowCount
ReDim arrPONos(intNoOfRows)
For intStartRow= 1 To intNoOfRows
DataTable.GetSheet(1).SetCurrentRow(intStartRow)
arrPONos(intStartRow)=DataTable("PO",1)
Next
arrTrimIntPONos=fCleanSpaceArray (arrPONos)' Write a fn
'intarrPONos=fArraySize(arrPONos)
'intarrTrimIntPONos=fArraySize(arrTrimIntPONos)
For intStartRow= 1 To intNoOfRows
DataTable.GetSheet(1).SetCurrentRow(intStartRow)
arrPONos(intStartRow)=DataTable("PO",1)
intSKUNo=DataTable("SKU",1)
intOrderNo=DataTable("OrderNo",1)
For intPostart =0 to Ubound(arrTrimIntPONos)
If (arrPONos(intStartRow)<>""And (arrTrimIntPONos (intPostart)<>
arrPONos(intStartRow)))Then
intNewPO=arrPONos(intStartRow)
msgbox "PO no: "&vbtab &intNewPO &vbcrlf &"Sku No:
"&vbtab
&intSKUNo &vbcrlf &"Order no: " &intOrderNo
Exit For
End If
If (arrPONos(intStartRow)="" ) Then
intExistingPO=intNewPO
msgbox "PO no: "&vbtab &intExistingPO &vbcrlf &"Sku No:
"&vbtab
&intSKUNo &vbcrlf &"Order no: " &intOrderNo
Exit For
End If
If (arrPONos(intStartRow)<>""And (arrTrimIntPONos (intPostart)=
arrPONos(intStartRow)))Then
intNewPO=arrTrimIntPONos(intPostart)
msgbox "PO no: "&vbtab &intNewPO &vbcrlf &"Sku No:
"&vbtab
&intSKUNo &vbcrlf &"Order no: " &intOrderNo
Exit For
End If
Next
intSKUNo=DataTable("SKU",1)
intOrderNo=DataTable("OrderNo",1)
Reporter.ReportEvent micpass ,"New PO_SKU_OrderNo
Loop"&intStartRow,"New PO No :"&vbtab &intNewPO &vbcrlf &"Existing
PO;" &intExistingPO&vbcrlf &"SKU: "&vbtab &intSKUNo &vbcrlf
&"Order No;" &vbtab &intOrderNo
Next
'For intStartRow= 1 To intNoOfRows
' DataTable.GetSheet(1).SetCurrentRow(intStartRow)
' intPONo=DataTable("PO",1)
' For intPostart =0 to Ubound(arrTrimIntPONos)
' If intPONo=arrTrimIntPONos(intPostart) Then
'' intPONoNew=DataTable("PO",1)
' intPONoNew=arrTrimIntPONos(intPostart)
' Exit For
' ElseIf intPONo="" Then
' intPONoNew=arrTrimIntPONos(intPostart)
' Exit For
' ElseIf (intPONo<>"" And intPONo=arrTrimIntPONos(intPostart))
Then
' intPONoNew=arrTrimIntPONos(intPostart)
' arrTrimIntPONos(intPostart) =""
' Exit For
'' ElseIf intPONo<>arrTrimIntPONos(intPostart) Then
'' intPONoNew=arrTrimIntPONos(intPostart)
'' Exit For
' ElseIf intPONo<>arrTrimIntPONos(intPostart) And intPONo="" Then
' intPONoNext=arrTrimIntPONos(intPostart)
' Exit For
' End If
' Next
Public Function fCleanSpaceArray(num)
------
----------------------------
End Function
Regards,
Byzoor,
On 3/28/11, K.Byzoor Rahuman., I.A.S <[email protected]> wrote:
> Hi All,
>
> My Req is Map the First column value to Second Column Value.
>
> Like Row cell value is empty it should take Previouse NOt Null value.
> 1531 0r 1532 or 1533.
>
>
>
> Type: one to many mapping....
>
>
> Flow:
> 1. get the Row count.
> 2. using for loop iteration get the cell value.
> 3. in my DataTable 2nd row is empty, my script should take 1st row
> value(1531).
> 4. Row value is 1532 it contune the execution. Next row is Empty value
> , it should take 1532 value.
>
> Please suggest me.
>
>
>
>
>
> PO SKU OrderNo
> 1531 TASK1001 10
> TASK1001 10
> TASK1001 20
> TASK1001 30
> TASK1001 50
> TASK1001 20
> 1532 TASK1002 10
> TASK1002 10
> TASK1002 20
> TASK1002 10
> TASK1002 10
> TASK1002 10
> 1053 TASK1003 10
> TASK1003 20
> TASK1003 10
> TASK1003 50
> TASK1003 12
> TASK1003 12
> TASK1003 10
> TASK1003 12
> TASK1003 10
> TASK1003 10
> TASK1003 15
> TASK1003 14
> TASK1003 15
> TASK1003 16
> TASK1003 15
> TASK1003 14
> TASK1003 17
> TASK1003 18
> TASK1003 14
> TASK1003 15
> TASK1003 12
> TASK1003 15
> TASK1003 1
>
--
Have a good day. Hope this mail finds you in good health and cheer.
Let me give you a short introduction about my portfolio. I working in wipro
, chennai, India.
as a Test engineer since June 2005. I have almost 3 years of experience in
the IT industry in the areas such as Automation Test Engineer.
I have sufficient experience in software testing.
I am a Engineering graduate in Computer Science and Engineering. So hereby,
I am attaching my resume in doc format.
Thank you in advance for your kind consideration. Hope to hear fro you soon,
with a positive feedback.
Happy Tester,
Byzoor,
--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en