Over write ship to party address when sales order is created

Hi
I am creating sales order using BAPI_SALESORDER_CREATEFROMDAT2 but would like to change the shipto party address.
I want to change the following address fields of shipto party
Name1
Name2
Street
STR_SUPPL1 (Street2)
C_O_NAME (c/o name)
POSTL_COD1 (City postal code)
CITY
COUNTRY
REGION
TRANSPZONE
Following is the piece of code i wrote for partner structure and partner address structure of the BAPI.
I_ORDER_PARTNERS-PARTN_ROLE    = 'WE'.
I_ORDER_PARTNERS-PARTN_NUMB    = '0000241269'.
I_ORDER_PARTNERS-country               = 'US'.
I_ORDER_PARTNERS-TRANSPZONE    = 'US'.
I_ORDER_PARTNERS-ADDR_LINK        = ''0000201328'.
APPEND I_ORDER_PARTNERS.
  I_PARTNERADDRESSES-ADDR_NO      = ''0000201328'..
  I_PARTNERADDRESSES-NAME            = WA_CUSTOMER-NAME.
  I_PARTNERADDRESSES-NAME_2         = WA_CUSTOMER-NAME2.
  I_PARTNERADDRESSES-STREET         = WA_CUSTOMER-STREET.
I_PARTNERADDRESSES-STR_SUPPL1   = WA_CUSTOMER-STREET2.
I_PARTNERADDRESSES-C_O_NAME      = wa_customer-c_o_name.
  I_PARTNERADDRESSES-POSTL_COD1  = WA_CUSTOMER-ZIPCODE.
  I_PARTNERADDRESSES-CITY                = WA_CUSTOMER-CITY.
  I_PARTNERADDRESSES-COUNTRY     = WA_CUSTOMER-COUNTRY.
  I_PARTNERADDRESSES-REGION  = WA_CUSTOMER-REGION..
  I_PARTNERADDRESSES-TRANSPZONE  = WA_CUSTOMER-TRANSPZONE..
In the above code address number 0000201328 is address number for customer 0000241269. Now the sales order is getting created but ship to party address is not overwritten with the values passed above. Ship to party address is just defaulted from customer master.
What should i have to pass to the address number field.
Any piece of code which is working would be more helpful.
Thanks in advance
Rajesh.

I haven't tried for this, but from the documentation of FM I got this note:
<i>Notes
If the table is used to enter document addresses for a sales and distribution document, the address data is then not necessary in the document partner table BAPIPARNR / BAPIPARTNR ).</i>
So, I am not sure wheather it is possible or not.
Regards,
Naimesh Patel

Similar Messages

  • User Exit to change the Ship-to party address at Sales Order headder level

    Hi,
    I have requirement like this......
    I need to change the  ship-to party address at Sales Order headder level. for that which user exit i need to  use and which structure i need to use to update the transaction.
    I used : userexit_save_document_prepare, in that i passed data to 'xvbpa' and 'xvbadr' structures. even though it is not update the transaction.
    Please let me know the answer.
    Thanks,
    Satish.

    Hi Satish,
    Step1. Create new Data Copy Routine using Tcode VOFM.
    Step2. *-----------------------------------Ship to Party from contract
       IF CVBPA-PARVW = 'WE' OR
          CVBPA-PARVW = 'SH'.
        REFRESH IT_STP.
        SELECT KTOKD
               A~KUNNR
               NAME1
               NAME2
               A~ADRNR
               FROM VBPA AS A INNER JOIN KNA1 AS B ON A~KUNNR = B~KUNNR
               INTO CORRESPONDING FIELDS OF TABLE IT_STP
               WHERE VBELN = CVBPA-VBELN . 
    Step3.
       CALL FUNCTION 'POPUP_WITH_TABLE_DISPLAY'
            EXPORTING
              ENDPOS_COL   = 80
              ENDPOS_ROW   = 10
              STARTPOS_COL = 10
              STARTPOS_ROW = 5
              TITLETEXT    = 'Your Title'
            IMPORTING
              CHOISE       = T_SELIDX<=====Index No of selection
            TABLES
              VALUETAB     = IT_STP
            EXCEPTIONS
              BREAK_OFF    = 1
              OTHERS       = 2.
    Step4.
           READ TABLE IT_STP INTO WA_STP INDEX T_SELIDX.
            IF SY-SUBRC = 0.
              CLEAR:CVBPA-KUNNR, CVBPA-ADRNR.
              MOVE WA_STP-KUNNR TO CVBPA-KUNNR.
              MOVE WA_STP-ADRNR TO CVBPA-ADRNR. <========Address ID (Change Here).  
           ENDIF.
    Regards,
    Amrendra
    Moderator Message - Please do not reply to old, dormant threads.
    Message was edited by: Suhas Saha

  • Changing ship to party address in sales order

    Hi All,
    We have a scenario herein in sales order, the ship to party  address is copied from some other ship to party address. Put simply if the ship to party in sales order 1 is A, the address of A will be copied from ship to party B. The ship to party B is in sales order 2.  The ship to party in sales order 1 will remain A only but the address is copied from B ship to address
    i just need to know where this kind of development must have been done. i.e the include program, exit etc.
    i am trying to see exit  EXIT_SAPLV09A_001, but i could not see it in se38?
    regards
    sachin

    Hi,
    In first place why you want to have such a requirement. Why can't you have the correct address in the Ship to Party master record in the XD01 and assign correct ship to party at the sales order line item, so that correct address flows to the sales order line item.
    Eg:
    Sold to Party A
    Ship to Party A & Ship to Party B (Both are assigned in the Partner tab of Sold to Party A)
    Ship to Party A has Address A & Ship to Party B  has Address B (Ship to Party B was created with Account Group SHIP TO)
    On the sales order line item, change the ship to party to Ship to Party B
    So that you have correct address in the relevant line item.
    As per your requirement, you have to have a Z table to keep the logic between hip to Party & relevant address.
    If not, check below link for all User Exits in SD>
    https://wiki.sdn.sap.com/wiki/display/ERPLO/SDUserexits
    Find a correct one for your requirement.
    Best regards,
    Anupa

  • Ship to party address in sales order header

    Hi
    We changed the ship to party address at the header level and new address number got generated and updated the table VBPA.
    We need to revert the address so that the original address number of the ship to party should be updated in the table VBPA.
    Eg : Ship to party address number -  123
    During the creation of the sales order,  123 is updated in VBPA.
    We changed the address of the ship to party at header level and new addess number 963 got generated for the changed address and updated in the table VBPA.
    Now we need to revert the changes so that original address number 123 should get updated in VBPA.
    Please help us to resolve this issue.
    Thanks in Advance
    Shaju

    HI Shaju,
    This is not SAP standard, but a trick we learned and we have used successfully.
    Go to the change mode of sales order. Delete the ship-to and press enter. It will give you a warning, still press enter. If its very compulsory then put some other ship to party and then press enter. DO NOT save the sales order.
    There will be a lot of re-determinations, let them happen.BUT DO NOT save the sales order. Once all the re-detereminations happen. Delete the new ship-to and put in the old one. ANd you will have the old shipt-to with the oroiginal address and address number.
    Now save the sales order.
    The logic is when you put in the new ship-to then it re-determines everything including the address number. And then when you put in the old one, it will do one more round of re-determination and will copy the address number from customer master. Thus you get the original address.
    Hope this helps,
    Abhishek

  • Need information of Table containing Ship-to-party Partner at Sales Order

    Hello SAP folks,
    There is a scenario where we need to change the shipping address detail of a partner funtion "Ship-to-party" at Sales Order level. so I just wanted to know which tables stores all the data related to Address of Ship-to-party after the Sales Order is created.
    Suggestions are eagerly awaited in this topic !!
    Regards,
    Sarthak

    Hi sarthak
    As soon as you change the address for any partner in sales order, the changes are recorded in table ADRC. ( Normal address table for business partners)
    Select table VBPA and for the document number (VBLEN) and item number (POSNR) get the address number ( ADRNR) for the ship to party (WE)
    Now in the table ADRC with this ADRNR you can find the changed address for ship to party for the order.
    regards
    makarand

  • How to find ship-to party of a sales order

    Hi,
    I want to display the sold-to party and ship-to party of a sales order, I know the sold-to party is in table vbak, but where can I find the ship-to party? In which table?
    Thank you!
    William

    Hi Zhiyuan,
      Table LIKP : Delivery Header Data.
    With luck,
    Pritam.

  • Want to get a popup when sales order is created or saved

    hi all ,
             I want to get a popup when sales order is created or saved .Is there any  user exit for the same?
    thanks in advance ,
    Naval bhatt

    Hi,
    try this.
    Go to the include MV45AFZZ of Sales Order Main program SAPMV45A
    and find the correct exit in that and write the User exit code after saving the document FORM USEREXIT_SAVE_DOCUMENT_PREPARE or
    FORM USEREXIT_SAVE_DOCUMENT by calling/writing the
    fun module POP_UP_TO_CONFIRM.
    Regards,
    Anji
    Message was edited by:
            Anji Reddy Vangala

  • When sales order is created ,costing of a material cann't be created automa

    dear suppporter:
      when sales order is created ,costing of a material cann't be created automatically.if i cost the material in va02 ,the cost can be generated.please help me analyse it .
    best regards.

    There is Tick in Delivery block 01 Deliveries: Blocking Reasons/Criteria
    I have observed in testing Before you save a sales order, you look at the schedule line overview, you can see what the system would Proposed confirm date and confirmed qty, if the block were  not set. However, as soon as you save the sales order,(warring message Oldest open items over due will appear) the confirmed quantities are automatically reset to zero because sales order is Blocked. Here the goods remain available for other customers.
    Note : When you release the sales order the automatically in sales order confirmed qty and proposed date will come.
    Here the problem is  when they do MRP run after sales order saved with block Planned order is creating.

  • Trigger custom idoc through ALV when sales order is created in VA01 & VA02

    Dear Experts,
    I am new to the concept of ALV_idoc. Please give me the procedure in detail.
    How to send custom fields to non SAP system when sales order is created or modified in VA01 &VA02?
    Can i use existing Logical Systems and Ports and partner profiles?
    Thanks & Regards
    Moderator message: please search for available information/documentation.
    Edited by: Thomas Zloch on Jan 17, 2012

    hi,
    the first option is the right one. the FM invoked makes a direct input, so all the functionalities in S.O. are the standard one in the same way as if you are making it manually.
    Also you can have some exits in the Idoc FM, so you can manipulate data there before loading the sales order.
    pls. reward if helpful
    regards
    Roberto

  • Ship to party name  in Sales Order

    Hello all. I created a sales order. I saw the technical information of a Ship-party in a sales order. It is a structure KUAGV. Field is TXTPA. I want to know  the real database table this information came from. Your help will be appreciated.
    Shirish

    Kumar,
    That is "Display text for partners (name, city, country, street)".
    The data comes from the address table ADRC and Customer master table KNA1.
    The key between these two tables is ADRC-ADDRNUMBER  and KNA1-ADRNR.
    Hope this helps you.
    Regards,
    Ajai.

  • Block For billing when sales order is created

    Hi experts,
                   I have a requirement in which i want to block the sales documrnt for billing when the sales order is created with particular discount value.
    for this i have checked the condition of discount first it works fine no i want to block it for billing.
    My SD consultant told open the sales doc in change mode(VA02) and then go to Billing Block field (FAKSK)  and then give 02 Compl confirm missing and save the doc
    So for this i have writen a method.
    SET Parameter ID 'VBELN' Field OBJECT-KEY.
    Call Transaction 'VA02' and SKIP FIRST SCREEN.
    SET Parameter ID 'FAKSK' Field '02'.
    in this it is calling the VA02 screen but i am not able to pass the billing block value and save.
    Please give me a solution how to do this.
    for blocking i have also used the standard method in BUS2032  SetDefaultBillingBlock
    it is not blocking the billing.
    Or should i use some bapi for this.
    Regards,
    Hari

    Hi Hari,
    SET parameter ID only sets the value to an input field. It wont saves to the database. More over i don't find any parameter ID for billing block in VA02.(May be because it is a drop down).
    Use BAPI BAPI_SALESORDER_CHANGE Pass the sales order number, ORDER_HEADER_IN-BILL_BLOCK = ur blocking code, ORDER_HEADER_INX-BILL_BLOCK = X.
    After calling the BAPI call BAPI_TRANSACTION_COMMIT.
    Above procedure is to programativally.
    If u want to do it manually then directly open VA02 and change the billing block and save.
    I dont think we can set parameter ID for billing block
    Thanks,
    Vinod.

  • How to limit entry of Ship to party in a sales order

    Dear Gurus,
    My current project requires the following Scenario:
    My  client's requirement is that for <b>a single sold to party</b>, there need to be <b>more number of ship to parties</b>.   We were able to achieve the same by <b>assigning </b> the list of all the <b>respective ship to parties in the sold to party, customer master.</b>
    Now the client's requirement is that, the <b>system should not</b> let the user to enter a <b><b>ship to party</b> apart from the list maintained in Sold to part</b>y.  But when we are creating the sales order, the system is letting us enter, <b>a ship to party apart from</b> what is maintained in sold to party..
    Looking forward for your inputs at the earliest.
    regards
    Sridhar.P

    hi,
    In SPRO Determine Partner determination Procedure for sales Order, jut check for ship to party partner function : what value has been maintain in the field Origin
    leave the field blank or maintain c.
    other wise you can make use of custome r defined user exits.
    PARTNER_CUSTOMIZING_40C_XPRA
    this might be useful to you in solving the problem.
    thanks
    deepak

  • Ship To Party issue in Sale Order

    Hi,
    when i trying to choose another ship to party on header of a sales quotation . system is giving me error
    "Top node 0011000560 for ship-to 0011000845 not maintained or ship-to is not valid"
    I have maintained the 2nd code as ship to party in customer master of the 1st.
    Please advice.
    Ankur
    Edited by: Lakshmipathi on Jun 3, 2011 12:07 PM
    Please use the subject effectively

    Dear Ankur,
                  I hope you created a new ship to party in new account group,now what you have to do is assain this ship to party no to your customer (sold to party) change mode,sales area tab there in partner functions there menction one more SH and give the ship to party no and save the customer master.Then while you crating the quatation or sale order once you enter the sold to party system will show the pop up to select the ship to party then select the related ship to party.
    Thanks and Regardds
    Vinayk

  • AFS ship-to party problem in sale order

    Hi!
    We use AFS solution.
    I use customer "0000087655" as sold-to party in sale order and try to set customer "0001000016" as ship-to party but get message
    "Top node 0000087655 for ship-to 0001000016 not maintained or ship-to is not valid
    Message no. 8W321"
    How to Solve this error?
    Thanks and Regards
    Sureshkumar

    Ensure that the ship to party 0001000016 is created with correct account group.  Else change it via XD07.
    thanks
    G. Lakshmipathi

  • MULTIPAL SHIP TO PARTY  IN ONE SALES ORDER

    HI GURU
                    I WANT TO KNOW ANY POSSIBALTY IN A ONE SALES ORDER WITH MULTIPAL SHIP TO PARTY AT HEADRE LEVEL NOT AT IEAM LEVEL . I WANT TO AT HEADER LEVEL IF YES THN PLZ HELP ME OUT
    THANKS & REGARDS
    VISHAL

    Hi,
    I don't think so.
    Though you have it, what's the purpose of having it?? Because your dleivery is created based on your sales order line item. So Ship to Party in the line item will used for the delivery.
    But you can have different ship to parties in each line item.
    By the way why you want to have such a function in the sales order header?.
    Best regards,
    Anupa

Maybe you are looking for

  • Missing WS_HEADER protocol in client proxy

    Hi! I generated a client proxy to consume services from 3rd party application, wanted to use standard SAP WS security with user and timestamp, logical port with security profile didn't work, used proxy's header protocol to create my own security head

  • Distinct count of values which are displayed in two columns in SSAS

    Hi, How is it possible to get distinct count of two columns in fact table, meaning how many different appearances are in both columns. Please note I DO NOT mean distinct count on the concatenated fields. I'll demonstrate with example: Fact table- dea

  • Submit and gat data

    Hi there, I want so make a submit in a program that is a report write, so, I want to get this data from the spool or the memory, but I don't know how to do it. Thanks!!! Alexandre Nogueira.

  • Where is the "Network Utilities" app on my Macbook?

    OSX 10.9.4 -- The only way I can find the Network Utilities app is by using Spotlight search. I don't see it in the Applications folder in Finder, nor in the Launcher. Could you tell me where it is, please?

  • Companycode 9650 is not setup for materials management

    Hi all, i am loading  data from r/3 to CO cube 0copc_c10 from a custom defined datasource.I am getting error as "Companycode 9650 is not setup for materials management". i have checked in rsa/3.there also its throwing same error while displaying (but