Get allocated serial number only

I have a UDF serialno in Sales Order and a Stored Procedure that will  save selected serials. But It still saves not selected serial.How to know if serial is alread allocated in Sales Order? Also anyone where is SBDR table? When I look at the system information of the rows from selection its from SBDR, but there is no table when I look at the SQL.
This is my Stored Procedure.
declare @rowcount int
declare @rowcount1 int
declare @mycount as int
declare @mystring nvarchar(255)
declare @myitem  nvarchar(10)
declare @myserial nvarchar(100)
declare @mybaseentry as nvarchar(10)
declare @mylinenum as int
declare @gdocentry as nvarchar(255)
declare @gitemcode as nvarchar(255)
declare @glinenum as int
IF @object_type='17' AND (@transaction_type='A' or @transaction_type='U')
BEGIN
--for U_serial==============================================================================================================================================
  set @rowcount=(select count(*) from syscolumns a,sysobjects b where a.name='u_serialno' and b.name='rdr1' and a.id=b.id)
  if @rowcount>0 and (@transaction_type='A' or @transaction_type='U')
  begin
  set @gdocentry=''
  set @gitemcode=''
  set @glinenum=''
  --update RDR1 set U_serialno='' where docentry=@gdocentry and itemcode=@gitemcode and linenum=@glinenum
  declare serial_no cursor for SELECT A.DOCENTRY, A.ITEMCODE, A.LINENUM FROM RDR1 A, OITM B WHERE A.DOCENTRY=@list_of_cols_val_tab_del AND A.ITEMCODE=B.ITEMCODE AND B.MANSERNUM='Y'
  open serial_no
  fetch next from serial_no into @gdocentry,@gitemcode,@glinenum
  while @@fetch_status=0 begin
  set @myserial=''
  select @myserial=@myserial + cast(intrserial as varchar(255)) + ', ' from sri1 a, osri b where a.itemcode=b.itemcode and a.itemcode=@gitemcode and a.baseentry=@gdocentry and a.baselinnum=@glinenum and a.sysserial=b.sysserial  Group by cast(intrserial as varchar(255))
  set @myserial=case when @myserial='' then '' else left(@myserial,len(@myserial)-1) end
  update rdr1 set u_serialno=@myserial where docentry=@gdocentry and itemcode=@gitemcode and linenum=@glinenum
  fetch next from serial_no into @gdocentry,@gitemcode,@glinenum
  end
  Close serial_no
  deallocate serial_no
  end
END

Hi, thanks for the reply. How can I update the allocated serials for Sales Order using stored procedure?For example I add two serials for item one:serial1 and serial2 and saved it on my RDR1 U_serialno.The output data on my UDF U_serialno would be serial1,serial2.  Next I want to update the sales order and remove serial2 when I update my Sales Order the U_serialno should be serial1 only but It still saves serial1,serial2 . This is my stored procedure:
declare @rowcount int
declare @rowcount1 int
declare @mycount as int
declare @mystring nvarchar(255)
declare @myitem  nvarchar(10)
declare @myserial nvarchar(100)
declare @mybaseentry as nvarchar(10)
declare @mylinenum as int
declare @gdocentry as nvarchar(255)
declare @gitemcode as nvarchar(255)
declare @glinenum as int
IF @object_type='17' AND (@transaction_type='A' or @transaction_type='U')
BEGIN
--for U_serial==============================================================================================================================================
  set @rowcount=(select count(*) from syscolumns a,sysobjects b where a.name='u_serialno' and b.name='rdr1' and a.id=b.id)
  if @rowcount>0 and (@transaction_type='A' or @transaction_type='U')
  begin
  set @gdocentry=''
  set @gitemcode=''
  set @glinenum=''
  update RDR1 set u_serialno='' where docentry=@gdocentry and itemcode=@gitemcode and linenum=@glinenum
  declare serial_no cursor for SELECT A.DOCENTRY, A.ITEMCODE, A.LINENUM FROM RDR1 A, OITM B WHERE A.DOCENTRY=@list_of_cols_val_tab_del AND A.ITEMCODE=B.ITEMCODE AND B.MANSERNUM='Y'
  open serial_no
  fetch next from serial_no into @gdocentry,@gitemcode,@glinenum
  while @@fetch_status=0 begin
  set @myserial=''
  select @myserial=@myserial + cast(intrserial as varchar(255)) + ', ' from sri1 a, osri b where a.itemcode=b.itemcode and a.itemcode=@gitemcode and a.baseentry=@gdocentry and a.baselinnum=@glinenum and a.sysserial=b.sysserial Group by cast(intrserial as varchar(255))
  set @myserial=case when @myserial='' then '' else left(@myserial,len(@myserial)-1) end
  --Select @Error=55,@error_message=@myserial
  update rdr1 set u_serialno=@myserial where docentry=@gdocentry and itemcode=@gitemcode and linenum=@glinenum
  fetch next from serial_no into @gdocentry,@gitemcode,@glinenum
  end
  Close serial_no
  deallocate serial_no
  end
END
Thanks,
Raphael

Similar Messages

  • I recently subscribed to Acrobat XI after the trial expired but when I went to activate it I was asked for the serial number. I only have the order number on the invoice. How do I get the serial number for the trial software that is on my computer?

    I recently subscribed to Acrobat XI after the trial expired but when I went to activate it I was asked for the serial number. I only have the order number on the invoice. How do I get the serial number for the trial software that is on my computer?

    Please do not try to send attachments in mail responses to forum messages. Please return to the forum and click Reply. You can then use the CAMERA icon to add your pictures. Looking forward to seeing what is wrong with your license screens - the general advice is simply to sign in, and everything is done. Make sure you use the SAME Adobe ID that you used to purchase, and check your account details to be sure the subscription is active.

  • Hard drive crashed, replaced drive and need to reinstall CS5 Extended but I don't have serial number, only product code on box. How do i get my serial number?

    hard drive crashed, replaced drive and need to reinstall CS5 Extended but I don't have serial number, only product code on box. How do i get my serial number?

    Beamer96 if the software has been registered then it will be under your account at http://www.adobe.com/.  You can find more details at Find your serial number quickly - http://helpx.adobe.com/x-productkb/global/find-serial-number.html.

  • How can I get my serial number for my iphone only with the imei because my iphone was stolen

    My iphone was recently stolen and I really need to get the serial number I only have the imei number and the bastards have got it offline so find my iphone can't track it.
    Please help

    Read the ENTIRE article before asking another question:
    http://support.apple.com/kb/HT4061

  • My phone is stolen i need to get the serial number but i only have yje IMEI what should i do how can i get my serial number

    my phone is stolen i need to get the serial number but i only have yje IMEI what should i do how can i get my serial number

    Why do you need the serial number? The phone can't be tracked by either serial number or IMEI.
    See this article:
    http://support.apple.com/kb/HT4061

  • HT4061 It looks like I've only backed up my iphone, not my ipad. I believe I registered the ipad when I bought it. Is there a way to get my serial number from that?

    It looks like I've only backed up my iphone, not my ipad. But I know I registered it when I got it. Is there some way to get the serial number that way?
    My ipad was stolen and the police have requested the serial number.
    How can I find it?

    My Support Profile

  • HT4061 My Child has disabled my ipad mini...It ran out of charge and now is disabled for 22928370 minutes, what can I do as I cant get onto the ipad to get the serial number to speak to an advisor and its only 10 months old. HELP!

    Please help me....
    My Child has disabled my ipad mini...It ran out of charge and now is disabled for 22928370 minutes, what can I do as I cant get onto the ipad to get the serial number to speak to an advisor and its only 10 months old. HELP!

    Hello Jesslocko,
    Before following the iPad Restore process make sure you have updated version of iTunes installed on your computer, to check that Open iTunes on your computer click on Help and then check for updates ( If there is any updates available then Install it ) and If you do not have iTunes Installed or if you want to directly update the version of your iTunes then Download and Install iTunes from here : http://www.apple.com/itunes/download/
    1. Make sure your device (iPad) is unplugged (Disconnected) from your computer (this should be the computer that you use to sync your iPad or you can use any other computer with iTunes installed in it). You can leave the USB cable connected to your iPad though.
    2. Turn off your iPad. Press and hold the power button on the top edge until a slider appears. Slide it from left to right to power off your device. If the slider doesn't appear (because your iOS device has frozen up) then hold the power and Home buttons down until the iPhone or iPad turns off.
    3. Ensure your device has a decent amount of charge. Leave it plugged in to the mains for 10 minutes or so if you see the flat battery icon. (iPad low battery)
    4. Hold down the Home button (the round button at the bottom of your iPad screen) and connect the other end of USB cable to the computer this should cause your iPhone or iPad to turn on. Keep holding the Home button until you see the iTunes and USB cable images on your iPad screen, then release the button.(iPad recovery mode)
    5. In iTunes (launch the application if it isn't running on your Computer), you should see a message saying an iPad has been found in recovery mode.
    6. Click OK and then click on Restore to bring your iPad to Factory settings

  • I still use CS3, yes it's true.  Can I some how get a serial number for CS2?b

    I still use CS3, yes it's true.  However, I have my upgrade copy only, not my CS2, and I just purchased a new iMac Mini.  Therefore, I do not have my SN for CS2.  Can I some how get a serial number for CS2?  I found a link with SN's but none worked.  I wo

    There is a SPECIAL serial number for CS2 that will probably not work for a CS3 upgrade http://helpx.adobe.com/x-productkb/policy-pricing/creative-suite-2-activation-end-life.htm l
    You may still buy CS6 which has a perpetual license... Premiere Pro to get the bundled Encore Creative Suite 6

  • I bought a volume license for CS6. How do I now get a serial number for prior version (CS5.5)?

    I bought a volume license for CS6 Design Standard. Because of my system restrictions for now I can only run a prior version (CS5.5). I have also previously downloaded its trial version which works perfect. Now, after buying a license for CS6 I would like to get a serial number for a prior version as well. How would I go about receiving it?
    Many thanks in advance!
    Nelle

    Hi Nelle,
    You can request downgrade from Adobe, but you can't get back to CS6 after that, so it might be better to upgrade your system?
    Anyway, in my laptop CS6 has been running faster and better than CS5.5 without any changes to system, so you could give it a try before downgrading...
    Joni

  • HT204204 I need help talking to a person. My phone is not working so I can't call and i can't get the serial number to get ahold of anyone. what do i do

    How do i get ahold of a real person? My phone is only showing a black screen so I can't get on it to get the serial number or call anyone. please help

    http://www.apple.com/support/iphone/contact/

  • My Ipad was stolen - how do I get my serial number so I can lock it.

    My Ipad was stolen, how do I get my serial number so I can lock it?

    The serial number will be located in the box the device came in.
    However, having the serial number will not help you lock it.
    The only way to lock it would have been if you set up Find My iPad on iCloud.com and the iPad.
    you could then go to iCloud.com and lock it from the "Find my iPhone" section of the website.

  • I have just purchased Lightroom 5 and cannot get a serial number as it says the redemption service is unavailable, how do I get my Serial number, using my Abruf-Code pls?

    I am trying to get a serial number for my purchased version of lightroom 5, using the Abruf-code, but keep being told the redemption service is unavailable,a nd the website I am given in the packaging sends me to an error page. Pls help as I am about to launch 130 Euros of software of the balcony.

    I don’t think there are many “must have” features in PSE13 especially if you are doing most of your editing non-destructively in Lightroom and only going to the external editor occasionally.
    https://forums.adobe.com/message/6761649#6761649

  • How can I get a serial number for Illustrator CS5?

    How can I get a serial number for Illustrator CS5 when I have a complete CC subscription?
    I have a GCC Expert 24 plotter running on OS X and the direct cut plugin is only compatible with CS5 or earlier.
    I have tried asking in support chat but it never actually works, my next option is to ring or get a cracked version but i'm trying to avoid both of those options if I can.
    Thanks.

    xdmg,
    In addition to what Lutz said, unless you buy a CS5 that is still new and unused, you will need a licence transfer through Adobe,
    http://helpx.adobe.com/x-productkb/policy-pricing/transfer-product-license.html
    and the application must be deactivated on any machine it has been installed on.

  • I can't get my serial Number after downloading the trial version of DreamWeaver CS5.?

    Hi there,
    After downloading the trial version Of Adobe Dreamweaver CS5.5, I had to type in the serial number to actually use the product but I can't find the serial Number anywhere and now i don't  know what to do because it is a trial version and so I can only use it for 30 days. Hope someone can help!

    No, but when i downloaded the trial from the official Adobe website it said that i would get the serial number or something. At first the software wasn't working but after restarting my PC it started working! Thank you for answering!

  • Where can I get the serial number for my original copy of Aperture?

    I have the aperture 3 software ready to install, but I cannot go farther until I have the serial number from the copy I am upgrading. How can I get the serial number for the older version of Aperture? My current version is 1.5.4. Any help you can give me is appreciated!

    Is there any place to find the original serial number other than "the sheet in the box". My original is v 1.1 (now running 2.x) & I'm double stuck - trying to migrate to a new PowerBook and upgrade to 3.0 - both tasks needing the original serial number. The box is long gone (first installed aperture at least 3 years ago) and serial recorded in my personal log has transposed or dropped digits - i.e. corrupted. The option to get a replacement serial from Apple is a long shot as well - only "proof" of purchase is that I have the original disk and the original user manual. Can't remember which store I bought it at nor would they have records that old. There has got to be some way to decrypt it from the various system files (preferences and application support)- any suggestions?

Maybe you are looking for