Blocking the change of Supplier Invoice Number on update using SP

Hi Mentors,
Just wondering if blocking the change of Supplier Invoice No. (OPCH.NumAtCard) is possible using SP_TransactionNotification?
I've been trying to make it work with the following code:
--Prevent Duplicate Supplier Ref. No. in AP Invoice
if @object_type = '18' and (@transaction_type in ('A' ,'U'))
begin
declare @RefNo as varchar (100)
declare @CardCode as varchar (100)
     if (@object_type = '18')
          begin
             select @RefNo = NumAtCard, @CardCode = CardCode from OPCH T0 where docentry = @list_of_cols_Val_tab_del
             begin
               if (@RefNo is not null)
                 begin
                   if 1!= (select count (docentry) from OPCH  where (NumatCard = @RefNo) and (cardcode = @CardCode))
                     begin
                        select @error = 10
                        select @error_message = 'Duplicate Supplier Reference Number!'
                     End
                   End
               End
          End
End
--Prevent Supplier Ref. No. in AP Invoice from being changed during update mode.
if @object_type = '18' and (@transaction_type = 'U')
begin
declare @DocEntry as int
     if (@object_type = '18')
          begin
             select @RefNo = NumAtCard, @CardCode = CardCode , @DocEntry = DocEntry from OPCH T0 where DocEntry = @list_of_cols_Val_tab_del
             begin  
                   if (@RefNo != (select NumAtCard from OPCH where (CardCode = @CardCode) and (DocEntry = @DocEntry)))
                     begin
                        select @error = 10
                        select @error_message = 'Changing of Supplier Reference Number is not allowed!'
                     End
                   End
          End
End
I'm not sure if this is really possible,and that I could be just beating the wind by trying.
Thanks in advance!
Sean

To avoid modifiing the vandor reference use 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)
Select @error = 10, @error_message = N'Changing of Supplier Reference Number is not allowed!'
END     
--- To avoid using duplicated reference try this:
if @object_type = '18' and @transaction_type in (N'A', N'U') -- AP invoice
BEGIN          ----
declare @Invoice AS VARCHAR(15)
declare @Card AS VarChar (20)
SELECT @invoice = NumatCard, @card = CardCode FROM dbo.OPCH
     WHERE DocEntry = @list_of_cols_val_tab_del
If exists (SELECT T0.cardcode, T0.NumatCard FROM OPCH T0 where T0.NumatCard = @invoice
           and T0.CardCode=@card and T0.DocEntry!=@list_of_cols_val_tab_del)
Select error = 10, @error_message = N'Duplicate Supplier Reference Number!'
END          ----

Similar Messages

  • Will the supplier invoice number come to FA when the asset is capitalised f

    Will the supplier invoice number come to FA when the asset is capitalised from proejcts?

    Dear Suresh,
    Do you mean while setting Capital project type, we need to set up the Grouping?
    Can you pls elobrate, if i'm wrong?
    Rgds
    Edited by: user12990981 on 21 Aug, 2011 11:55 PM

  • Report linking GL Expense AC with supplier invoice number

    Hi All,
    I need to generate a report that gives GL expense Acs with corresponding supplier invoice number and payment docu number.
    I am new to FI and not aware of the tables invloved
    Can anyone tell me the tables involved and the link?
    Regards,
    Anu

    >
    Anuradha Ramanathan wrote:
    > I need to generate a report that gives GL expense Acs with corresponding supplier invoice number and payment docu number.
    Hello Anu,
    You must have a look into the Vendor Closed Item tables - BSAK.
    GL Expense A/C --> BSAK-SAKNR or BSAK-HKONT
    Payment Docu. Number --> BSAK-AUGBL.
    Hope this helps.
    BR,
    Suhas

  • If I change my iPhone phone number can I use the same iTunes backup?

    If I change my iPhone phone number can I use the same iTunes backup?
    Keeping iPhone 4, just want to change number and keep settings and all that.  Is it possible?

    yes

  • At what level is supplier invoice number unique in 12.1.3?

    Latest documentation on etrm is for 12.1.1 and states for comlumn invoice_num on table ap.ap_invoices_all:
    'Invoice number for an invoice. This number entered will be unique per supplier and operating unit.'
    I got a client running payables on 12.1.3 and they can enter the same invoice number multiple times for the same supplier in one operating unit but on different sites.
    So it seems like the constraint has been changed to being unique per pay site. Same story for ap.ap_invoices_interface.
    According to 'Oracle Payables Release Notes for Release 12.1.3 [ID 1179114.1]':
    'Oracle Payables does not contain new or changed features in Oracle E-Business Suite Release 12.1.3.'
    So is this intended functionality or a bug. Anyone knows?
    Thanks,
    Jesper

    This is intended functionality.

  • Looking up the Std. Invoice Number (Billing Doc#) using the Outbound Del.#

    Hi,
    I have a list of Outbound delivery #s that I collected by running T-Code:VL06O.  I am trying to get the Invoice value associated with these Delivery #s..i.e. I am trying to see what did we charge the customer for a particular delivery.  I can dbl-click my way through the line items in VL06O and eventually see the Standard Invoice Doc # and $$ Value.
    However, I am looking at hundreds of Outbound Delivery numbers.  Is there a report in SAP that I can run that will give me the following information when I specify the Outbound Delivery #s:
    Ship-To, Standard Invoice Numbers, Invoice value
    Thanks for your help.
    Regards,
    Sam.

    Moved from MM forum to sales forum.
    Coming to your requirement, in VBRK table itself, you can find two fields, viz.XBLNR & ZUONR.  Pass those DA references in any of these two fields and execute so that you can get billing value.
    G. Lakshmipathi

  • Monitoring the changes on a big number of variables

    I have approximately 100 variables in my LV project. What I want to do is to log any change on any of those variables. The way I started to do was to put a copy of those variables inside a loop and at each iteration I check if their current values are equal to theithe previous ones, using the "Add Shift Regiter" functionaly of the loop. However, I think it will become a huge mess when they are all there...
    Does anybody know a better way to do it? I'm thinking about a better solution, but couldn't find it yet...
    Thanks!
    Daniel

    Give us more to work with ... how many different kinds of variables? It sure makes things a lot easier if you can simply build a 1D array with 100 elements of dbls than if you had 100 different variables of 10 different data types. Either way, the first step is to group your data into groups that make logical sense with your data flow. Then you can work from there.
    PaulG.
    "I enjoy talking to you. Your mind appeals to me. It resembles my own mind except that you happen to be insane." -- George Orwell

  • How to move the changes from one system to other without using CMS

    Hi
    In our project they are migrating NWDI 6.40 to NWDI 7.0.
    During migration CMS won't be available.
    Could you plesae tell what are the different options are there to move the WebDynpro changes from (NWDS) Development to Quality system and then production system without using CMS server?
    If i will create a development package and import this packgae in Quality package will my new changes also be available in Quality server?
    Thanks & Regards
    Susmita

    Hi Susmita
    I wasn't completely sure, but from your description of your problem, it seemed like you would have access to your DTR during your upgrade. The following solution assumes as much. If this is not the case, you'll need to do things slightly differently, but the solution will still be possible.
    Depending on the scope and size of your changes, it may be practical for your developers to deploy directly from their NetWeaver Developer Studio (or for a designated administrator to install the NWDS and do the same). To do so, from the Development Configurations perspective, create a new NWDS project for each of the DCs you want to deploy. Then right-click the project and choose from one of the deployment options. (Deploy new archive and run will allow you to see if your deployment has taken effect.) When deploying, the target server is the one set up as your J2EE engine in the NWDS properties - you'll consequently have to modify this when the target server for your deployment changes (from QA to production, or vice versa).
    Note that this is only applicable in certain situations, and only as a short term stopgap measure. This sort of practice - developers or administrators deploying haphazardly to servers other than those intended for development - is precisely what the NWDI is designed to prevent (and is one of very few things it's fairly good at doing). For instance, if your QA and production systems are attached as TEST and PROD runtimes systems respectively in your NWDI, a full assembly and subsequent full deployment would usually occur to these servers when deploying with the NWDI. This is a much stronger guarantee of consistency than the build that will be performed within your local NWDS to deploy your changes. (Conversely, the rigidity of the assembly is perhaps the NWDI's greatest design flaw.)
    (Also, Snehal: thanks for the information on the sapmake_util blog. It's not something I've encountered before and looks very useful.)
    James

  • Excise invoice number showing display option in J1IEX change mode.

    Hi CIN Experts,
    We are using E.C.C6.0.
    In Excise transaction T.code: J1IEX Change option, Official Excise invoice number (J_1IEXHEAD-EXNUM) showing the display mode. How can change the Official Excise Document Number is display mode to change mode in T.code: J1IEX change option.
    In 4.7E system showing the change option in T.code: J1IEX change mode.
    Regards,
    Hanuman

    We cannot change this field from display to change. Once the excise invoice is captured the excise invoice number is freezed.
    It is SAP Standard & to break this you would need the access key from SAP.
    If the change in excise invoice number is by user mistake, please cancel the excise invocie and capture the new one.
    Thanks & regards
    Hameed Parvez

  • How can we get Delivery Slip and Invoice number for the SO in custom Report

    Hello,
    I am developing a new report for the Sales Order.For this , I have to diplay the Deliver slip and Invoice number.
    Could you please explain the logic for this.
    Thanks and Regards
    NTR

    Hi,
    Pass sales order number to table VBFA-VBELV. You will get the complete doc flow. VBTYP_N differentiate whether it is delivery,GI or invoice etc. (Check for domain values for more info on this)
    Thanks,
    Vinod.

  • Depot Excise Invoice number skipped ???

    Hi Everyone
    For Ex. say our depot excise invoice number range is from 1to 100, assuming the current number is 51. Some day back there was a jump in the depot excise invoice number range. In between 1 and 51 the number "25" is missing.
    So the excise department has asked the company as to why we have skipped the number 25.
    I have checked the table J_1IRG23D, but the skipped excise invoice number is not appearing in the tables, I mean it says "No table entries found for the specified key"
    Our Company wants to know the exact reason as to why the system has skipped the depot excise invoice number "25".
    Whether it is the system mistake or user mistake or some body else fiddling with the system.
    Please offer you valuable suggestions to solve this problem
    Thanks & regards
    satish

    Hi,
    SAP 99.9 % will never skip the number range on its own.
    As per my understanding:
    1.Some one has manually deleted the Depot Excise Invoice number after creation (due to the user mistake at selecting the 
      appropriate Incoming Excise invoice, Price , material or etc reason. And while creating the New Depot excise Invoice Number  
      he forget to adjust the number range at object 'J_1IDEPINV' for corresponding Series Group. This u can confirm by checking
      the entry at Item level, instead of Header at it will not show that entry.
    2.May be due to the Depot Sales Returns for respective Depot Invoice canceled and Deleted by the user.
       Here, deleting the excise Invoice is not Valid practice as per Excise Tax rules of GOI.
    3. Kindly check, whether Number Range Changes happend for respective Series Group between the Fiscal Year 2010-11.
    Please feel free to correct me and It will be a value addition if you find any other solution.
    Thank You,
    RB

  • Blocking the Creation of PO in Service Order

    Hello SAP folks,
    I have got an issue where I have to block the Creation of Purchase Requisation Number(BANFN) which is generated  in the background after the creation of the Service order(IW31)  I have tried the user exit EXIT_SAPLCOIH_009 but while coding i could'nt trace the field which is holding the value of PR number.Please let me know is it possible to stop the creation of PR if Yes, Please guide me in this issue in terms of coding.
    Thanxs in advance.
    Regards,
    Indira

    Hi Indira,
    Try these User Exits.
    CNEX0013  Order: Cust. enhancement: Default item category comp. a
    CNEX0026  Customer enhancement for general inspection of material
    CNEX0027  Customer enhancement: Plant, storage loc. finding for c
    IWO10004  Maintenance order: Customer check for order completion
    IWO10005  Maintenance order: Cust.-specif. determination of profi
    IWO10006  Maint. order: Fcode exclusion through cust. enhancement
    IWO10007  Maint.order: Customer enhancement - permits in the orde
    IWO10008  Cust. enhancement: Determination of tax jurisdiction co
    IWO10009  PM Order: Customer Check for 'Save' Event
    IWO10010  Maint. order: Cust. enhancement for determining WBS ele
    IWO10011  Maint. order: Customer enhancement for component select
    IWO10015  Maintenance order: F4 Help for user fields on operation
    IWO10016  PM Order: Cust. enhancement to check operation user fie
    IWO10017  Determine external order number by customer logic
    IWO10018  Maintenance order: User fields on order header
    IWO10020  Maintenance order: Automatically include task list
    IWO10021  Automatic task list transfer when creating order from n
    IWO10022  Determine calendar from user exit
    IWO10023  Service order: Change header data for advance shipment
    IWO10024  Service order: Changes to items for advance shipment
    IWO10025  PM/SM order: Finding responsible cost center
    IWO10029  Inclusion of bill of material in PM/SM order
    IWO10030  Preset Fields for Event Object
    IWO10031  Hide personnel number in PM/SM order
    IWO10033  Customer-Specific Authorization Check Maint./Service Or
    IWO10034  Operation status based on the status of capacity reqs
    Regards,
    Vijay

  • Seeburger help required for Supplier Invoice (EDI 810) and Dispatch Advice

    Hi All,
    Pls let me blog/steps for scenario for Supplier Invoice and Dispatch Advice using Seeburger.
    For Supplier Invoice I assume R/3 will send data to Vendor (810).
    1. Pls let me know for R/3 to XI will we use INVOCE IDOC?
    2. Pls let me know for R/3 to XI Communication do we will use same Distributiion Model setup?
    3. Pls let me know what Seeburger BIC modules I need to use in Seeburger AS2/File Receiver Adapter
    4. Which Interface and Adapter  I need to use for 810 and which Interface and Adapter  I need to use for 997.
        Pls send its setup with its Mappings defined in Modules.
    5. What is Disptach Advice?  Is it also same like Supplier Invoice ? Does it also have EDI Number and if yes then what?
    Pls send me blogs for the above Supplier Invoice and Dispatch Advice settings.
    Regards

    >
    Rickkk wrote:
    > Hi Ravi and All
    >
    > I am thankful to all of you for great help of yours.
    >
    > Steps:
    >
    > 1) I wil create an INvoice in your backend system. It will generate an IDOC.
    > 2) This IDOC will be sent to my XI system.
    > 3) I will map the IDOC to the Target XML 810 --- From where I will get this Target XML 810 ?
    YOu have to login to the Physical box in which XI is installed (Take Basis Help.
    In one of the drives, you will find a folder called seeburger.
    Inside that folder, you can browse to find the XSD structure for your 810 .
    YOu will find different XSDs for different versions of 810.
    Suppose your EDI 810 version is 4010, then you have to use the XSD for 810 4010 version (There will be separate folders for each transaction set/version combination.
    It will be there also in the software CD that seeburger provides when you buy it.
    > 4) I need a seeburger receiver AS2 adapter that consist of modules that will convert the XML 810 docuemnt to EDI document.
    >
    > Below are the modules will be present in you suggested seeburger receiver AS2 adapter
    > module key                  Parameter name               Parameter value
    > bic                                destSourceMsg               MainDocument
    > bic                                destTargetMsg                MainDocument
    > bic                                mappingName                  <the name of your X2E mapping for 810>
    > exit                               JNDIName                         deployedAdapters/SeeXIAS2/shareable/SeeXIAS2
    >
    Yes.
    > 5. As per blog  -
    /people/rajeshkumar.pasupula/blog/2009/08/05/wanna-implement-seeburger-for-edi-find-the-booster
    >
    > For 997 Interface we are using seeburger Sender adapter and for 850 Interface we are using Split997 Sender adapter -- Reverse order
    >
    > For this scenario will it be like this again like
    > For 997 Interface we will use Seeburger Receiver AS2 Adapter where the above modules are configured -- Pls suggest
    >
    > For 810  Interface we will use Split997 Receiver adapter -- No modules configured Pls suggest
    >
    > I request you to kindly send me snapshots or blogs which has snapsot for this scenario.
    >
    No need of split 997 in outbound case. In this case, you will send the 810 and the partner will send the 997.
    So, to receive that 997 file, you need another scenario. You need the split 997 communication channel only in inbound case like in 850, but not in outbound case.
    > Last point -- is Dispatch advice direction is like 850 (Inbound ) or its direction is like 810 (outbound)?
    > Do we have IDOC or something like that present and its mapping ?
    >
    like I said earlier, it is an outbound document if your company is the vendor.
    It will be inbound if your company is the Customer to some other company.
    The IDOC that is used usually will be DESADV idoc.
    > Regards

  • Manual Invoice number duplication message

    Hi All,
    We were wondering if someone could clarify the following situation:
    Whilst working on 2 TEST company databases we have encountered a small problem. We have 2 BP accounts "Example1" and 
    " Example2" , both had invoices with the reference 1234567 , entering in to "Example1"was fine, but when we tried to enter this ref No. for "Example2" the system told us we had already entered it and would allow no further processing.
    We think we will come across different suppliers that have the same series of reference nou2019s from time to time, how is this dealt with within SAP B1?
    Thank you,
    MB

    Hi Matthew,
    The manual number you are entering is normally your internal reference for Purchase Invoices in SAP.  Therefore you cannot enter a duplicate number. All of our customers have this set as an automatic numbering series.
    Most clients would put the suppliers invoice number in to the Customer / Supplier Ref No. field (numatcard).
    The numatcard will still check for duplicate invoice numbers, but only for one supplier.  So, you cannot enter 1234567 on the same BP account twice without warning, but you can enter 1234567 across 2 supplier accounts.
    Regards,
    Adrian

  • How to restrict the changes in Relesed PO?.

    Hi all,
    How to restrict the users to make a changes in the Released PO?. User should make the changes only if it is unreleased by the respective codes.
    1. Is there any user parameters like functional authorisation?
    2. I have already suggested two solutions to the clients that
        1. To restrict the authorisation of TCodes ME22n at the user level, but it's not a suitable solution, if user want to make any changes before releasing, then system is not allow to do the changes.
        2. I have made release indicator as a 1 - not changeable if it is released, in release strategy settings. But the system is not allowing the all the users including release codes to make the changes?.
    If there is any solution, please reply immediately.
    with regards,
    Raja.

    hi,
    if u set release indicator 1, after release is taken place, for any changes, u need to revoke the release. and then change the PO.
    even u cant directly block the changes to already released PO, because, in future if at all qty or some changes is required to change, it should allow u to change!

Maybe you are looking for

  • How to complete the incompletion sales documents

    Hi, We have around 8600 old sales documents (incompletion log, TCode V.01) for which subsequent documents created for some and now we have an requirement to clear/convert all the documents to completion or not to display under this transaction. SD_SA

  • Photos in iPhoto have lost "Places".  How do I recover them?

    I spent many hours add "Places" to our Alaska Vaction Photos.  When I went to show them to family and friends, the "Places" information had disappered.  What method can I use to recover them?

  • Import opening stock on opening balance account in G/L

    Hi, Which template do i use to import the opening stock of the items. The items are already imported with oitems & oitems prices ! Now i need the opening stock level booked in SAP on my opening stock account in the G/L. Thanks Mark

  • Euro Symbol in Query Designer

    Hi, I want to edit the name of the Keyfigure in Query designer  and replace it with Euro Symbol .How is thispossible Thanks Maya

  • Trackpad activation without a mouse

    I Need to activate My trackpad click opción and i hace no mouse.  How can i do it with Mac commands?