Prevent unauthorised changing of 'Ship to' field of Purchase order

Hi experts
I am trying to prevent users from changing 'Ship to' field of Purchase Order without authorisation. OPOR.Address2
I am thinking to do this I should use a Stored Procedure which cause error if a condition is not met?
First I am trying to prevent any change of this field:
SP attempt:
--No changing of ship to address on PO
IF @object_type = '22' AND @transaction_type IN ('U','A')
BEGIN
IF EXISTS (SELECT T0.Address2 FROM dbo.OPOR T0 WHERE T0.Address2 <> (SELECT T1.CompnyAddr FROM dbo.OADM T1) AND T0.Address2 = @list_of_cols_val_tab_del)
SELECT @error = 1, @error_message = N'Direct shipment requires authorisation'
END
The above does not work - please can someone assist?
If there is better way to achieve my required outcome please advise me.
Thanks
Karen

Hi,
Try this:
IF @object_type = '22' AND @transaction_type IN ('U','A')
BEGIN
IF EXISTS (SELECT T0.[Docentry] FROM OPOR T0 WHERE T0.[Address2]  <> ( select T0.[CompnyAddr] from OADM T0) AND T0.docentry = @list_of_cols_val_tab_del)
SELECT @error = 1, @error_message = N'Direct shipment requires authorisation'
END
Thanks & Regards,
Nagarajan

Similar Messages

  • Make short text field in Purchase order creation only display..

    Sir,
    Yeah my requirement is quite unusual, but such is the situation.
    I want to make the short text field in purchase order creation "only disply". what is happening is that user while creating PO is able to change the text of material in short text column. I want to make it only for display.
    Can it done on document type level, since for service type, and Text type of account assignment cat, only text field is filled up. so how to do it.
    Please assist...
    Rahul

    Dear Rahul,
    If you want to have the short text display only for standard item but not service item, you may check below customizing.
    Transaction SPRO:
    MM-PUR-PO
    -> Define screen layout at document level
    Field Selection group: Basic Data, Item
    Field Selection Key:  PT0F Standard item purchase order
    Field: Short text -> set as display
    Hope this help.
    Ian Wong Loke Foong

  • Help Required in Ship To Address in Purchase Order

    Hi all,
    Is it not possible to have multiple ship to address made available as drop down list in Logistics tab of Purchase order.. It is possible in Sales order. I require the same as i need to ship the product from different location...
    In business partner it does allow the vendor to have multiple ship to address so would it not be possible to select any ship to address in purchase order...?
    Regards,
    Jona

    Hi Jona,
    The system does not provide this functionality. You could create an add-on that adds this drop-down list and populates the address field based on the address that the user chooses. However, you could use a formatted search to achieve the same kind of function.
    The following query could be set up as a formatted search on the address field:
    select
         case
              when Street = '' then ''
              when Street is not null then Street + char(13)
         end +
         case
              when Block = '' then ''
              when Block is not null then Block + char(13)
         end +
         case
              when City = '' then ''
              when City is not null then City + char(13)
         end +
                  case
              when County = '' then ''
              when County is not null then County + char(13)
         end +
                  case
              when Country = '' then ''
              when Country is not null then Country
         end +
                  case
              when ZipCode = '' then ''
              when ZipCode is not null then '  ' + ZipCode
         end
    from
         CRD1
    where
         AdresType = 'S'
                 and CardCode = $[$4.0.0]
    You should modify the script to fit your own address format requirements.
    Hope this helps,
    Owen

  • Purchase Req as mandatory field at Purchase Order

    Hi Gurus,
    I have the next problem:
    I'm trying to put purchase requisition as mandatory field at purchase order.
    At img i made the following steps:
    Materials Management > Purchasing > Purchase Order > Define screen layout at document level
    I sellected the screen layout that I want to change
    At 'reference data, item' I sellected 'purchase requisition' as 'reqd. entry'.
    Next I try to do a PO and it doesn't work...
    Anyone knows why?
    Regards
    LR

    Force buyers to create Purchase Order with ref. to a Pur. Req., Quotation or Pur. Ord.
    Transaction OMET
    Create a new entry, give it a name and tick :-
    Ref. to PReq
    Ref. to P.O.
    Ref. to quotation
    Next, you've got to associate via SU01
    Click Parameters, insert a new parameter id EFB to the authorization code.
    Type in Parameters value you want e.g. XX
    You have to assign the control for ALL the SAP buyers via thier SAP users id.
    Logoff and login again. Then try to create a Purchase Order without a reference.
    Source link: http://www.academictutorials.com/sap-mm/sap-mm-configuration-tips.asp

  • ME59n exit/BADI to copy purchase requisition custom field to purchase order

    I have added a custom field (Unloading Point) in the Purchase requisition customer screen. Now When a purchase order is created from the purchase requisition through t-code ME59N, I need to copy the unloading point value from the PR to Unloading Point in the shipping tab of the Purchase Order. Whch User-exit/BADI can be used for this purpose. <removed by moderator>
    Edited by: Thomas Zloch on Nov 23, 2010 12:44 PM - please do not offer ...

    Good you found out what was the answer. Please share your solution, that sort of the idea of a forum like this.........

  • Can we change the doc date in a purchase order ?

    can we change the doc date in a purchase order ?
    i have created PO with wrong dates but now want to correct it, but its not letting me do it ...why ?

    I don't think DOC DATES can be changed. You can only change the posting dates of the Goods receipt and Invoice documents as that is what matter for your financial consolidation.
    Regards,
    Ravi
    Note : Please mark the helpful answers

  • ERS field in Purchase Order Line detail (Invoice Tab)

    Hi ... I was trying to figure out the priorities for ERS field in Purchase order ...
    What i could simulate is ...
    Case 1
    In case Vendor master has ERS = YES but in info record ( for vendor and material) NO ERS is defined.
    Then ERS field will get appeared in PO LINE detail with value NO (not set)
    Case 2
    In case Vendor master has ERS = No but in info record  (for vendor and material)  ERS is set.( NO ERS = not set)
    Then ERS field will not get appeared in PO LINE detail
    Case 3
    In case Vendor master has ERS = YES and in info record  (for vendor and material)  ERS is set.( NO ERS = not set)
    Then ERS field will get appeared in PO LINE detail with ERS = YES
    Here I am doubtful about case 2 .... I believe info record should always have priority over vendor , but system is not behaving as per expectation.
    Could u pls tell me the exact conditions when ERS field will not appeared and if appeared from where it will pick the default values in PO LINE details
    Regards
    SANDEEP

    the info record has precedence.
    The bad thing is, that this field is , contrary to other field that appear in vendor and info record,  has a  negative meaning.
    ERS field name in vendor is  auto eval GR settlement,
    while in info record it is : No ERS.
    lets do an example:
    V=vendor
    I = Info record
    P = purchase order
    X = box selected
    N = box not selected
    so we can have this 4 cases:
    VIP
    XNX
    XXN
    NXN
    NNN
    The 3rd  case NXN does not really make any sense.

  • Implementation Of Badi ME_GUI_PO_CUST for adding fields in Purchase Order

    Hi All
       I am implementing BADI ME_GUI_PO_CUST / ME_PROCESS_PO_CUST to add additional fields in Purchase Order.
    The implementation of the BADI ie the Subscreen of the fields to be added appears in  transaction ME23N but it does not appear in the transaction ME22N and ME21N.
    Can anyone help me on this.
    Thanx.
    Moderator message - Duplicate post locked
    Edited by: Rob Burbank on Jul 10, 2009 12:10 PM

    check the answer
    [New tabs added by Badi ME_GUI_PO_CUST not seen in ME21N and ME22N;
    bye

  • Shipping Points in  MM (Purchase order)

    Hi,
    I would like to use transport logistics execution in Materials Management.
    I import my product from overseas and would like to control different shipping points in my purchase order
    Do you know how can I use this function?
    Regards,
    Manuel Nuñez

    Hi,
    Check this thread [Shipping Tab for Return PO    |Re: Shipping Tab for Return PO]
    I assume apart from this, in the vendor master returns vendor check box needs to be checked.
    Regards

  • PR to be made mandatory field in Purchase Order

    Hello,
    PR to be made mandatory field in Purchase Order.
    How i can do this in SAP ?
    Regards
    Rahul

    Hi,
    First check your PO document type which you want to make PR number field as mandatory in ME21N.
    Then Goto -> SPRO- Material Management - Purchase order- define document type for Purchase order - E.g NB- check the field selection assignment ( NBF)
    Next,
    Goto - Define screen layout at document level ( t.code OMF4) SELECTION GROUP Reference data, item and under Field selection key as NBF.
    Field name - Purchase Requisition as Required entry with flagged check box.
    Now in purchase order for the choose document type NB=PO the PR field as required entries.
    System will allow to create PO only with reference to PR.
    Thanks
    Thiru

  • How to change the general Ledger of a purchase order in mass

    Hi,
    In our company, we change the General Ledgers, then, and we have plenty of purchases orders take the old general ledger, we want to change this general ledger by the new in each purchase order in mass.
    I found in BAPI, customizing, in user exit, I tray with the transaction MEMASSPO not solution.
    Can you help us for change the General Ledger in the purchase order in mass?

    Hi,
    You ask ABAPer to write a program in that program you give one text file as input with old GL and new GL corresponding to that old GL so that the program will replace it with new GLs.
    firat extract all POs which you want and give those  PO numbers and GL text file  as input in this program and execute

  • Is it possible to change the vendor in a saved Purchase order

    Is it possible to change the vendor in a saved Purchase order
    Regards
    Amit

    Hello, Amit,
    no, but you can change the partner functions in the PO, like "Invoicing Party", "Vendor", "Goods Supplier" -- depends on you customizing for partner schemas.
    However, this should be used only in case when during the purchase order lifecycle the partner has been changed (as result of merger, bankrupcy, factoring); otherwise, it is much easier to simply delete the PO and create a new one.
    Kind Regards
    TomT

  • Drill down of purchase request number field in Purchase order

    Hi, We need Drill down of purchase request number field in Purchase order. Please help.

    Hi
    In VOV8 as far as i understood by your query you are asking about the following :
    Enter Purchase Order number - This indicator checks for the purchase order number and if you dont enter the purchase order number then system will consider the sales document number as purchase order number
    Check Purchase order number  -  If you check then system  will check wheather the purchase order number existed or not for this sales document type
    Regards
    Srinath

  • Prevent change of Ship-to address in Sales Order entry ?

    We want to be able to prevent users from changing the Ship-to address in either VA01 or VA02, if the Ship-to has a specific Account Group. I am aware that we could do a check in a userexit, but our preference would be to grey-out the address fields if someone went to Goto->Header->Partners, and double-clicked on the Ship-to Partner.
    Do anyone know if it's possible to do this in config ?
    Thanks, paul.

    This can be very well done. As i succeded in doing in my project
    Goto-SHDO
    enterVA01 and do go on till u get the partner address tab and there u select Wcontent display and save
    and again take VA02 and do the same procedure and save it
    And also dont forget to activate in SHDO nor it will not work
    hope this will clear u
    Sri

  • Change of Ship to Party on sales order after invoice

    Hi all,
    I have created a sales order, created a despatch advice and then created an invoice. After that i opened sales order and changed ship to party there. System is allowing me to change ship to party on sales order after invoice. I want that system should not let me change ship to party on sales order after invoice.
    How can i do that as this is an audit issue as we have different prices for different ship to parties.
    Please respond.
    Best Regards,
    AI.

    Hi
    You have two options
    1. create a transaction variant in T.code SHD0 for VA02 and make the field as display in the variant. But remember that you will not be able to use standard T.code VA02 after this, you need to make and use a "Z" t.code like ZA02
    2. Take the help of your ABAPER and ask him to find a screen exit in the sales order PBO module, where he will be able to grey out the ship to party field.
    Hope this helps
    Chandra Kiran

Maybe you are looking for

  • Paragraph styles not working in pages 5.0

    I upgraded pages to the newer version 5.0 and the documents that I had on my old version lost all the paragraph styles I had created. I also tried to create new paragraph styles with numeral lists and bullets and this is not working *(not applying fo

  • Reset and reverse

    hi, i have question on FBRA and FB08. 1) only reset - i know it is from cleared to open item. i need to use FB08 to reverse. Q: if after reset i have 3 entries become open item, how to reverse these 3 entries via FB08? 2) reset and reverse - this is

  • Are there any risks when using useMessageListener="true" for JMS Adapter?

    As far as I heard there are some risks when using useMessageListener="true" (instead of "false"). Is this true? Or does the Partnerlink to JMS adapter became unstable? When exactly is it recommended to use "true" instead of "false"? Peter

  • Why XML can't extract data in JSTL?

    I have a xml file,named test.xml,I put it into Tomcat5\webapps\ROOT directory, it's content like follows: <rolodex> <contact> <firstName>Anna</firstName> <lastName>Keeney</lastName> <email>[email protected]</email> <phone type="work">716-873-9644</ph

  • WIP Job Status Control at User Level

    Hi All, I need to give the user just the control of releasing the Job(Work Orders). Right now he has got OnHold/Cancelled also. What i have observed is after certain operations he has cancelled the job and it has incurred the cost. I looked at the lo