Sale Order Exits

*Hi Friends,*
*Thanks in Advance.*
*After saving my Sale Order... the system giving the Message 'Sale Order Saved' and remains in the Same Screen in a Refresh Mode.*
*Actually my client requirement is .that they want to navigate to VA01 Transaction after saving the Sale Order.*
*Is there any User Exit or any Customizing Work or any Enhancement or Enhancement Spot.*
*Regards:*
*Sridhar*

Hey u can get an enhancement or an exit thats easy but with out any enhancement you can do this provided if you an add another requirement to this.One instance where it goes back to that screen when u make output as print immediately.If the client also has a requirement of printing a sales order immediately u can achieve this else you need to go through an enhancement.
Pls let me know if i am clear

Similar Messages

  • Insert code in prgram to check sales order exits in your own program

    Hi Experts
    I want to insert a coding in IDOC , can anyone write in abap coding and show .....The program is to check if sales order for category PSTYV ( CATEGORY ) for items ...
    if found set flag true else set flag false...
    Eg
    clear flag
    insert code
    to check s/o for ZTAC item found
    if found
    set flag = true
    else
    set flag = false
    So how can I write a a code in ABAP
    Thanks in advanced
    Piroz

    Hi Fracis
    Thanks for your advice I did in this way ,  Is there any correction required
    form look_sap_saleord  using    p_in_string
                                    p_material_in          " Material No exits
                                    p_site_in              " plant
                           changing p_out_saleord_e        " sales order
                                    p_out_material_e       " Mat No
                                    p_out_order_e          " Prod Order
                                    p_out_wemng_e          " QTY goods received for order item
                                    p_out_psmng_e.         " Ordered Qty Item
      data: lva_prodord like afpo-aufnr,   " Production Order
            lva_prodmat like afpo-matnr,   " Material Number
            lva_saleord like vbkd-vbeln,   " Sales Order
            lva_pstyv   like vbap-pstyv,   " Category
            lva_wemng   like afpo-wemng,   " Quantity of goods received for the order item
            lva_psmng   like afpo-psmng,   " Ordered Qty Item
            lva_count   type i.            " counter validation
    CHECK FOR SALES ORDER IN VBAP IF EXITS
    GO TO DELIVERES
    ELSE CHECK REQUIRED PRODUCTION ORDER
           ihrez_e Ship to party
    check single if the sales order exits
      select vbeln from vbkd into vbkd-vbeln
        where ihrez_e eq p_in_string.
      Is the sales order exits for ZTAN Category ?
        select vbeln from vbap into vbap-vbeln
          where vbeln eq vbkd-vbeln and
                werks eq p_site_in and
                matnr eq p_material_in and
                pstyv = 'ZTAN'.
        The sales order is for the specified plant.
          lva_saleord = vbap-vbeln.
          lva_prodmat = vbap-matnr.
          exit.
        endselect.
      when an order for this plant has been found.
        if not lva_saleord is initial.
        exit.
        endif.
      endselect.
      check not lva_saleord is initial.
      select count(*) into lva_count from vbap
        where vbeln = lva_saleord.
      if lva_count eq 1.
        select vbeln matnr aufnr pstyv
        into (lva_saleord, lva_prodmat, lva_prodord, lva_pstyv) from vbap
          where vbeln = lva_saleord and
                matnr = p_material_in and
                pstyv = 'ZTAN'.
          exit.
        endselect.
      else.
        select vbeln matnr aufnr pstyv
        into (lva_saleord, lva_prodmat, lva_prodord, lva_pstyv) from vbap
          where vbeln = lva_saleord
          and matnr   = p_material_in.
          exit.
        endselect.
      endif.
       move: lva_saleord to p_out_saleord_e,           " sales order
             lva_prodord to p_out_order_e,             " production order
             lva_prodmat to p_out_material_e,          " material no
             lva_psmng   to p_out_psmng_e,             " QTY Ordered
             lva_wemng   to p_out_wemng_e.             " Qty Received goods
            lva_wemng   to p_out_wemng_e.             " Quantity of goods received for the order item
    endform.                    " look_sap_sales ord
    Regards

  • Workflow identification in Sales Order Exit

    Hi,
    In my Sales order exit, under some conditions Iam raising an error message, when the order is being created in background this order will move to workflow. Now if any one process this order through the workflow i want to allow the order to get posted with out raising my exception.
       So I would like to know how I can identify whether my order is being posted through the workflow or directly, in the Sales order exit code.
    Thanks in advance friends,
    Anvitha.

    Hi friends,
    Thanks for your response.
    Checking whether the order is posted in Background or foreground doesn't solve my problem, because my order may be posted in Background or foreground. But when the order is processed through workflow, the processing option depends on the configuration of the Workflow object type. So SY-BATCH doesn't serve my purpose.
       Coming to using SY-UNAME, I observed that the value during the Order process through Workflow is the UserID who process it. So i can't distinguish it.
    Friends, any one had any other option to identify whether the order is being posted through Workflow.
    please help me out.
    Regards,
    Anvitha.

  • Ignore Production order if sales order exits

    Hi Experts
    I want to check some validation for sales order , The system goes in this way  ...I have to modify in this way
    we are extracting the command orders from Command QC System and inserting into SAP . Once it is extracted the Interface coding was written.....to extract sales order, production order etc.,
    Now I want to check only those records in which category are ZTAN. because some time in our company they will sold pigments which does not contain production order directly it will check for qty and delivered to customer.
    Select * from VBAP where VBELN = 'SALES ORDER' and
             MATNR = 'Material nO' and
             PSTYV = 'ZTAN'
    This is because it should not check the production order in AFPO table it must directly go to create deliveries etc for that I created to check sales order ignoring production order So can anyone help me to modify the below coding to check only sales order bu
    SALES ORDER EXITS MODIFICATION****************
    *&      Form  find_sap_salord Exits
          Find an SAP production order for a material.
         -->P_IN_STRING    COMMAND order number
         -->P_MATERIAL_IN  Material number in
         -->P_SITE_IN      Material number in
         <--P_OUT_SALEORD  Sales order number
         <--P_OUT_MATERIAL Material number out
         <--P_OUT_ORDER    Production order number
    form look_sap_saleord  using    p_in_string         " 
                                    p_material_in       " Material No exits
                                    p_site_in           " plant
                           changing p_out_saleord       " sales order
                                    p_out_material      " Material No
                                    p_out_order         " Prod Order
                                    p_out_wemng         " Qty of Goods Rec for Order Item
                                    p_out_psmng.        " Ordered Qty Item
      data: lva_prodord like afpo-aufnr,   " Production Order
            lva_prodmat like afpo-matnr,   " Material Number
            lva_saleord like vbkd-vbeln,   " Sales Order
            lva_pstyv   like vbap-pstyv,   " Category
            lva_wemng   like afpo-wemng,   " Quantity of goods received for the order item
            lva_psmng   like afpo-psmng,   " Ordered Qty Item
            lva_count   type i.            " counter validation
           ihrez_e Ship to party       
      select vbeln from vbkd into vbkd-vbeln
       where ihrez_e eq p_in_string.
      select vbeln from vbap into vbap-vbeln
        where vbeln eq p_in_string.
      Is the order for the specified plant?
        select vbeln from vbap into vbap-vbeln
          where vbeln eq vbap-vbeln and
                matnr eq vbap-p_material_in and
                pstyv in ('ZTAN')
          and   werks eq p_site_in.
        The order is for the specified plant.
          lva_saleord = vbap-vbeln.
          exit.
        endselect.
      Exit when an order for this plant has been found.
        if not lva_saleord is initial.
          exit.
        endif.
      endselect.
      check not lva_saleord is initial.
      select count(*) into lva_count from afpo
        where kdauf = lva_saleord.
      if lva_count eq 1.
        select aufnr matnr wemng psmng
        into (lva_prodord, lva_prodmat, lva_wemng, lva_psmng) from afpo
          where kdauf = lva_saleord.
          exit.
        endselect.
      else.
        select aufnr matnr wemng psmng
        into (lva_prodord, lva_prodmat, lva_wemng, lva_psmng) from afpo
          where kdauf = lva_saleord
          and matnr   = p_material_in.
          exit.
        endselect.
      endif.
      move: lva_saleord to p_out_saleord,
            lva_prodord to p_out_order,
            lva_prodmat to p_out_material,
            lva_psmng   to p_out_psmng,
            lva_wemng   to p_out_wemng.
    endform.                    " find_sap_prodord
    END OF MODIFICATION 22/09/2008*******

    Thanks  thread close
    Piroz

  • Check sales order exits for category ZTAC

    Hi Experts
    I have a requirement to modify the iDOC interfaced program,
    In the routien which checks for the existence of a production order, I have to modify the following
    1.  Inspect each item on the sales order
    2. If (and only if) there is atleast one item with a category of "ZTAC" then check for a production order otherwise processing the order in the usual manner.
    Could anyone tell me how to check (Is there a sales order) if no then display error message if yes then is there a production order if no display error message if yes Create confirmation .......................
    I want to know how to write a coding to check sales order exits from table VBAP,VBAK Etc., .
    Thanks in Advanced
    Regards
    Piroz

    Hi Prabhu
    Thanks for your email and response but I need to check this in program for IDOC ....Modification
    Insert code in this way
    check sales order for category = 'ZTAN' inspect for each item on sales order
    and if you found item with cateogry ZTAN then check for production order otherwise go asual manner
    I WANT TO WRITE A CODING HERE **********************
      if production order required then check
                    for each item on sales order item list
                          with item category = 'ZTAC' then
                                     return true
                                next
                                  end function
      VBAP TABLE field VBELN and PSTYV (ZTAC,ZTAN Etc)
    Eg of coding
    if lva_saleord is initial
            select single * from vbap into l_saleord
              where vbelv = lva_saleord
              and   vbeln = lva_vbeln and
              exit.
            endselect.
          endif.
    I want to write a small program in between to check the sales order exits if it is then I have to go to deliveries ...................
    Regards
    Eslam

  • Calling a Sales Order Change BAPI in a Sales Order Exit

    Functional Requirement:
    While creating a Sales Order with Reference to another Sales Order, on saving the new sales order, change something in the referenced sales order.
    I am trying to achieve the same by doing the following:
    In the standard SAP user exit called during saving the new sales order USEREXIT_SAVE_DOCUMENT I am calling the BAPI BAPI_SALESORDER_CHANGE on the referenced Sales Order.
    However the BAPI is unable to change the other sales order giving an error Enter the document number. I am specifying the Document Number while calling the BAPI, so I know that is not the error.
    I just wish to know whether it is technically possible to call a BAPI to update another Sales Order while we are currently saving one Sales Order.

    Hi Girish,
    If it works correctly when run seperately and you are sure the data passed into the BAPI is exactly the same then it may be something like table locks or similar causing your original problems...
    What about packaging up your working Z program into a custom function module and calling that from within USEREXIT_SAVE_DOCUMENT as a seperate task (IN NEW TASK) and building in a slight delay of say 5 seconds at the start of your code?
    I'll be honest, this isn't an ideal solution but might be sufficient to resolve your issues.  I'd be inclined to see if you could just run your Z program as a background process every 5 minutes or so to capture any changes and perform updates but if this is a no no from your functional people I'm not sure what else to suggest sorry.  I've never personally had to update a document from within the save routine of another document so can't give any advice based on my own experiences sorry.
    Gareth.

  • Ordered Qty in Sales order exit USEREXIT_CHECK_VBAP is not working

    Hi All,
      In a requirement, I changed the ordered quantity in a Sales order in the exit USEREXIT_CHECK_VBAP to a desired quantity.For eg: Some one has entered a quantity 5 and pressed enter, my program logic in that exit changed that quantity to 10, after saving it get reflected in VBAP-KWMENG as 10, uptill this it fine.
      Now the problem is when I want to see the same saved Sales Order through VA02 its show me the previously entered qty as 5 not 10.
      Kindly let me know if there is anything am missing.
      Kindly help me out.
    Thanks
    Bhagat

    write your code in the below
          FORM USEREXIT_SAVE_DOCUMENT_PREPARE                           *     
          This userexit can be used for changes or checks, before a     *     
    FORM userexit_save_document_prepare.                                        
    ENDFORM.                    "USEREXIT_SAVE_DOCUMENT_PREPARE

  • Sales Order Exit For Item Texts

    Hello all,
    I am having a very wierd issue with sales orders.
    I am creating an exit to redeterming item category of line item via the item usage field.
    The item usage field is a user defined field on the "Additional Data B" in the Sales Order.
    In MV45AFZZ, I am able to set the item category after the item usage is entered.
    Now the Item text nodes in the "Texts" tab at line item level depend on the item category.
    Thus item category ABCD has text T1 T2 & T3 assigned to it
    while item category EFGH has text T1 & T5 Assigned.
    My issue is that when the item category is changed from ABCD to EFGH, if one goes to the "Texts" Tab at line item level, the nodes shown are the same as those for item category ABCD.
    I cant find any exit to redetermine the text sequence.
    I tried USEREXIT_MOVE_FIELD_TO_TVCOM_I & TVCOM_H but they dont seem to work.
    I would really be very grateful for any help/ideas on how to get this resolved.
    Many Thanks,
    Preet

    Hello,
    Actually I dont need to either rename the text or change the contents (please correct me if wrong).
    Basically if PSTYV (itm_cat) = ABCD then text id's
    0001      Desc1
    0002      Desc2
    0003      Desc3
    0004      Desc4
    are shown.
    If PSTYV = 'EFGH' then text id's
    ID Node    Description
    0001       Desc1
    0006       Desc6
    0008       Desc8
    are to be shown ( this is what I want ).
    However right now if I change Item category from ABCD to EFGH then the nodes on the "Text Tab are
    0001       Desc1
    0002       No Description Shown
    0003       No Description Shown
    0004       No Description Shown
    0006       Desc6
    0008       Desc8
    I cant get a screenshot which would probably explain it better.
    In short is there any way of not displaying specific test-id's in the long texts for line items.
    I realise its a Friday here but any help will be deeply ..deeply appreciated.
    Many Thanks,
    Preet

  • Sales order exit - changing pricing conditions

    Hi Gurus
        We have an issue where a customer was given $0 pricing on an item within their price list, but when an order is created, the system prices the item at List Price.   Upon investigation, it was discovered that SAP cannot maintain pricing at $0 because the item categories are looking for a net value. We decided that we would create a user exist that would change the item category on the items and price that item as u201Cfree of chargeu201D for these customers. We did work on the user exit u201Csave_document_prepareu201D and were able to change the item category in sales order screen but the pricing  conditions shows net values in that tab. The question here is how to update the pricing conditions when we change the item category for each item
    Thanks
    Ganesh

    Hi Ganesh,
    For this Goto the User-Exit MV45AFZZ & From there Goto FORM USEREXIT_MOVE_FIELD_TO_VBAP.
    Now here write your condition.
    The data(Pricing details) is available in XKOMV. and The Item is in VBAP...
    Now Check if the Item & Customer are same in a Simple If Condition.. If same the Clear XKOMV[]. Thats it..  
    It Clears Teh Pricing Conditions all to 0.
    If you still have Net value & Netprice,, Then Clear the NETWR & NETPR fields As well in Header(VBAK) & Item(VBAP) as well..
    Thanks & Regards,
    Dileep .C

  • Sales order exit to bypass credit check

    Hi ,
    AS IS : if the customer exceeds the credit exposure a pop up for static credit check comes while saving the order  and the order gets blocked , and every time it has to be unblocked manually.
    To BE : Our client wants that Credit check should only happen when the customer is changing the quantity field of the order and should not get blocked every time when he is making any other change in the order and saving it .
    Please help me with this: Is this feasible ? If yes then how can I do this is, any Exit /Badi where I can actually change the way this functionality work by SAP .
    Thanks in advance
    Gaurav Deep

    Well, yes, it's possible.  Have you reviewed the documentation in the IMG, both the basic configuration section as well as the section on credit management user exits?

  • Sales Order Exit : for defining the invalid Order reason.

    Hi all,
    I am looking for an exit that may cnotain code for defining invalid entries of order reason AUGRU.
    In VA01 , in my system, while creating order , we give order reason. But these reasons have been categorized as valid or invalid.
    Basically when we go in VA01 and give order reason then, there is a Z field that determines which order reasons are invalid. It is this code I want to reach. Can anyone give any idea which exit it could be or how I could look for it.
    thanks in
    Edited by: Inesha9 on Jun 22, 2011 9:05 AM

    Hi,
    It seems, you want to validate AUGRU of VBAK
    For that try with USEREXIT_CHECK_VBAK in include MV45AFZB.
    Another thing, there is z field u are talking about. Is this Z field is a part of VBAK ?
    Let us know, if it helps you. Thanks

  • Sales Order Exit

    I'm working on the following requirement and i am stuck. Basically I have to make modifications to existing code in the Userexit MV45AFZB/USEREXIT_CHECK_VBAP. New change: if user changes the Carrier(CR) partner function at the item level I need to do a custom validation. But unfortunately this exit is not trigerring, however if there is change in Ship-to or Sold-to or Payer its triggering. Is there any userexit apart from save_document and save_document_prepare?.
    Appreciate your help..........
    Thanks,
    Rajesh.

    Hi, Rajesh.
    You want to check and control partner functions. right?
    Maybe, you can refer the following user-exits.
    <b>MV45AFZZ / userexit_move_field_to_vbak
    MV45AFZZ / userexit_move_field_to_vbap
    MV45AFZZ / userexit_move_field_to_vbkd</b>
    Regards
    kyung woo.

  • Availability check run requirement in the Sales order Save user Exit.

    Hi Gurus,
    As per the requirment we are using a user exit SAVE SALE ORDER PREPARE for BOM purpose to reconfirm the confirmation qty.
    Now we need to add one more logic in the same user exit, which will run the availabilty check run for each of the line items of the BOM and consider latest confirmation qty from it. So my concern is it possible that we can call the availabilty check run event with in the user exit SAVE SALE ORDER PREPARE or this not advisable?
    Please let me know..
      Regards,
      Babs

    HI Venkat,
    Thanks for your reply.Yes you are right availability check runs automatically at sub item level.
    But please note the customer requirment iteself is is little different from std BOM configuration.
    Currently the availabilty check is activated both at header and sub item level. They are maintaining the stock for header and sub item level.Also the these sub items are some time being sold as invidual materials. hence there exist a mismatch in the stock value between header and sub items.
    when a sales order is created both header and sub items will have confirmation with different value between each and the same mismatched values are being passed in to delivery. But the deliveries can not be processed for PGI because of the mismatched confirmation qty between header and item level.
    I guess now you the rrequirment.
    So we are using the SAVE SALE ORDER exit which will re check the confirmed qty between header and item and takes lowest confirmed qty and change the confirmed quantities from all the line items to lowest one, so that confirmation qty among all the line items are same. This is the first logic we are planning.
    Further there is one more additional process BOP need to be run for this header and sub items, which will change the confirmed qty based on the latest stock for individual line item. even in this case also the user exit SAVE Sale order is being called but we need to run the availability check run additionally because of which our requirment will be taken care.
    Regards,
    Babs

  • PO Creation from Sales Order User Exit

    Hi,
    I have a business requirement where I need to  create a Stock Transport Order (STO) for a particular kind of sales order. I outlined different options for achieving this functionality.
    1. Trigger a workflow for creating STO.
    2. Configure it an EDI output for sales orders. Using the EDI document, create STO in the same system.
    3. Create STO using BAPI from the sales order exit 'USEREXIT_SAVE_DOCUMENT'.
    I am trying to understand the issues if I go with option of creating STO from sales order user-exit. I tested it and it is working fine. But what concerns is me transaction integrity. In other words I am trying to  execute another transaction within a transaction. Both Transactions (VA01 and ME21N/BAPI) may be trying to access same tables. Anyways I havent see any potential overlap.
    I would like to know anybody implemented such a solution?
    What could be the potential issues? Does it really affect transaction integrity?
    Thanks A Lot
    Anil

    I would also be concerned with the possibility of the order failing to update AFTER you call the BAPI.  You could create a custom output type that processes on order create for that order type.  You could add your BAPI call to the processing routine of the output type.

  • User exit in create sales order

    Hi expart ,
    In sales order have 10 user exit . my requirement is n't satisfied in 10 user exit . Plz. tell me any idea my requirement is putting in sales order .

    Find the user exits below for Sales order.
    Transaction Code - VA01                     Create Sales Order
    Exit Name           Description
    SDTRM001            Reschedule schedule lines without a new ATP check
    V45A0001            Determine alternative materials for product selection
    V45A0002            Predefine sold-to party in sales document
    V45A0003            Collector for customer function modulpool MV45A
    V45A0004            Copy packing proposal
    V45E0001            Update the purchase order from the sales order
    V45E0002            Data transfer in procurement elements (PRreq., assembly)
    V45L0001            SD component supplier processing (customer enhancements)
    V45P0001            SD customer function for cross-company code sales
    V45S0001            Update sales document from configuration
    V45S0003            MRP-relevance for incomplete configuration
    V45S0004            Effectivity type in sales order
    V45W0001            SD Service Management: Forward Contract Data to Item
    V46H0001            SD Customer functions for resource-related billing
    V60F0001            SD Billing plan (customer enhancement) diff. to billing plan
    If user exists doesn't suit ur requirement then go for customer exit. Goto program MV45AFZZ then serch for Customer exists.

Maybe you are looking for

  • Please see my code and give me idea

    Hi master; first i use F2-key event and put only this code go_block(‘emp’); Execute_query; but system give me this error FRM-41008 then i use on-error event but no result Sir I use this code on-error event DECLARE errnum NUMBER := ERROR_CODE; errtxt

  • External hard drive doesn't mount

    I have a Thermaltake dual bay with two 1.5TB hard drives set up but the RAID got corrupted.  I re-partitioned one of the hard drives so that I can just do a copy but somehow the other drive was not working...guess it didn't see the RAID.  I deleted t

  • I can't roundtrip from Aperture 3.3.2 to Photoshop!

    Hi, I am having significant problems with Aperture and Photoshop interaction. As a working professional photographer it is a serious issue that is causing me real stress and it is commercially important that I rectify it quickly. After extensive test

  • Group By In PLD

    HI all, Can we use Group by clause in PLD. IF yes how to use group by.. Thanks, Neetu

  • GR against Sales order

    How can we do a GR against a sales order ? The scenario is that of  sale of subcontracting service. Here a sales order for manufacturing a certain non valuated FG is bieng made. But , how do I do the GR for the materials that the customer will send f