on 06-27-2017 4:09 PM - last edited on 02-03-2024 11:43 PM by postmig_api_4
Hi,
I have an add-on which allow to renew automatically one or multiple service contracts by DIAPI.
This is my items tab. I added a second grid which shows the detail of the upper grid clicked line. The relation between the 2 grids is the line number and the contractID.
As you see, the column "Total Valor" (total value) from the upper grid is different from the grid bellow and there is my problem. In my database i have the following line order (CTR1)
I would like to know why SAP doesnt follow the order from the database field "Line".
Like I said, I have a relation between the line and contractID, so if the grid line order isnt right, when i click at the row i will get the wrong line detail.
Thank You
Hi
Try to do like this, the lines sometimes it is a little bit tricky, so I used set current line when reading/adding
With oContractNew.Lines
For i = 0 To oContractOld.Lines.Count -1
oContractOld.Lines.SetCurrentLine(i)
.ItemCode = oContractOld.Lines.ItemCode
.ManufacturerSerialNum = oContractOld.Lines.ManufacturerSerialNum
'.InternalSerialNum = oContractOld.Lines.InternalSerialNum
.UserFields.Fields.Item("U_SEI_Valor").Value = oContractOld.Lines.UserFields.Fields.Item("U_SEI_Valor").Value
.UserFields.Fields.Item("U_SEI_Cancelado").Value = oContractOld.Lines.UserFields.Fields.Item("U_SEI_Cancelado").Value
.Add()
.SetCurrentLine(.Lines.Count - 1)
Next
End With
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
99 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.