Sp  transaction  notification  to control  docdate

Hi,
i've  this problem.  i've  Sales  Invoceis  ( OINV)  and  Credit  Notes (ORIN)  with  the  same  series
i  want  to  control,  by  sp  transaction  notification,  that  the user does   not  insert,  for  this  series, a  new  document  with  a  docdate  <  then  the  last  date  insert  about   OINV  or  ORIN   ( because  these  have  the  same  series)
i've  create  this  procedure:  but  i'm  not  able   to  control  docdate  about  OINV  and  ORIN together
DECLARE @GroupCode SMALLINT
     DECLARE @DocDate DATETIME
     DECLARE @MaxDocDate DATETIME
     DECLARE @Series INT
     DECLARE @NumAtCard NVARCHAR(100)
     DECLARE @Conta INT
     DECLARE @CardCode NVARCHAR(15)
    DECLARE @IdUtente SMALLINT
--     ADD     YOUR     CODE     HERE
-- Select the return values
IF @object_type = '13' AND @transaction_type = 'A'
          BEGIN
               SELECT @Series = OINV.Series,   @DocDate = DocDate
               FROM OINV   WHERE OINV.DocEntry = @list_of_cols_val_tab_del 
               BEGIN
                    /* 1. inserendo una fattura di vendita la data non deve essere precedente
                           a quella dell'ultima fattura per la stessa serie */
                    --Reperisco la serie a cui il documento appartiene
                    SELECT @MaxDocDate =   MAX(@DocDate)
                    FROM OINV
                    WHERE OINV.Series = @Series AND OINV.ObjType = @object_type
                    IF @DocDate < @MaxDocDate
                    BEGIN
                         SELECT @error = 1002,
                         @error_message = 'La data del documento non può essere precedente a quella dell''ultimo inserito ' + CONVERT(VARCHAR, @MaxDocDate, 103)
                    END

Hi,
Correct this
SELECT @MaxDocDate = MAX(@DocDate)
FROM OINV
WHERE OINV.Series = @Series AND OINV.ObjType = @object_type
to
SELECT @MaxDocDate = MAX(DocDate)
FROM OINV
WHERE OINV.Series = @Series AND OINV.ObjType = @object_type
Thanks
Malhaar

Similar Messages

  • Notifications and control panel do not work on either the app screen or home screen

    On my home screen and in apps, I can not swipe up or down to release the notifications or control panel. It has worked earlier today, however not any more.
    I can, however, access them in the lock screen, andin settings, they are allows to open in apps. It should always allow me to access them in the home screen though, so I do not know what has happened.
    What do I have to do to access the control panel in the home screen, and why is it like this?

    Do you have a screen protector or case that would interfere with swiping?
    If so remove them as a test.
    Otherwise:
    - Reset the iOS device. Nothing will be lost      
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Reset all settings                            
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:                                               
    iOS: Back up and restore your iOS device with iCloud or iTunes      
    - Restore to factory settings/new iOS device.                       
    If still problem, make an appointment at the Genius Bar of an Apple store since it appears you have a hardware problem.
      Apple Retail Store - Genius Bar                                              

  • After updating to iOS 8 notification and control center won't open when unlocked

    Ever since I updated my iPhone 5s to iOS 8, the notification and control center will not open while my phone is unlocked. I checked to see if I had it disabled in settings and it turns out I did not. I switched the Access Within Apps as well as the Access While Locked on and off anyway but still nothing. I can only pull the notification and control center open while my phone is locked... it is extremely annoying. I know I'm not the only one though because my friend who updated to iOS 8 on his 5c was having the exact same problems. Some help would be much appreciated. Thank you!

    So yesterday vibration suddenly started working again, after nearly two weeks with the problem above. I have no idea why, I didn't change any settings and the only app that was updated yesterday was Facebook messenger...

  • Unique Value Transaction Notification

    Hi Experts
    I have a problem in Transaction Notification
    I have a one UDF and i dont want to repeat the value . so i want to restrict if the value has repetead then system block me to add the sales invoice .
    my code is
    If @transaction_type = 'A' And @object_type = '17'
    Begin
    if exists (
    select u_dd_amt from ordr a where exists
    (select 1 from ordr where u_dd_amt =
    a.u_dd_amt)
    and  u_dd_amt =
    @list_of_cols_val_tab_del
    Begin
         select @error = 1, @error_message = 'Duplicate value not allowed in DD Amount field'
       end
    end
    the always error msg occured whenever i type any valye in UDF field please help me

    Buen dia Douglas,
    No es posible realizarlo ya que como tu indicas no tiene un Objtype, para poder realizar un transaction debe existir un Objtype.
    Saludos,
    Wuilmer venegas

  • SBO_Post Transaction Notification

    SBO_Post Transaction Notification
    Hi Experts!,
    I´d like to get information about this Stored Procedure, can somebody give me any link, papers, etc?
    Regards,
    Ronald

    Hi Ronald ,
    Files are located in SBO_Knowledge_village group and below i paste is the link ,
    Jimmy Michael (See top contributors Gordon,Suda,..Jimmy) is the moderator of the form .Ask him to join you in this group . You can acess more documentation .
    http://tech.groups.yahoo.com/group/SBO_Knowledge_Village/files/Files/
    Thank you
    Bishal

  • Outgoing Payment Transaction notification...

    Hi all,
    I designed the following Transaction notification for outgoing payment.It is working well If doctype is 'C' or 'S'. I want to do this for Doctype 'A'. But not successful....
    Waiting for your replies..
    IF @transaction_type = 'A' AND @object_type = '46'
    BEGIN
    --If exists (SELECT T0.docentry  FROM OVPM T0 where t0.docentry = @list_of_cols_val_tab_del and T0.cashsum>=20000000)
    --     begin
    --          SET @error = 10
    --          SET @error_message = N'You cannot Pay Cash More than Rs. 2000/-'
    --     end
    If not exists (SELECT T0.docentry  FROM OVPM T0  where t0.docentry = @list_of_cols_val_tab_del and
    (((t0.cardcode like '%%VDLI%%' or t0.cardcode like '%%CDLI%%' ) and t0.Series = '61' and (t0.doctype = 'S' or t0.doctype = 'C'   ))
    or ((t0.cardcode like '%%VAHD%%' or t0.cardcode like '%%CAHD%%' ) and t0.Series = '64' and (t0.doctype = 'S' or t0.doctype = 'C'  ))
    or ((t0.cardcode like '%%VMUM%%' or t0.cardcode like '%%CMUM%%' ) and t0.Series = '63' and (t0.doctype = 'S' or t0.doctype = 'C'  ))
    or ((t0.cardcode like '%%VLDH%%' or t0.cardcode like '%%CLDH%%' ) and t0.Series = '66' and (t0.doctype = 'S' or t0.doctype = 'C' ))
    or ((t0.cardcode like '%%VKOL%%' or t0.cardcode like '%%CKOL%%' ) and t0.Series = '62' and (t0.doctype = 'S' or t0.doctype = 'C' ))
         begin
              SET @error = 11
              SET @error_message = N'BP Code,Location ,Series ,Tax code combination does not match'
         end
    END
    Regards
    Deepak tyagi

    Hi Deepak,
    Try this way:#
    if @object_type='46'
    BEGIN
          IF @transaction_type='A' OR @transaction_type='U'
          BEGIN
                DECLARE @OPCHDocEntry int
                DECLARE @OPCHDocType nvarchar(1)
                 SET @OPCHDocEntry = CAST(@list_of_cols_val_tab_del as int)
                SET @OPCHDocType = (SELECT DocType FROM OPCH WHERE DocEntry=@OPCHDocEntry)
            IF @OPCHDocType in ('S','C')
                BEGIN
                    If not exists (SELECT T0.docentry  FROM OVPM T0  where t0.docentry = @list_of_cols_val_tab_del and
                                  (((t0.cardcode like '%%VDLI%%' or t0.cardcode like '%%CDLI%%' ) and t0.Series = '61' and (t0.doctype = 'S' or t0.doctype = 'C'   ))
                                  or ((t0.cardcode like '%%VAHD%%' or t0.cardcode like '%%CAHD%%' ) and t0.Series = '64' and (t0.doctype = 'S' or t0.doctype = 'C'  ))
                                  or ((t0.cardcode like '%%VMUM%%' or t0.cardcode like '%%CMUM%%' ) and t0.Series = '63' and (t0.doctype = 'S' or t0.doctype = 'C'  ))
                                  or ((t0.cardcode like '%%VLDH%%' or t0.cardcode like '%%CLDH%%' ) and t0.Series = '66' and (t0.doctype = 'S' or t0.doctype = 'C' ))
                                  or ((t0.cardcode like '%%VKOL%%' or t0.cardcode like '%%CKOL%%' ) and t0.Series = '62' and (t0.doctype = 'S' or t0.doctype = 'C' ))
                        begin
                                            SET @error = -1000
                                            SET @error_message = N'BP Code,Location ,Series ,Tax code combination does not match'
                        end
                END
             IF @OPCHDocType ='A'
             BEGIN
               If not exists  (SELECT T0.docentry FROM OVPM T0 INNER JOIN VPM4 T1 ON T0.DocEntry = T1.DocNum and t0.docentry = @list_of_cols_val_tab_del and
                                                 (t1.acctcode like '%%ADLI%%' and t0.Series = '61' and  t0.doctype = 'A' and T1.LocCode = '1' )
                                                 or (t1.acctcode like '%%AAHD%%' and t0.Series = '64' and  t0.doctype = 'A' and t1.LocCode = '2' )
                                                 or ( t1.acctcode like '%%AMUM%%' and t0.Series = '63' and  t0.doctype = 'A' and t1.LocCode = '3' )
                                                 or ( t1.acctcode like '%%ALDH%%' and t0.Series = '66' and  t0.doctype = 'A' and t1.LocCode = '5')
                                                 or ( t1.acctcode like '%%AKOL%%' and t0.Series = '62' and  t0.doctype = 'A' and t1.LocCode = '4')
                BEGIN
                            SET @error=-1001
                            SET @error_message = N'BP Code,Location ,Series ,Tax code combination does not match'
            END   
          END
    END
    END
    Thanks,
    Neetu

  • Transaction Notification for Restrict user to delere row but new item addition will allowed in Production Order

    Dear All Experts,
    My client having some custom requirement in Production Order.
    1) When Production Order will created and its status will released then it will allowed user to update any quantity of any items or add any new items but it will not allowed to delete any items from row level.
    2) When any item will be deleted then our transaction notification will be raised.
    I created one Transaction Notification Code but it will restricted to update anything or delete.
    IF (@transaction_type = 'A' or @transaction_type = 'U') AND @object_type = '202'
    BEGIN
    Declare @VisOrder1 nvarchar(255)
    Set @VisOrder1=(SELECT Top 1 T1.VisOrder+1 FROM OWOR T0 INNER JOIN WOR1 T1 ON T0.DocEntry = T1.DocEntry 
    WHERE (T0.Status = 'R' and T1.VisOrder=(select TOP 1 VisOrder from wor1 where DocEntry=@list_of_cols_val_tab_del order by VisOrder Desc)))
      If @VisOrder1 >0
      begin
      SET @error = 231
      SET @error_message =  'You have not rights to delete any Item - Please Contact System Administrator ' + @VisOrder1
      end
    END
    Please help me for solve this problem.
    I wait for your warm replay.
    Thanks & Regards,
    Nishit Makadia

    Hi,
    Please check these threads. Let me know your feedback.
    http://scn.sap.com/thread/3518208
    http://scn.sap.com/thread/3545101
    Thanks & Regards,
    Nagarajan

  • Transaction Notification with DI Server

    Hello
    I am developing a Web Site with the DI Server, when I have validations in the Transaction Procedure the error  message is incorrect.
    Message: Could not commit transaction.
    Transaction Notification
    set @error='10'
    set @error_message = 'SP: 123'
    -- Select the return values
    select @error, @error_message
    end
    I made the test with the DI - API  and the message is correct.
    Exists a workaround for this problem???
    Thanks
    Regrats
    Edited by: Andres Naranjo on Sep 1, 2010 1:25 AM

    Hello
    This problem was solved in SAP Business One 8.8 PL20.
    Regards

  • Approval procedure vs Transaction Notification

    Hello dear experts,
    I have an issue with the approval procedures and the validations I have to do using the Transaction Notificacion Stored procedure.
    this is the scenario and conditions to consider:
    1.A purchase order (Doctotal) that are between 0 and 25,000 USD needs an approval.
    2. A purchase order needs to have all the project column filled in before the approval procedure. this column is in the detail of a document, so all the rows have to be filled in with the right project code otherwise when your request have been submmited and your receive the approval you are not allowed to do any changes in the Detail Document.
    I realized that the approval procedure is launched before the Transaction Notification SP.
    So I decided to add a query for the approval procedure considering the validations in the project column:
    SELECT distinct 'true'
    FROM OPOR
    WHERE $[OPOR.DocTotalSy.number] Between 0 and 24999.99   ---This part works perfeclty!!!
    AND LEN(isnull($[POR1.Project.0],''))>0 and $[POR1.U_SubJob.0]>0  )  --This part does not work
    As you see in the query, I am trying to validate that all the rows have the project code (Project) and a UDF (U_SubJob) filled in.
    Have anybody been done this before? How can I access to the detail values of the document? It is easy to acces values on the header.
    I appreciate any help on this. Thank you very much
    Regards,
    Mary

    Hi,
    You must use both in approval procedure or use both in SBO store procedure transaction notification.
    To request approval for a project, you this following approval query:
    if (SELECT $[$38.31.0]) > ' '
    select 'true'
    the other query is for doctotal approval as follows:
    if ($[opor.doctotalsys.number]) between 0 and 24999.99
    SELECT 'true'
    or
    select distinct 'true' FROM OPOR
    WHERE $[OPOR.DocTotalSy.number] Between 0 and 24999.99
    Both are able to use and work simultanously.
    JimM

  • Transaction Notification for Blocking Batch

    Dear Experts,
    I am facing a critical situation. My Client wants to Block the material movement  if it is not inspected through Quality Personal. I have already Locked batches through General Settings > Inventory > Batch Status . But it only blocks the batches for Goods Issue and Receipts Transactions. It is not working in case of Inventory transfers.
    I have created UDF on GRPO called U_InspStatus where by default value is Pending once the Quality personal changes the UDF value to Completed then only the batch should be able to move through Inventory Transfer.
    Can anyone help me in creating Transaction Notification on Inventory Transfer Document  which can block batches if there status is pending ?
    Waiting for your replies.
    Regards,
    RK

    Hi Naga,
    Please find below mentioned answer to your queries -
    1. Inventory transfer done by means of posting inventory transfer document? - Yes
    2. Inventory transfer as applicable to customer not vendor. How do you select vendor in inventory transfer document? - Not selecting the customer in Inventory Transfer document not required I am moving material from one warehouse to another.
    3. How did you update inspection status in inventory transfer document - Inspection status is updated in Quality Add on and not in Inventory Transfer. But if I am transferring material from one warehouse to another without Inspection then it should block the batch whose Inspection status is pending.

  • Transaction Notification Considering Old transaction as well

    Dear Experts,
    If (@transaction_type = 'A' AND @Object_type = '140000009')
    begin
    if exists (SELECT T0.DocEntry FROM OOEI T0 WHERE (T0.U_ModVatCatg = 'N' AND T0. Series = 34) or (T0.U_ModVatCatg = 'M' AND T0. Series = 40) and T0.DOCENTRY = @list_of_cols_val_tab_del)
    select @Error = 1, @error_message = 'Wrong Series Selected for the given MODVAT Category'
    end
    The above transaction notification is written to check the series with a UDF. It was working fine till a few days back.
    However, a historical transaction was needed to be updated in a way that the condition in the transaction notification was not met.
    After having updated the transaction, this notification blocks all further documents even though the condition is satisfied.
    It seems the transaction notification is also considering the historical transaction and hence blocking the new transactions. However, this is not the way transaction notifications are meant to work.
    Kindly advise on how to over come this issue.
    Regards,
    Jimit

    Hi Jimmit,
    Seems you have 3 condition here
    1. (T0.U_ModVatCatg = 'N' AND T0. Series = 34)
    2. (T0.U_ModVatCatg = 'M' AND T0. Series = 40)
    3. T0.DOCENTRY = @list_of_cols_val_tab_del
    You place OR between 1 and 2, and place AND between 2 and 3, but no bracket to group condition 1 and 2.
    Seems fishy, try this
    if exists
    SELECT T0.DocEntry FROM OOEI T0
    WHERE ((T0.U_ModVatCatg = 'N' AND T0. Series = 34) or (T0.U_ModVatCatg = 'M' AND T0. Series = 40))
                  and T0.DOCENTRY = @list_of_cols_val_tab_del
    Hope this help.
    Best Regards,
    Hendry Wijaya

  • Transaction Notification - User Table

    Hi experts.
    I'm wondering if it's even possible to create an IF statement on SAP Transaction Notification that looks up to an user table.
    Regards,
    Eduardo Araujo.

    So, I take this and I use the name of my table instead of "@PODGRUPA"?
    @EDIT
    I've tried this:
    IF(@object_type = '-3 @FLAGCADPAC' AND @transaction_type IN ('A', 'U'))
    BEGIN
    IF (1=1)
    BEGIN
    SET @error = 1
    SET @error_message = 'Teste'
    END
    END
    But with no success.
    I've tried "IF (1=1)" o make an test if it works.
    Between "-3" and my table name, I've used TAB, space, and even without anything between them, but no success too.
    Regards.

  • Transaction Notification - Consulta

    Hola Comunidad SAP en español,
    Quiero consultar de que manera puedo hacer lo siguiente en el transaction notification:
    Necesito que cuando una orden de venta sea ingresada, la misma pueda ser modificada en sus valores, siempre y cuando se mantenga el precio establecido y que uno de los campos de usuario sea  el mismo.
    Como puedo realizar esto?
    Muchas Gracias.
    Saludos,
    Guillermo.-

    Revisa estas soluciones que propuse, te pueden dar una idea
    [Re: TRANSACTION NOTIFICATION, COMO BLOQUEAR CAMPO CARDNAME EN DATOS MAESTROS-SN]

  • Transaction Notification - Journal Entry

    Dear Experts,
    Can anyone tell me how to validate Journal Entry line wise using Transaction Notification Stored Procedures. I want to validate each and every row of the Journal Entry.
    Thanks in advance
    Regards
    Neslin 

    Hi,
    Please close this duplicated thread. Check this announcement:
    FYI
    Thanks & Regards,
    Nagarajan

  • TRANSACTION NOTIFICATION PARA ORDENES DE PRODUCCION

    BUENAS TARDES. ALGUIIEN QUE ME PUEDA DECIR PARA QUE SIRVEN LAS SIG. LINEAS DEL TRANSACTION NOTIFICATION
    @num_of_cols_in_key int,
    @list_of_key_cols_tab_del nvarchar(255) SE QUE ESTE TOMA EL VALOR DEL CAMPO CLAVE DE LA TABLA SOBRE LA CUAL HACEMOS EL CODIGO.
    @list_of_cols_val_tab_del nvarchar(255)
    Y SI ALGUIEN A CONSEGUIDO BLOQUEAR UNA ORDEN DE PRODUCCION PARA QUE NO PUEDA SER CERRADA SI NO HAN INGRESADO LOS PRODUCTOS QUE SE FABRICARON.

    Hola...
    Hace tiempo que no pasaba por acá, revisa el siguiente post..
    Espero te sea de ayuda
    Saludos,

Maybe you are looking for

  • How to connect ndr3700 to airport extreme

    how do i connect my extreme to existing netgear NDR3700

  • SQL *Plus Function

    Is there a reason why my system account is not listed when I try and generate the listing of users assigned the sqlplus function? I'm using the query "select * from product_profile" Edited by: 997626 on Apr 2, 2013 2:03 PM

  • How to cancel update firefox 29.0?

    How to cancel update firefox 29.0? I want back my Firefox 28.0 !

  • Unable to empty trash after upgrading to Lion

    I recently updated to 10.7 Lion and now cannot empty my trash either by right-clicking and selecting empty trash and also accessing the Finder menu and selecting empty trash or secure empty trash. I can hear the standard empty trash sound clip but al

  • 5.1 sound while in Vista - only Stereo in Game

    OS: Windows Vista Ultimate 32Card: Sound Blaster X-Fi XtremeGamer Fatalty Professional SeriesDriver: Latest CL DriverGame: America's Army 2.8. uses OpenAL sound 5.1 sound works fine while in Vista, but when I play game it's only in stereo. If I tab o