To add line items to sales order using User exit.

Hi ,
I have to add line items to sales order .
I have tried adding the code in usr exit move field _VBAP // Check VBAP and in savedocument _prepare . But in all the places I dont see it in VA01 . I can see it in the VA02 and VA03 . But I am not able to save the order as they have made the flooring term as mandatory field, and I am supposed to populate the XVBKD structure for this.
Pls tell me whts the procedure like say , should I popluate the XVBKD / XVBAP / and should i use the bapi_SALES_ITEM_CHECK to populate the structures at the save_document prepare.

Hi,
1. It is not possible to delete records using DTW, only importing new records or updating existing ones are supported. These are the only valid operations via DTW.
2. It is possible to delete the contents of an edit text field by using the character / or -1. However it is not possible to clear an entire row/line using this notation.
Thanks & Regards,
Nagarajan

Similar Messages

  • How to ChangePlantfor each item of Sales order using User Exit SAVE_DOCUMEN

    Hi All,
    I have to change plant for Each line item of sales order using (MV45AFZZ) (USEREXIT_SAVE_DOCUMENT) based on first Schedule line.
    if Confirmed Quantity is Less than Ordered Quantity.
    based on first Schedule line.
    it has to select other Plant and need to populate it in line item of sales order.Please see the below code and let me knoe if any changes required... Thanks in Advance.
    data : wa_vbep like xvbep,
           Lv_matnr type mara-matnr,
           lv_werks type marc-werks.
    DATA: it_vbap TYPE STANDARD TABLE OF vbap,
          wa_vbap TYPE vbap.
    field-symbols: <wa_vbap> type VBAPVB.
    clear wa_vbap.
    *loop at xvbap into wa_vbap.
    loop at xvbap assigning <wa_vbap>.
    read table xvbep into wa_vbep with key posnr = <wa_vbap>-posnr.
    if wa_vbep-ETENR = '0001'.
    if sy-subrc = 0.
    IF wa_VBEP-BMENG LT wa_VBEP-WMENG.
        SELECT SINGLE DWERK
                     INTO lv_werks
                     FROM MVKE WHERE matnr = <wa_VBAP>-matnr
                                and  DWERK ne <wa_VBAP>-werks.
    if not Lv_werks is initial.
    if lv_werks EQ 1033.
    move '1002' to <wa_vbap>-werks.
    if sy-subrc eq 0.
      xvbap-werks =  <wa_vbap>-werks.
    modify xvbap from <wa_vbap> .
    endif.
    elseif lv_werks EQ 1003.
    move '1003' to <wa_vbap>-werks.
    elseif lv_werks EQ 1010.
    move '1010' to <wa_vbap>-werks.
    endif.
    endif.
    endif.
    endif.
    endif.
    endloop.
    endif.
    Regards,
    Sudhakar Reddy.A

    You have to use the form routine "USEREXIT_SAVE_DOCUMENT_PREPARE"
    regards
    Vinod

  • Automatically add line-items to Sales order

    Hello,
    Our client needs us to add line items to sales orders. The requirement is such that, when the users enter a material on a line item, they wish to see few more materials automatically added as new line items -- item category to be maintained as "Free" items. This appears similar to automatically getting BOM-sub-items for materials which have BOMs maintained. The client is not willing to maintain BOMs for materials in question. They instead have asked us to maintain sub-item materials in a Z-table and then fetch those to populate the subsequent line-items on the sales order.
    So far, we have tried to fiddle around with the XVBAK and XVBAP internal tables in sales exit (MV45AFZZ) and also tried to use BAPI within the same exit. Both methods do not work.
    Could you please guide us ? Thank you.
    Regards,

    Hi,
    I think you can try with product proposal(Item Proposal). T.Code:VA51.
    Using this one can create list of items to be proposed at the time sales order processing.
    Item proposal contains list of items with or without default quantities those were frequently ordered by the customer. You can create any no of items in an Item proposal.Like wise you can create any no.of item proposals.
    But,You can assign only one item proposal per customer in sales tab of the CMR.So that when ever you are creating order for that customer you can access those materials which are listed in an Item proposal completely or selectively,with or without default quantities.
    The items which are proposed from an Item proposal are always changeable.
    Item proposal makes sales order processing simple and fast.
    Only the thing here is it will not automatically explode like in case of BOM.You have to manually select those items from an item proposal.
    Regards,
    Revan
    Edited by: REVAN on Dec 23, 2008 10:55 AM

  • Automatically add line-items to sales orders

    Hello,
    Our client needs us to add line items to sales orders. The requirement is such that, when the users enter a material on a line item, they wish to see few more materials automatically added as new line items -- item category to be maintained as "Free" items. This appears similar to automatically getting BOM-sub-items for materials which have BOMs maintained. The client is not willing to maintain BOMs for materials in question. They instead have asked us to maintain sub-item materials in a Z-table and then fetch those to populate the subsequent line-items on the sales order.
    So far, we have tried to fiddle around with the XVBAK and XVBAP internal tables in sales exit (MV45AFZZ) and also tried to use BAPI within the same exit. Both methods do not work.
    Could you please guide us ? Thank you.
    Regards,

    Ist method:
    Maintain one Ztable with the fields of Material and sub materials.
    write BDC to create order,before entering the material  number check if material is existed in Ztable or not.
    If it exist take that material and added as a another line item.
    if not exist create like normal line item.
    2 nd method:
    Ask your MM functional consultant to maintain supression of materials concept.

  • How to add line item to sales order item table?

    Kindly help me the with the below requirement .
    Add line item to sales order(va01) dynamically on click of button. The button is also custom created push button.
    In the above requirement I have added the pushbutton to va01 tcode. But when I click on that button I need to add line item to sales order item table.
    I tried a lot but I am not successful. If possible can u please help on this.
    Regards,
    Rachel

    Hi!
    It's quite easy even in the standard SAP to add a line item for a customer order, I don't think it worth to develop a new button for this.
    However if you wanted to add a line automatically, the you can do the following in the program MV45AFZZ, FORM USEREXIT_SAVE_DOCUMENT.
    You can use similar code, but with some modifications.
    DATA: lv_posnr.
    LOOP AT xvbap.
    MOVE xvbap-posnr TO lv_posnr.   "get the last posnr
    ENDLOOP.
    ADD 10 TO lv_posnr.
    MOVE 'XYZ' TO xvbap-matnr.   "enter your material number here
    MOVE lv_posnr TO xvbap-posnr.
    * fill additinal field data in XVBAP if necessary
    MOVE 'I' TO xvbap-updkz.                  "Insert line
    APPEND xvbap.
    Regards
    Tamá

  • Add Line Item In Sales Order VA01

    HI All,
    I  have new requirement in creation of sales order . Here we have free promotion sales . Here if customer buy one material then he will get some other material as free .In standard sap we can give only one line item as free not more than that .
    Here our requirement is more than one line item . I suggested them maintain all the free materials in one Ztable when ever the original material  will come for  sales order then i have to fetch these materials from ztable  automatically and it should create sales order. I started doing this using user exit  FORM USEREXIT_MOVE_FIELD_TO_VBAP.
    These are the below links i checked in our sdn.
    Adding Line items to sales order on creation using User-Exit in VA01.
    Please give me some idea on this .
    Regards,
    Madhu.

    Hi Asik,
    Thanks for your reply.In my case i can not got for Bom  because the schemes will change for every ten days. I think Bom  creation will fill a lot of data but it wont solve my issue.
    Regards,
    Madhu.

  • Deletion of line items from Sales Order using DTW

    Hi Experts
    I have 160 sales which all require a particular item needs to be
    deleted before they can be processed further.  It is ths same item on every order but
    doesn't appear at the same row number.  In some cases it may appear more than once
    on an order.
    The line item needs to be deleted based on the row numbers which could be different on every order (LineNum)
    Rather than have admin go through them 1 by 1 and delete the
    row is it possible I can use DTW to perform an update on each row to delete it?
    I'm not sure how to do this since I have only ever used DTW
    to add or edit.
    Thanks
    Geoff

    Hi,
    1. It is not possible to delete records using DTW, only importing new records or updating existing ones are supported. These are the only valid operations via DTW.
    2. It is possible to delete the contents of an edit text field by using the character / or -1. However it is not possible to clear an entire row/line using this notation.
    Thanks & Regards,
    Nagarajan

  • Add a new line item in VA01/VA02 using user exits.

    Hi Experts,
    I have a problem regarding adding of line items in VA01/VA02. I was able to add a line item but my problem is, there is no validation for the added line. I want SAP to validate it before posting it to database. I'm using USEREXIT_SAVE_DOCUMENT_PREPARE for this one.
    I also found out from other threads, that adding line items in XVBAP is not advisable since no checking will be done after USEREXIT_SAVE_DOCUMENT_PREPARE.
    I'm thinking if I can use FM DYNP_VALUES_UPDATE on one of the user exits to add a line item in VA01/VA02 and let SAP do the checking and validation. This way, I'm sure that the added line is correct and data integrity will be maintained.
    Do you have any comments/suggestions about this?
    Thanks a lot,
    Arman.

    Hi,
    I am trying to do this as well but I don't get it working...
    I am able to add records to XVBAP, but those never show up in my sales order.
    I have found that I should also add records to XVBEP, XKOMV and XKOMP before it will be working, but when I add something to XVBEP I do get a dump on SAVE.
    I would like to ask people that managed to get this working to post the code as an example here.
    Thanks and best regards,
    Marnix

  • How to change price in Sales order using user exit ?

    The scenario is -  when the user creates a sales order,  there has to be an RFC called to another system to get the price of the materials in that system. Then it has to overwrite that price in this S.O.
    Which exit in S.O can be used for this and then what processing needs to be done after the RFC call to get price. Like how the price can be overwritten on this S.O ? (Lets say to get price we use some BAPI to the other system).  Any help ?

    Dear Theodorous,
    1)Please check the Material has been extended to the second plant.
    2) Assign the second Plant to Sales Org and Dist Channel
    If you have any concern revert back the same
    Regards
    Amjath

  • How to add 100 line item in sales order at one time

    Hello Guru's
    My requirement is to add 100 line items in sales order at once.
    what can be good approach to overcome this situation.Is there some kind of tool which can be useful?
    Let me know your suggestions
    Thanks a lot in Advance

    Hi,
    do configuration for Proposal Items tab - like -
    then create sales order using with Propose items button - VA01 - then system will accept more than 50 line of materials at a time
    Please Use BAPI -- creation of Sales order
    Thanking you
    Regards
    Mahesh

  • To add the line item in Sales Order

    Hi Experts,
    I have to insert  the line item between two line item in sales order dynamically.
    How should i do this.
    any idea??
    Thanks in Advance.

    Hi,
    I guess you are talking about BOM, sub-items or free goods, wherein after you put in one item the other material defined gets added automatically in the sales order.
    That is done with the help of Item Category config by functional person.
    Check here for more info
    [Item Category|Re: Item Category;
    You can also use user exit MV45AFZZ form user_exit_move_to_vbap for a specific logic defined at runtime.
    Regards,
    Amit
    Edited by: Amit Iyer on Aug 26, 2009 10:21 PM

  • How to get Characteristic Values assigned to the line item of Sales Order?

    Hi,
    I want to get the Characteristic Values( Variant Configuration )assigned to First Line Item of Sales Order.
    I was using the Fn. Mod.: VC_I_GET_CONFIGURATION_IBASE,
    this fn. mod. giving all the Characters but not the assigned characteristic values.
    Is there any other way to find characteristic values of sales order.
    Thanks,
    vinayak.
    Message was edited by: vinayaga sundaram

    For example, please see this example program.
    It lists the characteristic names, the values, and the description of the values which are tied to a sales document.
    report zrich_0001.
    * Internal Table for Characteristic Data
    data: begin of i_char occurs 0.
            include structure comw.
    data: end of i_char.
    data: xcabn type cabn.
    data: begin of xcawn,
          atwtb type cawnt-atwtb,
          end of xcawn.
    data: xvbap type vbap.
    parameters: p_vbeln type vbap-vbeln,
                p_posnr type vbap-posnr.
    start-of-selection.
      select single * from vbap into xvbap
                 where vbeln = p_vbeln
                   and posnr = p_posnr.
      clear i_char.  refresh i_char.
    * Retrieve Characteristics.
      call function 'CUD0_GET_VAL_FROM_INSTANCE'
           exporting
                instance           = xvbap-cuobj
           tables
                attributes         = i_char
           exceptions
                instance_not_found = 1.
      loop at i_char.
        clear xcabn.
        select single * from cabn into xcabn
                 where atinn = i_char-atinn.
        clear xcawn.
        select single cawnt~atwtb into xcawn
                   from cawn
                     inner join cawnt
                       on cawn~atinn = cawnt~atinn
                      and cawn~atzhl = cawnt~atzhl
                          where cawn~atinn = i_char-atinn
                            and cawn~atwrt = i_char-atwrt.
        write:/ xcabn-atnam, i_char-atwrt, xcawn-atwtb.
      endloop.
    Regards,
    RIch Heilman

  • How to make the line items of sales order cannot be deleted.

    Hi All,
    Is there any Enhancement spots or user-exits which make the line items of sales order cannot be deleted if item category is 'TAN'.
    Thanks in Advance,
    Sudhakar Reddy .A

    Hi All,
    If you doesn't want to delete sales order line items then we have write in the Include Program which has mentioned below and in the form .....endform.
    Program Name :  Include MV45AFZB
    _Example:_
    form userexit_check_xvbap_for_delet using us_error
                                              us_exit.
    IF .......
      US_EXIT = CHARX.
    ENDIF.
    endform.

  • Mrp run on no of line items in sale order

    hi all
    i have a sale order with o line items include.
    i want to run mrp on sale order only (not want to use MD50)
    can i use user exit for this task ? if so please advise which user exit i can use ?
    thanks

    Dear,
    Please refer this link,
    [Mrp run on no of line items in sale order|Re: MD50 issue]
    Regards,
    R.Brahmankar

  • Is it possible to limit line items in sales order????

    is it possible that i can limit the ender user adding more line items in sales order???

    hi
    there is such standard restriction setting, but instead can use USEREXIT_SAVE_DOCUMENT_PREPARE (user exit)
    Reward if Useful
    Thanx & regards.
    Naren..

Maybe you are looking for

  • How do I get my apps and pics from iPhone to iPad?

    How do I sync my photos and music from my I phone to my iPad? I have sync'd on iTunes but can't figure out how to get iTunes to recognize what I have purchased already.

  • Connecting to another Mac via ethernet

    I have been doing some importing and editing on a 13" Macbook Pro and want to transfer some Events and Projects to my MacPro via a direct ethernet connection between the 2 machines. I can see each of the connected computers in each of their Finder wi

  • P.O error

    Hi, while doing P.O in ME21n i am getting this error. Account assignment mandatory for material VST1000 (enter acc. ***. cat.) Message no. ME062 Diagnosis There is no provision for value-based inventory management for this material type in this plant

  • Container objects

    With Swing components, Is there an easy way to see if a particular object is contained within another object? For example, how can I tell if one panel is located in another panel?

  • Reinstallation of iCal .

    Hi, I have been more than one month didn't turn on my iMac because I'm in the business trip, then, when I turn on again, my iCal going to completely blank, all the calendars, events, to do lists, notes and reminders were disappeared, even the iCal Pr