Duplicate purchase oredr number message need in sale order creation

Hi,
My requirement is for a user exit for sales order creation.
When user create a sales order and put customer purchase order number based on purchase order number
user entered it will check data base table and if its duplicate entry then throw the error.
So, Requirement is :
1: Give error for duplicate purchase order number.
I need user exit name.
Please help.
Regards,
Moderator Message: Please search before posting basic questions. Thread locked.
Edited by: Neil Gardiner on Apr 29, 2011 9:31 AM

Whether to allow duplicate PO numbers from a customer is a configuration setting....  However, what you're asking seems strange.... what has company code got to do with it, unless you want to allow PO numbers to dupllicate across SAP company codes...e.g., customer orders on PO #1 from company code 001 and PO #1 from company code 002....
Usually, we would want to apply duplicate PO code checking at the customer number level, wouldn't we?  If customer 1 sends me PO #1 and customer 100 sends me PO #1, I certainly would want to accept both orders.
Consult your SD functional specialist about configuring this option.

Similar Messages

  • Duplicate purchase oredr number avoide in sale oredr creation

    Hi Friends,
    My requirement is for a user exit for sales order creation.
    When user create a sales order and put customer purchase order number based on purchase order number
    user entered it will check data base table and if its duplicate entry then throw the error.
    So, Requirement is :
    1: Give error for duplicate purchase order number also check company code
    I need user exit name.
    Please help.
    Regards,
    Shekhar

    Whether to allow duplicate PO numbers from a customer is a configuration setting....  However, what you're asking seems strange.... what has company code got to do with it, unless you want to allow PO numbers to dupllicate across SAP company codes...e.g., customer orders on PO #1 from company code 001 and PO #1 from company code 002....
    Usually, we would want to apply duplicate PO code checking at the customer number level, wouldn't we?  If customer 1 sends me PO #1 and customer 100 sends me PO #1, I certainly would want to accept both orders.
    Consult your SD functional specialist about configuring this option.

  • Purchase Requisition number not changing when sales order item is rejected

    Hi all,
    I have a requirement to change the sales order status to 'TECO' when ever some reason for rejection is selected in the status tab at the item level.The status should change from 'TECO' when i remove the reason for rejection.
    The status change is happening correctly.I have achieved it using user exit.
    CASE 1 : Initially, when a new item is added in the Sales order the purchase requisition number appears in the schedule lines tab of the item level. This is as expected.
    CASE 2 :When the same item is blocked (by entering a reason for rejection in status tab of VA02 ) then the purchase requisition number is not present in the schedule lines tab.This is as expected.
    But i face the following issue.
    CASE3 : Again if the blocked item is unblocked (By removing the reason for rejection in status tab of VA02 ) then the purchase requisition number does not appear again in the schedule lines tab.The purchase requisition number is expected to appear again.
    This happens in case of DROP SHIPMENT scenario. I understand that in case of dropshipment scenario the purchase requisition number is triggered by item category and schedule lines only.
    I tried to make the changes(to change the status ) in user exits 'MV45AFZZ' and also 'MV45AFZB'.But i face the issue in both the exits.Please let me know if there are any means to solve this issue(as mentioned in case 3).
    Regards,
    S.Suba

    Many thanks for your answer. It help me to solve the issue.
    So applying note 738171, with transaction OVB5 (or VOFM, requirements->subsequent functions->Purch.requisitions) we create one new requirement, ie RV07A900, and then we apply the rule that if we have delivery or billing block, that is, VBAK-LIFSK or VBAK-FAKSK not empty, then we set an error with a code similar to this:
                da_sy-msgid = 'Z1'.    (message class)
                da_sy-msgno = '001'.  (message number)
                error_exception = true.
    and then the PR is not created.
    Regards.

  • Sales Order creation/ change date for the items

    I have a unique scenario and i need to get a Report for this
    A sales order is created for 4 line items.
    Out of these , for 2 line items a delivery is created. I need the sales order creation date and time  for these 2 items in a custom report
    Now the other 2 items go in to some kind of block- Now these are released by going in the sales order VA02 and after releasing the delivery is created. Again for these two items , i need the sales order change date as after a user goes and changes the sales order to remove the block only then delivery is created for these two items
    Also another scenario is the 2 line items go for back order and when we get stock  at tht time system confirms the stock and then the delivery is created for these. So also for this when this change occured i need to get the date for these 2 line items
    Can any one please suggest how to get this data  from the scenarios?
    I dont want to get the date when the delivery is created as i can get tht from the LIKP table. I need the sales order create and change dates for these.

    You may be aware, any changes to a document will be recorded in CDHDR (for header changes) and CDPOS (for item changes).  You can explore these two tables.
    thanks
    G. Lakshmipathi

  • Customer and PO number combination check in sales order

    Dear SD Gurus,
    Apart from the config within VOV8, is there a further check that can be done during sales order creation that can trigger an error message (not just warning) if a particular customer and PO number combination is entered?
    Thanks in advance,
    Alvin

    Hi,
    In VOV8 you can only Check whether the purchase order number already exists or not.
    If you want to do any other check like you said based on customer & PO number combination then follow steps below:
    Ask your ABAPER to
    1: Create a Z-table where you can store the required Customer No & PO No combinations.
    2: Write a code to check the PO no & Customer No entered in Sales order with the entries in the Z-table & throw an error if there is no match.
    This code needs to be written in the User exit Save_document_prepare by your ABAPER.
    3: This will work at time of Save & not a point of entry. The result will be same "error msg will be thrown"
    regards
    Edited by: Innovation is key on Feb 28, 2011 6:08 PM

  • User Exit during Sales Order Creation - New Line Item needed

    I have a situation during the process of sales order creation. If a Material in a line item has say 27 EA and the Base Unit is EA. But the Sales Unit is CSE. Then whenever the user enters 27 EA and presses enter he should get two line items.
    The first line item needs to convert to maximum number of CSE posible and the rest will be the second line item with the remaining EA. The order isn't important but that is what is needed. Question is how do I approach this problem and code my user exit accordingly and where do I code it.
    I was looking at SAPMV45A and saw the program MV45AIZZ which is meant as a user exit for any PAI event handling. If anybody has encountered this kind of requirement can you please share your view on this.
    I will definitely reward points for useful answers.
    Clark

    Hello Mahendra
    The requirement is as follows :
    PART 1:
    Sales Order Enter: 
    1.     When a line item is entered on a sales order (VA01 or VA02), at enter, check the sales unit of measure (VBAP-VRKME).
    •     Do not check line items where item category (VBAP-PSTYV) = TANN, TAPS or ZTAP.  TANN are free goods that should not be considered for consolidation.  TAPS & ZTAP are lower level materials as a result of product selection.  They will be attached to a higher-level material with an item category of TAX, which is relevant for consolidation.
    •     Do not check items where VRKME <> EA
    2.     If VRKME = EA, go to MARM for MATNR.
    3.     Go to record where alternate unit of measure (MEINH) = CSE, get the value from the numerator field (UMREZ).
    4.     Divide the order quantity (VBEP-WMENG) by UMREZ.
    5.     If the result is greater than 1.0, the customer has ordered more than one case and a new line item needs to be added to the sales order for the case quantity.
    6.     Add a new line to VBAP for the same material with the case quantity.  If not a whole value, the remainder of eaches (bottles) should update the qty on the first item on VBAP.
    •     Part 1 is relevant for order types ZCA, ZOR, ZSO, RE, ZSM
    PART 2:
    Batch Job to run prior to the Delivery Due List:
    1.     Read VBUK for Delivery Status (LFSTK) = A (delivery not processed).  Get all of the document numbers (VBELN).
    2.     Go to VBEP for those document numbers to get the goods issue date for the order.  There will be many records in VBEP for the same sales order.  Look at all orders with a goods issue date (WADAT) of next day.
    3.     Go to VBAK for those document numbers to see if there are multiple sales orders for the same Sold To party (KUNNR).
    4.     For customers who have more than one order in VBAK, search all line items (for all orders).  If there are no duplicate materials across sales orders, do nothing.
    •     Do not check line items where item category (VBAP-PSTYV) = TANN, TAPS or ZTAP.  TANN are free goods that should not be considered for consolidation.  TAPS & ZTAP are lower level materials as a result of product selection.  They will be attached to a higher-level material with an item category of TAX, which is relevant for consolidation.
    •     Do not check line items where reason for rejection (VBAP-ABGRU) is not blank
    5.     If there are duplicate materials, go through the same logic as in part 1.  If the quantity across the sales orders adds up to greater than one case, add the appropriate quantity to a new line item on the first sales order.   If there is a remainder qty, update the line item on the first sales order with this qty. In this case, the quantities on the second sales order needs to be closed out with a reason for rejection code of 50, ‘Line Item Consolidation’. If there is no remainder,  update the qty on this item directly.
    •     Part 2 is relevant for order types ZOR, ZCA, ZSM
    •     This batch job will have to be run manually for Day Pick orders.  The end of this program should automatically kick off the delivery due list for Day Pick orders, shipping condition 02.
    Business Justification:
    The business requires that like order line items be consolidated to one line item prior to the order going to the warehouse for picking.  This will aid in picking at the warehouse as well as result in the customer invoice not reflecting more than one line item for the same material.  In the case where the customer has truly ordered more than a case, i.e;, 1 case, 2 bottles, the documents in SAP will still reflect 2 lines.

  • Copy PO Number from contract to sales order

    Hi,
    My clients requirement is that when i create sales order with reference to contract the PO Number should be copied from contract to sales order other wise we have to enter PO Number every time while creating the sales order.
    Please guide me.

    Hi
    Small change in the program will copy the PO number from Contract to sales order.In case need take help of ABAPer
    Data which is not copied
      LOCAL: VBKD-FKDAT.
      LOCAL: VBKD-FPLNR.
      LOCAL: VBKD-WKWAE.
      LOCAL: VBKD-WKKUR.
      LOCAL: VBKD-DELCO.
      LOCAL: VBKD-BSTKD.
      LOCAL: VBKD-ABSSC.
      LOCAL: VBKD-BSTDK.
    In your data declaration, you have
    LOCAL: VBKD-BSTDK
    Please comment out this line and your purchase order should be copied over. You might also have to comment out some of the other fields which are declared locally if you wish to copy them as well.
    Ramesh

  • Purchase Order and Sales Order Creation Interface

    Hello,
    I have an issue, I need to create a PO in Oracle Purchasing and the create the corresponding Sales Order in OM, I need to know how to this and create the association between the two documents. All these has to be created thru the open interfaces because the information is comming from a legacy system.
    Does anyone know if this is possible or has an example perhaps?
    Thanks

    Here is what you can do
    1) Import the data in the form of DROP SHIP sales orders in BOOKED status
    2) Once the orders are imported, run Purchase Release and then Requisition import programs
    3) In Purchasing module, check the new Requistions created and then use the auto create feature to create the POs.
    This process will link the PO to SO.
    There should be a way to automate the Auto Create process too.
    This is one idea I've and there could be some other better ideas tooo...
    Good Luck

  • Number Range issues with sales orders in CRM and R/3

    Hi,
    We are currently using CRM4.0. I have sales orders created in R/3 and they are replicated into CRM.  These sales orders can only be created in R/3.  I have given them a number range of 0000000001 and 0005899999, however we have reached the number 0005899999 so we increased the internal number range for the sales orders in R/3 to 0009499999, however we forgot to update the number range for the corresponding sales transaction type in CRM so we are getting the following error in CRM:
    +Enter a business transaction number between 0000000001 and 0005899999
    Message no. CRM_ORDERADM_H532
    Diagnosis
    You have attempted to enter a transaction number which is not allowed for the transaction type.
    Procedure
    Enter a number between  &1 and &2. Make sure that you issue a number which has not already been issued.+
    We have now updated the CRM number range to match that in R/3 to 0000000001 and 0009499999 but we are still getting the error above on our existing sales orders in CRM.  I thought that increasing this number range it will remove the error but when I open sales orders in CRM the error is still there. 
    Is there any way to remove this error message?  Any tips or advice would be much appreciated.
    Please note we've already checked the post Re: Number Range Problem and note 427289.
    Kind Regards
    JoJo

    Hi Sirisha,
    The solution depends on the exact issue you are facing.
    The CRM Sales Order is created OK, but you only see the error when you open the Sales Order?
    If this is the case, then you can follow the steps below:
    1. Find the Message ID and Message No for the error message
    2. Use Program - CRM_MESSAGES_DELETE to delete error messages from the error producing Sales Orders.
    Let me know if this is not the issue you are facing.
    Regards,
    Nelson

  • How can we get purchase req. no in third party sales order

    Hi,
    I am creating third party order scenario, where i can get purchase req. no in third party sales order.
    Regards,
    M B Raju

    HI
    Once you save the Sale order then go to VA02
    Double click on the Line item , click on the schedule line tab
    under Schedule line tab  you can see the Purchase Req. number
    Regards,
    Prasanna

  • Copy contract PO number and Date to Sales Order

    Hi freinds,
    I have one requirement. I want to copy contract PO number and date to Sales order PO Number and Date while creating the sales order with reference to contract.
    Thanks,
    Satya

    Hi,
    You have to modify your data transfer routine with the help of ABAPer.
    You have to give him the requirement that these value should be copied to sales order from contract.
    He will do the needful changes in the data transfer routine.
    Then assign that routine to the copy control of sales order from contract.
    Regards
    Raj.

  • Help with SE37 code needed - create sales order

    Hi Guurus,
    Can you please help? I finally finished with function creation (I just adopted the function, which I found in the system and it works ok, YEAH!!!)
    BUT!!! It is working just for the sales order creation with one item.
    Is it a big deal if you adopt my code that the function will have possibility to add more then one item?
    Thanks in advance
    Sašo
    Here is the code:
    *FUNCTION Z_RFC_SD_SIMO_SALES_ORDER2.
    *""Local interface:
    **"  IMPORTING
    **"     VALUE(P_AUART) TYPE  AUART DEFAULT 'zhp'
    **"     VALUE(P_VKORG) TYPE  VKORG DEFAULT 0001
    **"     VALUE(P_VTWEG) TYPE  VTWEG DEFAULT 07
    **"     VALUE(P_SPART) TYPE  SPART DEFAULT 01
    **"     VALUE(P_AUGRU) TYPE  AUGRU DEFAULT 001
    **"     VALUE(P_BSTKD) TYPE  BSTKD DEFAULT 'test si order avtom'
    **"     VALUE(P_SOLD) TYPE  KUNNR DEFAULT 21000069
    **"     VALUE(P_SHIP) TYPE  KUNNR DEFAULT 21000069
    **"     VALUE(P_MATNR) TYPE  MATNR DEFAULT 'SIOBRACUN'
    **"     VALUE(P_MENGE) TYPE  KWMENG DEFAULT 1
    **"     VALUE(P_PLANT) TYPE  WERKS_D DEFAULT 0001
    **"     VALUE(P_ITCAT) TYPE  PSTYV DEFAULT 'ZG2W'
    **"     VALUE(P_LGORT) TYPE  LGORT_D DEFAULT 0001
    **"  EXPORTING
    **"     VALUE(V_VBELN) TYPE  VBELN
    **"     VALUE(RESULT) TYPE  CHAR01
    DATA DECLARATIONS.
    **DATA: v_vbeln LIKE vbak-vbeln.
    *DATA: header LIKE bapisdhead1.
    *DATA: headerx LIKE bapisdhead1x.
    *DATA: item LIKE bapisditem OCCURS 0 WITH HEADER LINE.
    *DATA: itemx LIKE bapisditemx OCCURS 0 WITH HEADER LINE.
    *DATA: partner LIKE bapipartnr OCCURS 0 WITH HEADER LINE.
    *DATA: return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.
    *DATA: lt_schedules_inx TYPE STANDARD TABLE OF bapischdlx
    *WITH HEADER LINE.
    *DATA: lt_schedules_in TYPE STANDARD TABLE OF bapischdl
    *WITH HEADER LINE.
    HEADER DATA
    *header-doc_type = p_auart.
    *headerx-doc_type = 'X'.
    *header-sales_org = p_vkorg.
    *headerx-sales_org = 'X'.
    *header-distr_chan = p_vtweg.
    *headerx-distr_chan = 'X'.
    *header-division = p_spart.
    *headerx-division = 'X'.
    **order reason
    *header-ord_reason = p_augru.
    *headerx-ord_reason = 'X'.
    **PO number from MAX
    *header-PURCH_NO_C = p_BSTKD.
    *headerx-PURCH_NO_C = 'X'.
    *headerx-updateflag = 'I'.
    PARTNER DATA
    *partner-partn_role = 'AG'.
    *partner-partn_numb = p_sold.
    *APPEND partner.
    *partner-partn_role = 'WE'.
    *partner-partn_numb = p_ship.
    *APPEND partner.
    ITEM DATA
    *itemx-updateflag = 'I'.
    *item-itm_number = '000010'.
    *itemx-itm_number = 'X'.
    *item-material = p_matnr.
    *itemx-material = 'X'.
    *item-plant = p_plant.
    *itemx-plant = 'X'.
    *item-target_qty = p_menge.
    *itemx-target_qty = 'X'.
    *item-target_qu = ' '.
    *itemx-target_qu = 'X'.
    *item-item_categ = p_itcat.
    *itemx-item_categ = 'X'.
    **item-STORE_LOC = p_LGORT.
    **itemx-STORE_LOC = 'X'.
    *APPEND item.
    *APPEND itemx.
    Fill schedule lines
    *lt_schedules_in-itm_number = '000010'.
    *lt_schedules_in-sched_line = '0001'.
    *lt_schedules_in-req_qty = p_menge.
    *APPEND lt_schedules_in.
    Fill schedule line flags
    *lt_schedules_inx-itm_number = '000010'.
    *lt_schedules_inx-sched_line = '0001'.
    *lt_schedules_inx-updateflag = 'X'.
    *lt_schedules_inx-req_qty = 'X'.
    *APPEND lt_schedules_inx.
    Call the BAPI
    *CALL FUNCTION 'BAPI_SALESDOCU_CREATEFROMDATA1'
    *EXPORTING
    *sales_header_in = header
    *sales_header_inx = headerx
    *IMPORTING
    *salesdocument_ex = v_vbeln
    *TABLES
    *return = return
    *sales_items_in = item
    *sales_items_inx = itemx
    *sales_schedules_in = lt_schedules_in
    *sales_schedules_inx = lt_schedules_inx
    *sales_partners = partner.
    Check the return table.
    *LOOP AT return WHERE type = 'E' OR type = 'A'.
    *EXIT.
    *ENDLOOP.
    *IF sy-subrc = 0.
    *result = 'E'.
    *ELSE.
    *COMMIT WORK AND WAIT.
    *result = 'S'.
    *ENDIF.
    *ENDFUNCTION.
    Edited by: Saso Poljansek on Jan 22, 2008 10:23 AM

    Hi,,
        Include           YCL_CREATE_SALES_DOCU                         *
         Form  salesdocu
         This Subroutine is used to create Sales Order
         -->P_HEADER           Document Header Data
         -->P_HEADERX          Checkbox for Header Data
         -->P_ITEM             Item Data
         -->P_ITEMX            Item Data Checkboxes
         -->P_LT_SCHEDULES_IN  Schedule Line Data
         -->P_LT_SCHEDULES_INX Checkbox Schedule Line Data
         -->P_PARTNER  text    Document Partner
         <--P_w_vbeln  text    Sales Document Number
    DATA:
      lfs_return like line of t_return.
    FORM create_sales_document changing P_HEADER  like fs_header
                                       P_HEADERX like fs_headerx
                                       Pt_ITEM   like t_item[]
                                       Pt_ITEMX  like t_itemx[]
                                       P_LT_SCHEDULES_IN  like t_schedules_in[]
                                       P_LT_SCHEDULES_INX like t_schedules_inx[]
                                       Pt_PARTNER  like t_partner[]
                                       P_w_vbeln  like w_vbeln.
    This Perform is used to fill required data for Sales order creation
      perform sales_fill_data changing p_header
                                       p_headerx
                                       pt_item
                                       pt_itemx
                                       p_lt_schedules_in
                                       p_lt_schedules_inx
                                       pt_partner.
    Function Module to Create Sales and Distribution Document
      perform sales_order_creation using p_header
                                         p_headerx
                                         pt_item
                                         pt_itemx
                                         p_lt_schedules_in
                                         p_lt_schedules_inx
                                         pt_partner.
      perform return_check using p_w_vbeln .
    ENDFORM.                                 " salesdocu
        Form  commit_work
        To execute external commit                                    *
    FORM commit_work .
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
       WAIT          = c_x
    ENDFORM.                                 " Commit_work
    Include ycl_sales_order_header          " To Fill Header data and Item data
    Include ycl_sales_order_header.
         Form  return_check
        To validate the sales order creation
    FORM return_check using pr_vbeln type vbeln.
    if pr_vbeln is initial.
        LOOP AT t_return into lfs_return .
          WRITE / lfs_return-message.
          clear lfs_return.
        ENDLOOP.                             " Loop at return
      else.
        perform commit_work.                 " External Commit
        Refresh t_return.
        fs_disp-text = text-003.
        fs_disp-number = pr_vbeln.
        append fs_disp to it_disp.
      if p_del eq c_x or p_torder eq c_x or
        p_pgi eq c_x or p_bill eq c_x.
        perform delivery_creation.           " Delivery order creation
        endif.                               " If p_del eq 'X'......
      endif.                                 " If p_w_vbeln is initial
    ENDFORM.                                 " Return_check
    *&      Form  sales_order_creation
          text
         -->P_P_HEADER  text
         -->P_P_HEADERX  text
         -->P_PT_ITEM  text
         -->P_PT_ITEMX  text
         -->P_P_LT_SCHEDULES_IN  text
         -->P_P_LT_SCHEDULES_INX  text
         -->P_PT_PARTNER  text
    FORM sales_order_creation  USING    P_P_HEADER like fs_header
                                        P_P_HEADERX like fs_headerx
                                        P_PT_ITEM like t_item[]
                                        P_PT_ITEMX like t_itemx[]
                                        P_P_LT_SCHEDULES_IN like t_schedules_in[]
                                        P_P_LT_SCHEDULES_INX like t_schedules_inx[]
                                        P_PT_PARTNER like t_partner[].
        CALL FUNCTION 'BAPI_SALESDOCU_CREATEFROMDATA1'
        EXPORTING
          sales_header_in     = p_p_header
          sales_header_inx    = p_p_headerx
        IMPORTING
          salesdocument_ex    = w_vbeln
        TABLES
          return              = t_return
          sales_items_in      = p_pt_item
          sales_items_inx     = p_pt_itemx
          sales_schedules_in  = p_p_lt_schedules_in
          sales_schedules_inx = p_p_lt_schedules_inx
          sales_partners      = p_pt_partner.
    ENDFORM.                    " sales_order_creation
    this is code to create sales document
    plzz reward if it is usefull...
    plzz dont forget to reward......

  • Need sales order creation using bapi in oops

    need code for sales order creation using bapi in oops

    hi rocky,
              could you pls give a bit explanation on what you are expecting.
    regards,
    Pavan

  • Need code for Sales order creation in oops using xi as integration server

    Need code for Sales order creation in oops using xi as integration server.

    hi rocky,
              could you pls give a bit explanation on what you are expecting.
    regards,
    Pavan

  • Is it possible to avoid duplicate material in Sale order creation

    Dear SD gurus
    Is it possible to avoid material duplication in va01 sale order creation. For amendment purpose the marketing user making new line item with amended qty instead of quantity change. kindly advise me to solve the problem.
    Thanks & Regards
    R.Udayakumar

    HI,
    There's no alternative to user disciplibe . Business reqt are sometimes like this only
    what you can do is use exit mv45afzz in saels order and put coding logic . this will surely work.
    {Removed by Moderator}
    regards
    Edited by: Lakshmipathi on Aug 29, 2009 6:13 PM

Maybe you are looking for