Prevent Adding AR Invoice twice

i got a problem Adding A/R Invoice from Draft Document, i need to check wether the A/R Draft U_InvoiceCode(UDF) already exist in AR Invoice, if it is then user can't added again
my colleague said something about SBO_SP_TransactionNotification but i'm blank about it
any idea?
thanks,
erick

Erick,
add into trasactnotification stored procedure lines
if @object_type = '13'  and @transaction_type= 'A'
begin
     if 1 < (select count(docentry) from oinv with(nolock) where U_InvoiceCode = (select top 1 U_InvoiceCode from oinv where docentry =@list_of_cols_val_tab_del)
     begin
          select @error =1
          select @error_message = 'Duplication of invoice.'
     end
end
hope it helps
Petr

Similar Messages

  • Prevention of posting invoices twice

    Hi All
    I need suggestions and solutions on the below
    scenario, where client wants to have the check
    for Duplicate Vendor invoice posting with below
    conditions
    1.If only reference number and amt are matching.
    2.Also a warning must appear when same vendor,
    same document date and same amount  appears
    Pls let me know what are the possibilities are there for this issue...
    Points will be provided
    Regards
    AA

    Hi AA,
    All that you need to do is that, goto document type in TCode OBA7 and for the document type KR and for all other documents which are vendor related, you need to flag the "Reference Number" Checkbox.
    In the reference field, the client generally enters the physical invoice number of the vendor invoice. 
    Once an invoice is posted say with refernce number ZA1 and saved, the system automatically throws an error message when the client tries to post another invoice with the same reference number to the same vendor once again there by avoiding any duplicate invoices being posted.
    Hope this answer helps you.  Please assign points if found useful.
    Regards,
    Sreekanth....

  • Error on Adding AR Invoice

    Hi Experts,
    We have error on adding AR invoice (AR), Delivery (AR), Goods Receipt PO (AP), AP Invoice (AP). Please help on this error..
    below is the error message:
    [microsoft] [SQL Native Client] [SQL Server] Conversion failed when converting the nvarchar value '65002 0' to data type int. (CINF)
    Thanks,
    John

    Hi Jon,
    What Rahul meant was, if you have certain user defined fields or tables in SAP B1, these user defined fields can have some data or queries. This data or data returned by queries may have some strange characters in them. So he asked you to disable all your FMS fields and then test to ensure the error.
    I found one more link, they have similar problems as yours due to Store Procedures they had and migrated from 2007A to 8.8. Could this be your situation? Please read through this link - [Microsoft][SQL Native Client][SQL Server]Conversion failed when converting and note the SAP B1 notes.

  • I want to create a query to send auto email to customer while adding AR Invoice

    Hi
    Friends
    I want to create a query to send auto email to customer while adding AR Invoice in SAP Business One 8.82.
    using the following fields & Text like
    email ID from - BP Master
    ' Dear Sir '
    Invoice is generated on the name  ---  BPName
    Quantity                                     ---  22.5 Tones
    Invoice Value                              ---   85,000/-
    date & Time                               ---  12-07-2014 : 16:18
    Thanks & Regards
    XXXXXXXXXX
    Please tell me how to set this in SAP B1.
    Srinivas

    I want to to send email to customer automatically the current invoice details while adding AR Invoice in SAP Business One 8.82.
    using the following fields & Text like
    email ID from - BP Master
    ' Dear Sir '
    Invoice is generated on the name  ---  BPName
    Quantity                                     ---  22.5 Tones
    Invoice Value                              ---   85,000/-
    date & Time                               ---  12-07-2014 : 16:18
    Thanks & Regards
    XXXXXXXXXX
    Please tell me how to write query in stored procedure to send email automatically.
    Srinivas

  • HT2905 How can I prevent from being billed twice?

    My download was interrupted. When it resumed, it resulted in a double download. How can I prevent from being billed twice?

    If your phone is locked with a passode, photos & videos, in your camera roll, cannot be imported to a computer, unless that computer was previously used with the phone, while the passcode was in effect.

  • Error when adding AP invoice

    Dear All,
    I find an error appears when adding AP invoice, the error message is:
    there is a different between document total and its components[A/P invoice - Rows - Warehouse code][line : 0][message 439 - 138]. I could not add the AP invoice because of this error. Please give advice. Thanks
    Rgds,

    Hello,
    I am trying to replicate your problem but fails. Maybe you could try to duplicate the row line that the components exist by right click --> duplicate and then delete the old row where it has been used to add AP invoice previously.
    IF the problem still persists, just contact SAP support.
    Rgds,

  • How to resolve 'APP-AR-11651: You have paid the same invoice twice.'?

    AR module,
    when I made a receipt to apply a same invoice twice and saved, a message 'APP-AR-11651: You have paid the same invoice twice. Please correct.' came out.
    if I do want to apply the same invoce twice ,how to resolve?
    thanks

    release 115.9
    OK,the problem has been solved.
    I just need to add a line number on apply line.
    regards

  • Prevent adding components

    Hi All,
    How to prevent adding components while goods issue in a maintenance order.
    Thanks in advance
    Surya

    Hi Gurus
    Still trying to explore on it.
    What is the consequence if I uncheck the box UNPLANNED GOODS ISSUE in the IMG activity for Define Documentation for Goods movements for the Order?
    Path: SPRO>PMCS>Maintenance and Service processing>Maintenance and Service Orders>Functions and settings for Order types>Goods movements for order>Define Documentation for Goods movements for the orders.
    Thanks in advance
    Surya

  • How to Prevent/Control doing MIGO twice for the same material

    Dear
    The stores clerk by mistake has done MIGO twice for the same material.  Is there any way to prevent/check the same in standard SAP?  Vendor does not send the invoice/delivery challan to stores directly.  Invoice is sent to Finance Department. 
    Regards

    It is very unlikely that you could spec an ABAP solution to this problem.
    You may be able to spec an exit that would prevent GR being carried out for a PO Item twice on the same day.  But that is not infallible, as there may be valid circumstances when you would need to carry out two GR's for a PO item on the same day.  A fix for a small problem that creates a large one is not a good fix.
    You also need to ask how big this problem really is - if a user duplicates a goods receipt every once in a long while then you probably do not have a serious problem.
    Rather than look at a system fix for the error, I would suggest that you look at what you can do to improve the physical process.

  • Prevent adding udo by bubbleevent

    hi,
    i want to prevent to add the udo document by using bubbleevent=true
    Private Sub moSboApplication_FormDataEvent(ByRef BusinessObjectInfo As SAPbouiCOM.BusinessObjectInfo, ByRef BubbleEvent As Boolean) Handles moSboApplication.FormDataEvent
            Select Case BusinessObjectInfo.EventType
                Case SAPbouiCOM.BoEventTypes.et_FORM_DATA_ADD
                    If BusinessObjectInfo.FormTypeEx = "FrmSeparate" And BusinessObjectInfo.ActionSuccess = False Then
                        oForm = moSboApplication.Forms.Item(BusinessObjectInfo.FormUID)
                        If gocSeparate.book(oForm) = False Then
                            BubbleEvent = True  'error happened, do not save udo now
                        End If
                    End If
                    If BusinessObjectInfo.FormTypeEx = "FrmSeparate" And BusinessObjectInfo.ActionSuccess = True Then
                        'UDO is added, so write docnums into documents purchase invoice, goods issue, goods receipt
                        gocSeparate.writeDocnumInDocuments()
                    End If
    the bubbleevent=true is set (i checked it with my debugger), but it doesen't interest the sap-system, because the debugger is afterwards jumping to my second if-Block actionsuccess=true. The document (udo) is added.

    quit a simple mistake:
    i have to set the bubbleevent=false

  • DI API error while adding AP Invoice (Using serial Nos.)

    Hi,
    Im getting the following DI API error when adding an AP Invoice which has serial numbers and i cant seem to find any logical fault in the code.
    " [PCH1.WhsCode][line: 4] , 'This entry already exists in the following tables (ODBC -2035) "
    If anybody has encountered this error and found a solution kindly let me know.

    Hi Vivek,
    Are you trying to add same document number, serial number or so on?
    "entry exist " means like "duplicate key problem", I guess.
    Basically, whscode column in PCH1 table allows duplicating.
    So, I think serial number is duplicated among same item code.
    Hope this useful for you.
    Regards,
    Hyunil Choi.

  • A/P Invoice Vendor Ref Number Field updating after adding the Invoice Copy

    Hi All,
                  I am able to change the Vendor Reference number in A/P Invoice Document after adding the Document.  I want to restrict this to happen. Plzz help how to do this????
    Regards,
    Sree.

    1.The Modify Posted A/P Documents authorization refers to some fields only, e.g. the Due Date or Pay to address.
    2. Additional authorization can be defined only for full forms, not for fields.
    3. The SP Joseph suggests will refuse those modifications when the Vendor ref is empty.
    To avoid modifying the Vendor ref you can use this code:
    IF @Object_type = N'18' and @transaction_type = N'U'
    BEGIN
    declare @li int
    set @li=
    (select max(t.LogInstanc)
       from ADOC t
       where t.ObjType=18 and t.DocEntry=@list_of_cols_val_tab_del)
    IF
       (select isnull(t.NumAtCard,'')
        from ADOC t
        where t.ObjType=18 and t.DocEntry=@list_of_cols_val_tab_del
          and t.LogInstanc=@li-1)
    !=(select isnull(t.NumAtCard,'')
       from OPCH t
       where t.DocEntry=@list_of_cols_val_tab_del)
    begin
      Set @error = 10
      Set @error_message = N'Vendor refernce not modifiable !'
    end
    END
    Or if you want to allow modifying an unfilled reference, then this:
    IF @Object_type = N'18' and @transaction_type = N'U'
    BEGIN
    declare @li int
    declare @pref nvarchar(100)
    set @li=
    (select max(t.LogInstanc)
       from ADOC t
       where t.ObjType=18 and t.DocEntry=@list_of_cols_val_tab_del)
    set @pref=
    (select isnull(t.NumAtCard,'')
        from ADOC t
        where t.ObjType=18 and t.DocEntry=@list_of_cols_val_tab_del
          and t.LogInstanc=@li-1)
    If @pref !='' and @pref !=
    (select isnull(t.NumAtCard,'')
       from OPCH t
       where t.DocEntry=@list_of_cols_val_tab_del)
    begin
      Set @error = 10
      Set @error_message = N'Filled vendor refernce not modifiable !'
    end
    END

  • Get Invoice Number after adding the invoice

    Hi,
       I am adding a service invoice to SBO using the DI api. I am able to create the Invoice successfully. Immedietly after I execute the Invoice.Add line, I would like to get the Docentry that was assigned to the invoice. What is the bst way to do this? Appreciate any help you can give me.\
    See code I am using:
    private void CreateSAPServiceInvoice()
                   SAPbobsCOM.Documents oServiceInvoice;//ChargeBack Invoice.
                   SAPbobsCOM.Documents oPaymentInvoice; //Orig: Invoice
                   SAPbobsCOM.Payments_CreditCards pCC;
                   oServiceInvoice = (SAPbobsCOM.Documents) frmMain.oCompany.GetBusinessObject(
                        SAPbobsCOM.BoObjectTypes.oInvoices);
                   oPaymentInvoice = (SAPbobsCOM.Documents) frmMain.oCompany.GetBusinessObject(
                        SAPbobsCOM.BoObjectTypes.oInvoices);
                   oServiceInvoice.DocType=SAPbobsCOM.BoDocumentTypes.dDocument_Service;
                   oServiceInvoice.CardCode = pmt.CardCode;
                   int x = pmt.Invoices.Count;
                   //Get CC Payment Info
                   pCC = pmt.CreditCards;
                   for (int i=0;i<pCC.Count;i++)
                        pCC.SetCurrentLine(i);
                        this.CBAccountInfo= modcb.cbaccts.Find(pCC.CreditCard);
                        if (this.CBAccountInfo != null)
                             //Service lines
                             oServiceInvoice.Lines.ItemDescription = this.pCBAcct.AccountName;
                             oServiceInvoice.Lines.AccountCode = pCC.CreditAcct;
                             oServiceInvoice.Lines.Price = pCC.CreditSum;
                             oServiceInvoice.Lines.TaxCode="0";
                             oServiceInvoice.Lines.Add();
                   //Add the invoice only if any lines have been added to the
                   //Service Invoice.
                   if (oServiceInvoice.Lines.Count > 0)
                        //Add the invoice
                        int j = oServiceInvoice.Add();
                        if  (j!=0)//If there is an error
                             int ix; string m;
                             frmMain.oCompany.GetLastError(out ix,out m);
                             throw new Exception(ix + ":" + m);          
                        else
                             j =oServiceInvoice.DocNum;

    I think this thread might have some useful information for you.
    After Save Document: How to get DocNum, LineNum

  • Serial Number Transaction Report Window isn't opening when adding AR Invoice

    Hi,
    For One of my Client the Serial Number Transaction Report Window is not opening when adding the AR Invoice.
    In the Invoice all the item's that is present in the line level are SERIAL MANAGED and Management Method is ON RELEASE ONLY.
    Why is it so?

    Hi,
    Do you receive any error message? Is it possible to add without selecting invoice without selecting serial number?
    What is your B1 version and PL?
    Thanks & Regards,
    Nagarajan

  • UDF at header level will not auto refresh before & after adding the invoice.

    Hi All,
    I have a FMS query in the UDF at AR Invoice header level. I have set the FMS query to auto refresh when tax rate field changes but the UDF doesn't auto refresh when there is a tax code in the document.
    I will need to add the invoice first then open the added invoice and press shift+F2 to get the calculated amount in the UDF to update the invoice.
    How to get the UDF to auto refresh whenever the tax code has changed? Or after the invoice has added?
    The FMS query:
    SELECT sum(T0.[TotalSumSy]) FROM INV1 T0 inner join OINV t1 on t1.docentry = t0.docentry WHERE T0.VatGroup in ('SR','DS','AJS') and t1.docentry = $[OINV.docentry]
    Thanks & BR,
    Leng

    Hi,
    I solved the problem following the steps in SAP note 633285 - Printing the total Vat amounts in each Vat group, https://websmp130.sap-ag.de/sap/support/notes/0000633285
    In order to print  in the  order  the Vat amount  in each vat group Please perform  the followed stages:
    Go to Tools (in the SBO tool bar ) and chose Manage User Field
    In Marketing Documents (Rows) add new fields according to the Num of the vat groups that you are using in Orders (e.g. A1, A2 ,A4) The type : Units and Totals  - the Structure: sum in the order each column will represent the vat amounts in the line but only for certain  Vat Group
    in order that each column will display the vat amount in the line only if it belong to certain Vat group we attach a query to each column: (e.g. we have 3 columns : A1, A2, A4) .the queries are;
    SELECT $[$38.82.NUMBER]  WHERE $[$38.18.0] = 'A1' FOR BROWSE  SELECT $[$38.82.NUMBER]  WHERE $[$38.18.0] = 'A2' FOR BROWSE SELECT $[$38.82.NUMBER]  WHERE $[$38.18.0] = 'A4' FOR BROWSE Now each column will display the vat amount only if it in the relevant vat group
    in the order document printing template you need to add those Vat column in our example we add 3  data fields : the file: Order - Rows , the Field: A1/A2/A4 - you can hide (un visible ) this columns as needed
    in the Repetitive Area Footer add a calculation field for each vat groupthe Type: Column Total , the Column: Order; A1/A2/A4 in each calculate field you will get the sum amount of the vat in the relevant Vat group. (in  addition you can add text fields with a relevant description for the calculation fields)
    Thanks & BR,
    Leng

Maybe you are looking for

  • Problem defining partition for storing value 0 with new data

    Hi forumers, I've a problem with partitioning and need some advices. I've a table that will be partitioned by column Process_N which have values from 0 to 50000: Process_N between 1 and 29999 represents old data; Process_N >= 30000 represents new dat

  • Which one do you recomend Tech Tool or DiskWarrior

    i want to buy one of this programs to solve problems, but i'm not sure which of them is best. thanks.

  • Cant connect with a Socket.

    Hi, I am trying to establich a connection but I cant. The server is listenig on the 7980 port, I am trying to establish a connection from a servlet to the app on another machine. The problem is that the socket just dont want to work. The server machi

  • Oracle client in solaris

    Hi As we can install Oracle client on windows box , can anybody please let me know that if I want to use one box of SOLARIS as a client mens i want o install application and i only required client part then is there anything specific available I can

  • Payment and Typekit

    I'm paying for the full package of Adobe CC monthly. I want to use type kit for fonts. Type kit says I have to pay or I can use one kit for free. I thought If I paid for the full package of AdobeCC Type Kit came with it. Is This true, and is there a