Problem with Update lines of orders
Séverine LE ROCH
Hi!I want to update a field in lines of orders with data entered in an usertable.
I managed to update this field but I have a problem with the line number. It isn't the good line which is updated!
For exemple, if I want to update the line 5: Coresuite updates the fifth line of the document. If the line 4 is deleted. SAP keeps the linenumber 5 but Coresuite thinks with the function SetCurrentLine that it is the fourth line to update.
So It updates an other line! I think the function "SetCurrentLine" returns a visual line number.
In attachment, my code.
Perhaps, is there an other function to have the real linenum of SAP?
I hope that I am clear.
Thanks
Best regards,
Attachment
[url=http://www.coresystems.ch/wp-content/../wp-content/forum-file-uploads/sleroch/UpdateColisage.txt]UpdateColisage.txt[/url]
Michael Egloff
Hi Séverine,the function
SetCurrentLine(long lineNum)
is not from coresuite itself, it's a function from SAP DI Framework. So there's not much we can offer you because we can't add functionality to objects coming from the SAP Framework.
As you already noticed by yourself the function uses the visual count of the lines. Here is the description from the SAP SDK:
Description
Sets the active row to a specified row number.
Parameters
LineNum
Specifies the row number. The count starts from 0.
Hope this helps you.
Manuel Marhold
Hi,the lines-object of a document is a collection.
SetCurrentLine wants the index in this collection as the parameter.
So if you have these lines:
1: ItemCode 0001
2: TextLine
3: ItemCode 0003
4: ItemCode 0004
5: Subtotal
6: ItemCode 0006
If you want to update the ItemCode 0006 you have to use "3" as parameter for SetCurrentLine, because the Textline and Subtotal are not in "Lines", but in "Special_Lines" and SetCurrentLine is zero-based
If you delete row 4 (ItemCode 0004) you have to use "2" for ItemCode 0006.
0
Please sign in to leave a comment.
Comments
0 comments