Update Document line with a new Item Code...

Hi.
This is all done using the DI Server.
I am updating a sales order with two lines - it looks like this:
ItemCode____Qty
651_________10
00028________5
I update line 2 so the sales order now looks like this to this:
651_________10
651__________8
All I pass in is the two values 651 and 10 (and a taxcode etc)
Now... if I take a look at the sales orders GL - before and after the update - It looks like this
(before)
ItemCode_____Qty______GL Account
651___________10_____ _SYS00000000235
00028__________5_____ _SYS00000000237
(after)
651___________10_____ _SYS00000000235
651____________8_____ _SYS00000000237
So it does not change the GL Account to fit the new Item... It looks like I need to find the GL Revenue Account for the new item myself. How do I find this?
Method or SQL is more than welcome...
Regards,
Allan C. E. Rasmussen

Hi Allan,
your Stored Procedure is good for GLMethod = 'L' but if GLMethod of Item is 'W' or is 'C' your code is not good.
Case is "W"
SELECT RevenuesAc FROM OWHS Where WhsCode = @WhsCode
Case is "C"
SELECT OITB.RevenuesAc FROM OITM INNER JOIN OITB ON OITM.ItmsGrpCod = dbo.OITB.ItmsGrpCod Where OITM.ItemCode = @ItemCode
Regards,
Claudio

Similar Messages

Maybe you are looking for

  • IPod nano 7 for sports usage

    Hello, I've bought an iPod nano 7 because I wanted to have full control over my music. The Shuffle comes with a robust clip for sports. Is there any robust accessory available for iPod nano 7 with clip, I can use for running and in the gym? Arm bands

  • Payment run for vendor failing "FM FI_PAYMENT_BANK_CHAIN_SET

    Hi All, Request your help with an issue that I am facing while doing Payment Run for a Vendor. Payment run is failing with the error "Internal error: FM FI_PAYMENT_BANK_CHAIN_SET,exception: CONVERSION_ERROR". The Bank Settings have been maintained an

  • Essbase 9 White Paper

    Hi all,<BR><BR>I'm looking for any white paper discussing Essbase 9 improvements over 7.x. Can anyone point me to any link?<BR><BR>Regards,<BR>Gerd

  • Is axis ptz 215 ip camera compatible with labview?

    Hi I am working with labview for my final year project and am trying to find a ip camera which will work in labview. I wish to use the axis 215 ptz but want to make 100% sure that I will be able to capture video input from it before I purchase it. so

  • Finding the exact left edge of text

    Hi. I am trying to get a rectangle to surround my SimpleText by making the rectangles height and width the same as the text height and width. It does a pretty good job if the first letter is "W" or a similar wide letter, but if the first letter is "h