Copy down Ship-to Partner from main item to sub-items on Sales Order

This is my first post on the forums here.  I'd appreciate any help you can give on my issue below.
I have a requirement to copy down the ship-to partner from the main item to sub-items during sales order create or change.  Currently I have code in include MV45AFZB within user exit USEREXIT_FILL_VBAP_FROM_HVBAP as follows:
<i>* Need to be able to copy the ship-to of a BoM parent down to the
respective BoM children if the parent has a different ship-to
from the header.
data:  wa_xvbpa like vbpa.
Clear: wa_xvbpa.
read table xvbpa into wa_xvbpa with key posnr = hvbap-posnr
                                        parvw = 'WE'.
A BoM parent line has a different ship-to from the header.
    if sy-subrc = 0.
      read table xvbap with key uepos = hvbap-posnr.
See if current line is the child of that BoM parent
        If xvbap-uepos = hvbap-posnr.
          move wa_xvbpa-kunnr to xvbpa-kunnr.
          move xvbap-vbeln to wa_xvbpa-vbeln.
          move xvbap-posnr to wa_xvbpa-posnr.
          move 'WE' to wa_xvbpa-parvw.
          modify vbpa from wa_xvbpa.
        endif.
      Endif.</i>
This isn't working for me.  At one point, I was able to copy the ship-to down to the first sub-item but not any subsequent ones.  I'm sure I need to add some code to another sales order user exit to get this to work, but I'm at a loss at this point.   Has anyone had to do this or something similar before? 
Thanks very much in advance for your help.
Angela

Hi,
Can you check few more things and tell me?
- In this exit, does XVBPA and XVBAP contains all the line items. ( main and sub items ).
- In Sales order creation time, do these table have VBELN populated when this exit triggers.
- If you modify XVBPA or XVBAP in this exit, do they get overwritten after that.
Try this code. See if it works.  Let me know if you still have a problem.
DATA: wa_hvbpa LIKE vbpa,
      wa_xvbpa like vbpa.
CLEAR: wa_hvbpa, wa_xvbpa.
* check if HVBAP and VBAP line items are not same
IF vbap-posnr <> hvbap-posnr.
* read the ****-to partner from main-item
  READ TABLE xvbpa INTO wa_hvbpa WITH KEY posnr = hvbap-posnr
                                          parvw = 'WE'.
  IF sy-subrc = 0.
*   read the line item data for sub-item based on main item
    READ TABLE xvbap WITH KEY posnr = vbap-posnr
                              uepos = hvbap-posnr.
* See if current line is the child of that BoM parent
    IF sy-subrc = 0.
      MOVE wa_xvbpa-kunnr TO xvbpa-kunnr.
      MOVE xvbap-vbeln TO wa_xvbpa-vbeln.
      MOVE xvbap-posnr TO wa_xvbpa-posnr.
      MOVE 'WE' TO wa_xvbpa-parvw.
      MODIFY vbpa FROM wa_xvbpa.
    ENDIF.
  ENDIF.
ENDIF.
Regards,
RS

Similar Messages

  • Material exchane ,copy pricing and conditions from main item to sub item.

    Hi All,
    We are using parts exchange/interchangeability in the transaction ME22N,
    While using ME22N we are exchanging  main item with interchangeable part and while doing so we want to copy pricing and conditions from main item to sub item.
    But its not happening.
    As per sap help its possible, details describe below.
    http://help.sap.com/erp2005_ehp_04/helpdata/en/c2/0a5288b77d11d3bcce00105ab03aee/content.htm
    Price Determination by Copying from Main Item
    In the case of price determination by copying from the main item, the net price of the originally ordered part is still used for the superseding part in a part exchange.
    The system copies all conditions from the main item to all sub-items and takes into account the order quantity for the main item when calculating scale prices. It does not take into account the conditions and scale prices that exist for the interchangeable part.
    You cannot change the conditions, which have been copied from the main item, at sub-item level. It is possible, however, to define additional conditions for each sub-item.
    Prerequisites
    A calculation schema, which can be altered on an individual basis in Customizing, has been supplied for the price determination.
    In the vendor master record, you have set the schema group 09 (interchangeable material).
    But in customizing I didnu2019t find value 09 for schema group .
    Can any buddy through some light on missing pieces which need to be set?
    Thanks
    Regards
    Ritesh

    Hi,
    Can you check few more things and tell me?
    - In this exit, does XVBPA and XVBAP contains all the line items. ( main and sub items ).
    - In Sales order creation time, do these table have VBELN populated when this exit triggers.
    - If you modify XVBPA or XVBAP in this exit, do they get overwritten after that.
    Try this code. See if it works.  Let me know if you still have a problem.
    DATA: wa_hvbpa LIKE vbpa,
          wa_xvbpa like vbpa.
    CLEAR: wa_hvbpa, wa_xvbpa.
    * check if HVBAP and VBAP line items are not same
    IF vbap-posnr <> hvbap-posnr.
    * read the ****-to partner from main-item
      READ TABLE xvbpa INTO wa_hvbpa WITH KEY posnr = hvbap-posnr
                                              parvw = 'WE'.
      IF sy-subrc = 0.
    *   read the line item data for sub-item based on main item
        READ TABLE xvbap WITH KEY posnr = vbap-posnr
                                  uepos = hvbap-posnr.
    * See if current line is the child of that BoM parent
        IF sy-subrc = 0.
          MOVE wa_xvbpa-kunnr TO xvbpa-kunnr.
          MOVE xvbap-vbeln TO wa_xvbpa-vbeln.
          MOVE xvbap-posnr TO wa_xvbpa-posnr.
          MOVE 'WE' TO wa_xvbpa-parvw.
          MODIFY vbpa FROM wa_xvbpa.
        ENDIF.
      ENDIF.
    ENDIF.
    Regards,
    RS

  • How to copy Characteristics of main item to sub item after RBATP?

    Hi Experts,
    We are having MTO process, where we are creating sales order
    for configurable material. Then we are triggering RBATP and getting
    confirmation based on product allocations.
    But while creating sub items after RBATP, sales order not updating
    configurable characteristic values from main item (TAPA) to sub item (TAN).
    System is asking to maintain characteristic values for sub item again during
    RBATP manually.
    How we can copied these characteristic values of configurable material from
    main item to sub item automatically?
    Regards,
    Narendra

    Hi Experts,
    We are having MTO process, where sales order for configurable material. For these SO,
    we are triggering RBATP and getting confirmation based on product allocations
    & then accordingly it will consider for further planning in APO. But while
    creating sub items for SO after RBATP, system is not updating configurable
    characteristic values from main item (TAPA) to sub item (TAN) automatically.
    System is asking to maintain these characteristic values for sub item again
    during RBATP manually.
    We need to understand, how we can copy these characteristic values of configurable
    material from main item to sub item automatically?

  • Copy control line item to sub item condtion gets removed

    Hi All,
    there is an problem happening when I create return order in CRM. when I try to create a sub line item from main item the sub item gets created with diffrent condition type. I check copy control setting all looks fine but while debugging I check that this is happening due to price zone field value in CRM which is coming as zero . When its get compare with ECC which is 008 at run time re-price happen when this condition gets fail.
    I need to know how come I will be able to see the setting of prize zone and incase it needs to download from ECC with which object I can perform the load.
    find my analysis below.
    Price zone is there in CRMD_PRICING_I table
    Setting define item category determination when copying  defined
    item cateogry mapped in Pricing option Assign copy type
    Active pricing for item categories all seems correct except pricing indicator
    Thanks

    Hi,
    Can you check few more things and tell me?
    - In this exit, does XVBPA and XVBAP contains all the line items. ( main and sub items ).
    - In Sales order creation time, do these table have VBELN populated when this exit triggers.
    - If you modify XVBPA or XVBAP in this exit, do they get overwritten after that.
    Try this code. See if it works.  Let me know if you still have a problem.
    DATA: wa_hvbpa LIKE vbpa,
          wa_xvbpa like vbpa.
    CLEAR: wa_hvbpa, wa_xvbpa.
    * check if HVBAP and VBAP line items are not same
    IF vbap-posnr <> hvbap-posnr.
    * read the ****-to partner from main-item
      READ TABLE xvbpa INTO wa_hvbpa WITH KEY posnr = hvbap-posnr
                                              parvw = 'WE'.
      IF sy-subrc = 0.
    *   read the line item data for sub-item based on main item
        READ TABLE xvbap WITH KEY posnr = vbap-posnr
                                  uepos = hvbap-posnr.
    * See if current line is the child of that BoM parent
        IF sy-subrc = 0.
          MOVE wa_xvbpa-kunnr TO xvbpa-kunnr.
          MOVE xvbap-vbeln TO wa_xvbpa-vbeln.
          MOVE xvbap-posnr TO wa_xvbpa-posnr.
          MOVE 'WE' TO wa_xvbpa-parvw.
          MODIFY vbpa FROM wa_xvbpa.
        ENDIF.
      ENDIF.
    ENDIF.
    Regards,
    RS

  • Passing values from main report to sub-reports

    - How do we pass values from main report to sub-report?

    Look at this link which shows how to pass values from a subreport to a main report.
    http://www.datamanagementgroup.com/resources/trainerstalk/trainerstalk_howto_share_subreport_data_with_main_report.asp
    You can use the same method to pass values from main report to a subreport.
    1) Create a formula @mainFormula in the main report, as given in item 1 of link.
    2) Place this formulla in a suppressed report footer section above the target subreport.
    3) In the subreport, create a formula @subFormula that declares the same variable name, as given in item 3 of link.
    4) Place @subFormula column in the subreport where you want to display it.

  • RENN item not flowing in return sales order automatically

    Hi all,
    When i add RENN in item category proposal for copy control of billing doc to sales doc(YDRE to YDF2) where YDRE is return and YDF2 is outbound billing. So when I create a return order with reference to invoice will the free good item flow automatically in the return sales order or is there any other configuration???

    Hi Avishek,
    Check your item category assignment first that renn is properly assigned to your
    Order type u2013 item category group u2013 usage u2013 item category at higher level.
    You can do this from the path
    IMG u2013 sales and distribution u2013 sales u2013 sales documents u2013 sales document item u2013 assign item category.
    Do this setting first then go copying control with the following path.
    IMG u2013 sales and distribution u2013 sales u2013 Maintain copy control for sales document.
    Search for your sales document type YDRE from billing document YDF2.
    Go to the item level and search for item category used in billing document.
    Go to the detail of that item category you will find item category proposal.
    Write down over there RENN.
    Now try to create the return sales order it will happen.
    This setting you have to do so that it will automatically determine in sales order.
    Regards
    Raj.

  • Item Partners Check box in Sales Order

    Hi all,
    What is the functionality and configuration settings of Item Partners Check box in sales order, partner function tab line item level?
    When i find the check box marking then it allows me changes by double clicking of the partner and changing the address, but when the same check box is not marked then it is in dispaly mode when i double click it.
    So please suggest me how to control its features.
    Thanks in Advance,
    Cheers,
    Anil.

    Hello,
    If this indicator is activated, the partner is validated at item level.
    It may happen that in a business transaction the partner in the document header does not apply to all items, for example, if specific goods for a customer are normally delivered to another ship-to party.
    In sales documents and billing documents you can enter one of the deviating partners from the document header at item level.
    When creating a document , the system copies the document header partners to the items. If you want to define another partner than the one in the document header at item level, overwrite the proposal from the item partner screen.
    Prase

  • Item credit price changed in Sales order - credit management.

    Dear Friends,
    In Sale order item change log shows ' item credit price changed' . Item credit price  comes from 'Total ' value line in pricing which is the sum or prices and taxes. But where as none of prices and taxes that contribute to this total have been changed,  the change long shows item credit price as changed from a value to other .
    This sale order has many items and for most items same is the case. For some items it looks like quanity got confirmed eventually through back order or availability check from VA02. The  change log for the document also shows 'credit released value' also as changed.
    User wants to know how item credit price which is nothing but total value line is shown as changed when none of the prices and taxes have been changed
    Could someone throw light on this?
    Regards
    Mahesh.

    Hi Murali ,
          First, Thanks for the reply .
        In this issue what happened is,  after couple of items  added, the sales order was released for credit check. Later changes have been made to this credit released document either by way of adding new items or by confirming the availability check for some items . Because of this change log is showing ' realeased credit vlaue' as changed from certain vlaue to the other . How this could have affected change in item credit price    which is coming form toal value line which is nothing but netvalue ( price -disccount+ taxes assingend with subtoal 'A' ) ?
    What exactly is the concept of released credit value and its relation to item credit price ?
    As per releasing the document that is not a problem but user's request is he  wants to know why this is happening .
    Please help me in understanding this better.
    regards
    Mahesh

  • How to create ship to party and sold to party for DC10 during sales order ?

    Hello all:
    When creating sales order for a material in VA01 with sales Org 1000,
    distribution channel 10, division 00
    The system does not give me any Ship to Party and Sold to Party with the above combination
    How to create ship to party and sold to party with the above combination (Plant 1000,
    sales org 1000, distribution channel 10, during creation of a sales order
    Ironically, when creating material master for a material with a material type KMAT, plant 1000
    sales org 1000, the only distribution channel is populating in the input help (F4) is 10
    For which no ship to party neither sold to party is maintained in sales order creation
    Thanks in Advance!!

    Dear Eshwer
    It is bcoz, the said account groups (Sold To Party and Ship To Party) are not created in the sales area 1000 / 10 / 00.
    To create a customer master, you have to go to XD01, select the Account Group, Company Code and the respective Sales Area and execute.  In the Customer Master, you have three tabs, viz.General Data where you have give address details of the customer, then in Control Data, you have to assign the respective Recon Account and in Sales Area Data, you have to maintain the customer's sales related details.  Once you give all these datas and save the data, a customer code will be displayed at the bottom.
    Now go to VA01, input the sale order type and the sales area and execute.
    thanks
    G. Lakshmipathi

  • New Line Item to be created in sale order

    Hi,
    Client requires a new line item to be created in sale order for particular regions only..
    Scenario 1 :
    For a particular region Additional Tax shud be calculated on Basic Price .
    Scenario 2 :
    For a particular region Cess on Vat need to incorporated.
    Client wants to maintain condition records in Cond Type :UTXJ and also the client shall maintain a 2 different Tax Codes for above each scenarios,  In future in case Additional Tax or Cess on Vat is applicable to other regions it shud get posted in their respective G/L's
    Plz suggest...
    Thanx...

    It would be wonderful had you shared your suggestion in this forum itself rather sending to personal mail ids which is against the rules and regulations of this forum.
    I request you to dont do that please.

  • How to change the line item storage location during the sales order creatio

    How to change the line item storage location during the sales order creatio

    Hi Kumar,
    I think you can just delete it in the sales order directly, if you are using make-to-order scenario, then there will be special stock left for the sales order as the production has been goods receipt, you need to use MM transaction move the stock to unrestricted use stock. If you are using make-to-stock scenario, there should be no further problem. If you are using assembly order, please try to reject the sales order item to see if it could fullfill your requirement.
    Regards,
    Rachel

  • How many line items can be entered in sales order(maximum)

    hi,
    how many line items can be entered in sales order(maximum)
    SRK

    Hi SRK,
    The maximum number of line items in a SO or Invoice is 9999.
    Please close the thread if answered.
    regards
    Param

  • Copying of Shipping tab fields from Customer master to Sales Order.

    Dear SAP SD Gurus,
    I am trying to create an Order, but the Data in the Shippining tab of the Customer Master doesnt get Copied  in to the Sales ORder.
    the Fields in the Cuystomer master are 1) Partial delivery per item 2) Max. partial deliveries.
    and this happens specifically for  a particular Sales Area.
    the same order when created with  the same customer master but a Different Sales Area, the data gets Copied correctly.
    can some body quickly advise me, if there is a Standard setting to maintian such a vehaviour or Could there be some "Z Developmet".
    thank you in Advance.
    Regards,
    Santa Khattri.

    Hello Friend,
    Check your customers (use tcode XD03 - provide sales area) the Shipping tab
    1) Partial delivery per item
    2) Max. partial deliveries.
    for the Sales Area which is not copying to sales order.
    If it is not maintained, then maintain the same as your requirement.
    Thanks & Regards
    JP

  • Link between actual ship date of an item and schedule line in Sales Order

    So, we are developing a custom report that compares actual Ship Date (Goods Issue Document MKPF-BUDAT) and the date the item should've been shipped (Schedule Line Date).
    I am able to link the GI Document to Delivery Document and can then link to Sales Order Number/Item Number.  However, a line item can have multiple schedule lines.  What logic can be put in the mapping so that the correct scheduling line is picked for the GI date to be compared against?
    Example:
    Sales Order 123
    Item 10 Product X - Quantity 10
    Schedule Line 1: 11/15/2014 8 pieces
    Schedule Line 2: 12/15/2014 2 pieces
    Let's say first shipment gets delayed 2 months and ships 1/15/2015
    Due date in report should know to select 11/15/2014 to calculate that shipment was late 60 days
    Any way to link delivery document to a specific schedule line??
    Thanks!!

    Hello,
    Just did similar development for customer report. List of deliveries based on sales order number and sales order line item numbers. Sort these deliveries either with number or actual goods issue date. Compare goods issue quantity with schedule line quanity and start allocating deliveries to schedule line. For example
    Schedule line 1 - 10 MT, Schedule line 2 - 5 MT. Now you have created 3 delivery. First with 7MT, second with 5MT and third with 3MT. Your first delivery will be for first schedule line. Your second delivery is for first and second schedule line and your thrid delivery will be for second schedule line
    Regards,

  • Serial Number assignment for main items and sub items

    Hi
    All, good evening, i need clarificaction on the serial number assignment. My client's requirement is to maintain the serial numbers, so in this regard when i am confirming production order in this i need some information how the serial numbers are picked and consumed for main items and the sub items.
    I need someone to help me in solving this.
    Regards
    Narsing

    dear Narsing,
    please look here:
    http://help.sap.com/saphelp_47x200/helpdata/en/dd/f8c817b3f911d1896e0000e8284931/frameset.htm

Maybe you are looking for

  • Upgrade R12.0.4 DB 10.2.0.3 to 11.1.0.7

    Hi All, I have followed the below steps to upgrade R12 DB on SLES 10 SP2 from 10g to 11g 3- Perform pre-requsites for patch 6928236 4- Apply INTEROPERABILITY PATCH 6928236 5- Apply TXK - 12.0.4 Consolidated Patch 1 7207440 6- Perform patch 7207440 po

  • Crystal Reports 2008 - IsNull Problem

    Hello all. Hope this is the correct forum for this. I have searched but not not find it previously reported. Or users can amend existing reports, which are maintained and executed by a VB.NET 2005 program. We have discovered an issue in  using Crysta

  • Final Cut Pro Freezing

    When I open Final Cut Pro, it opens fine. I check out sequences for about 30 mins without any issues. Then I edit something in one sequence. I am able to do my editing just fine. But then I get a message that the project is loading. I thought that th

  • Run Java program in Hidden mode

    Dear friends, how can I run my JAVA program, so that it is not shown on task-bar list or in task manager list Thank you

  • Stonlen iPod

    My iPod was stolen how do i track it down? is there a way to find out where it is?