Changing the Ship-to partner details in Sales order header through exit

Hi all,
  I have a requirement where in during the process of the sales order creation, based on certain
  criteria, the details in the ship-to partner would have to be modified.
  These details like the Name, Street, etc would be maintained in a local table and based on the criteria,
  the appropriate record from this table would be fetched and updated to the ship-to partner.
  I was trying to implement this in the MV45AFZZ user exit. However, I was not able to update this through the exit.
  Would I have to somehow update the ADRC table directly through this exit or is there any better method.
  Please suggest.
Regards,
Sudeep

Hi,
If you could not find Street in this Routine call the BAPI BAPI_BUPA_ADDRESS_CHANGE to update Street and required details ..
Thanks and regards,
Sree.

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

  • Change the Sold to Party(SP) in sales order in change mode

    Hi,
    Is it possible to change the Sold to Party(SP) in sales order in change mode?
    If yes then How??
    Regards
    Somnath

    Hi somnath,
    It is very much possible to change the sold-to-party in the change mode of Sales order(VA02).
    Goto VA02-->enter the sale order number.
    Press enter.
    In the overview screen if you change the sold-to-party then every thing will be redetermined(Taxes and pricing procedure etc...).These will be determined from CMr etc.
    You cannot change the sold-to-party at the partners tab that is present in the Header details.
    It will be greyed out.
    If you change the sold-to-party at the overview screen as suggested earlier it will not apply to the item.
    You are also going to see this message while changing.
    And finally save the document.
    Regards,
    Krishna.

  • User Exit/Badi to change the billing plan date when create sale order

    Experts,
    Please advise which user exit/badi can be used to change the billing plan date wen create sale order.
    My requriement is based on some rules to dynamically change the line item billing plan start date and end date when create sales order.
    I tried some user eixt in MV45AFZZ, but the date got revert to the orginal date from billing plan.

    Hi,
      check the include MV45AFZB.
    Thanks & Regards,
    Sateesh.

  • 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

  • How to include a new Z Partner Function in Sales order header drop down lis

    Hello SAP experts,
    We have come up with a new requirement to include a custom Partner Function-ZI  in dropdown of SO header-Partners field.
    Current scenario- Presently we are maintaining this partner function  ( Say ZI-  Institute ) in customer master data-Sales area tab.There could be more than one partners under this PF in master data. While entering sales Order, all partners associated are displayed in Header- partners tab, where only SP, SH, BP, PY partner functions are displayed.
    Requirement- 1. Is to  provide Drop down of this ZI-Institute partner function (which I did not find presently) in SO header-partners field and user should be able to provide one of partner function as available in Customer master ( as there are more than one partners that can be set in Customer master data but user need to be able to provide ONE of this ZI partner fucntion in DROPDOWN of PF tab in SO header ).
    2. In addition, How can I link this new partner function in related sales reports against that particulat order and invoice?
    Kindly suggest your valuable inputs as what should be the procedure to get this.
    Many thanks in advance.

    Hi,
    Go to partner determination by VOPA
    OR
    IMG >> SD >> Basic function >> Set up partner functions >> set up partner function for sales document header
    click on partner function and Maintain partner function ZI  and back
    Then select your existing partner determination procedure (Standard is TA) and click on PARTNER FUNCTIONS IN PROCEDURE and add partner function. and make it mandatory so even user forget to mention then at the time of saving system can remind user 
    Then double click on PARTNER DETERMINATION PROCEDURE ASSIGNMENT
    Assign partner procedure to sales document
    Now when you creating sales order go to header partner tab and enter you institute partner number
    For sales order and invoice report
    Execute this report by selecting partner function ZI in VA05N and VF05 respectively
    kapil

  • What's the name of FM for getting Sales Order Header / Item Status info

    Hello All:
    Do you know what's the name of Function Module for getting Sales Order Header / Item Status Overview ? Any sample code will be very much appreciated.
    Basically, I am trying to create a Webpage where user can enter the Sales Order document number and will return the Sales Order: Status Overview.
    Thanks,
    Dipankar Biswas

    Thanks everybody ! Appreciate for your prompt response. I was also looking for some sample code, and I did find some on. And here is one. I still have to try the code, but here is for all your reference:
    *& Report ZBAPI_SALESORDER_GETSTATUS *
    *& Read and Display the Sales Order Items and Status of the Order *
    REPORT zbapi_salesorder_getstatus NO STANDARD PAGE HEADING LINE-SIZE 200 LINE-COUNT 33(3).
    TABLES: vbap. "Sales Document Item Data.
    DATA: wa_bapireturn TYPE bapireturn,
    wa_bapisdstat TYPE bapisdstat,
    it_bapisdstat LIKE STANDARD TABLE OF wa_bapisdstat.
    TYPES: BEGIN OF ty_mat_name,
    matnr TYPE makt-matnr,
    maktx TYPE makt-maktx,
    END OF ty_mat_name.
    DATA: wa_mat_name TYPE ty_mat_name,
    it_mat_name LIKE TABLE OF wa_mat_name WITH KEY matnr .
    PARAMETERS: p_vbeln LIKE vbap-vbeln DEFAULT 5573.
    START-OF-SELECTION.
    SELECT matnr maktx FROM makt INTO TABLE it_mat_name.
    CALL FUNCTION 'BAPI_SALESORDER_GETSTATUS'
    EXPORTING
    salesdocument = p_vbeln
    IMPORTING
    return = wa_bapireturn
    TABLES
    statusinfo = it_bapisdstat.
    IF wa_bapireturn IS INITIAL. " Successful Execution.
    WRITE: / 'Document No: ' COLOR 1, 20 'PO Number : ', 40 'Status' , 50 'Delv.Stat',60 'Item No', 80 'Material', 90 'Material Description', 130 'Net Price' COLOR 2.
    ULINE.
    LOOP AT it_bapisdstat INTO wa_bapisdstat.
    WRITE: / wa_bapisdstat-doc_number. " Sales Document Number.
    READ TABLE it_mat_name INTO wa_mat_name WITH KEY matnr = wa_bapisdstat-material.
    WRITE: /20 wa_bapisdstat-purch_no, " Customer Purchase Order Number
    40 wa_bapisdstat-prc_stat_h, " Processing Status
    50 wa_bapisdstat-dlv_stat_h, " Delivery Status
    60 wa_bapisdstat-itm_number, " Item Number
    80 wa_bapisdstat-material, " Material
    90 wa_mat_name-maktx, " Material Description
    130(10) wa_bapisdstat-net_price. " Net Price
    CLEAR wa_bapisdstat.
    ENDLOOP.
    REFRESH it_bapisdstat[].
    ELSE.
    WRITE: wa_bapireturn-message.
    ENDIF.

  • Reading the block message or text from sales order header.

    Dear All,
    Please let me know how to read the block text which is present in the sales order header under texts tab.
    thanks in advance
    regards,
    Shoban

    HI
    Please look intothe follwoing code, which helps you to understand how to read the header slaetext.
      DATA: BEGIN OF text_head.
              INCLUDE STRUCTURE thead.
      DATA: END OF text_head.
    DATA: BEGIN OF TEXT_LINES1 OCCURS 10.
          INCLUDE STRUCTURE TLINE.
    DATA: END OF TEXT_LINES1 .
    DATA: text_id     LIKE thead-tdid     VALUE '0001'.
      DATA: text_spras  LIKE thead-tdspras   VALUE 'EN'.
      DATA: text_name   LIKE thead-tdname.
      DATA: text_object LIKE thead-tdobject VALUE 'VBBK'.
    CALL FUNCTION 'READ_TEXT'
          EXPORTING
            client                  = sy-mandt
            id                       = text_head-tdid
            language                = text_head-tdspras
            name                    = text_head-tdname
            object                  = text_head-tdobject
          TABLES
            lines                   = text_lines1
          EXCEPTIONS
            id                      = 1
            language                = 2
            name                    = 3
            object                  = 5
            reference_check         = 6
            wrong_access_to_archive = 7
            OTHERS                  = 8.
        CASE sy-subrc.
          WHEN 1. RAISE invalid_id.
          WHEN 2. RAISE invalid_language.
          WHEN 3. RAISE invalid_name.
           WHEN 4. RAISE NOT_FOUND.
        ENDCASE.

  • How to change the sequence that VL10 use for sales order during DN creation

    We are using VL10 for DN creation , VL10 is executed in  background as a batch job ..... we have created a variant and have given range of shipping points for which we want to create  the Deliveries.
    What we want to understand is that how SAP standard code for VL10,  sorts the sales orders for which the delivery are to be created using VL10?
    we would like VL10 to process the sales order which belong to same shipping point in some order....so that delivery needs to be created for the first sales order rather than last sales order for a given shipping point....
    Is there any sort order that SAP follows to pick which order it will consider for delivery creation ....first over the other sales order where the shipping happens to be same ?  if yes then is there any way we can change it  ?
    Any guidance is appreciated
    Thanks
    Rajey

    We are facing the same problem and are running at 4.7.
    There are orders with the same goods issue date and if so, it should be sorted by order no.
    Nevertheless, it does not sort it by order no but we could not find yet what the sort criteria is if it runs in the background and how to change these rules.

  • FM for updating Partner details in Sales order

    Hi,
    Pleaes let me know the FM to update partner functions in sales documents. FM is expected to only update partners and shouldnu2019t update pricing or incompletion or anything else. thanks

    Look at function group V09A - Partner processing SD. Also investigate module SD_PARTNER_UPDATE.

  • How to change the status of material while creating sales order via BDC

    Hai.
    In BDC while creating sales order( va01 posting ) it is stucking up in middle saying material is new. I.e Sales order (va01) is not  getting created because  of material status is new . I want to create sales order  (va01) even  material status is new.
    pls give me out the solution. Points will be rewarded.
    thanks & regards,
    sami.

    Hi,
    If you drag the line item a little towards the right side, you will find a filed material entered. The one you see in the material filed on sales order over view screen is the one determined. You can as well double click and see the fields material entered and material determined.
    Is there anything else you are expecting to see as part of analysis ?
    Regards
    Sadhu Kishore

  • Partner Roles In Sales Order Header

    Hi Experts,
    I am developing a Module Pool Program for Following reason.
    People having not authoruzation to VA02 can change  certain fields / Parameters in Partners and Additional Data B tab .
    my developments should work similar to standard transaction ( VA02 ) .
    Please help me to do the followings :
    I have all Partner Information.  I want to know how to make this work like Standard Transaction ( VA02) . There Certain Partners Functions and Partners are Disabled / Enabled.
    for ex Sold to party  and Partners are disabled
            Ship to party is disabled and its partners are enabled like that..
    I tried using  table TPAER with  PAPFL and AENDB still its not working . And also tell me how to switch contents when we change Display Ranges in Partners.
    Is there any Function Module from where we can get this information ? Please help me to solve this problem.
    Thanks,
    Shrikanth

    http://abap.wikiprog.com/wiki/BAPI_SALESORDER_CHANGE

  • Partner at sales order header

    I have a requirement where a partner function is needed at sales order header level where sales order handler can assign any value. the partner function should allow any free value to be entered without any need to actually define a master record for the value to be entered in the partner function at sales order header level.
    Please guide how can a new partner function be defined with this facility.  Thanks !

    Hi
    Goto SPRO>SD>Basic functions>Partner determination>sales docuemnt header.
    Define a new partner function.
    Assign it to your partner determination procedure.
    Don't make it as mandatory.
    Assign that partner procedure to your sales order type.
    now test it.
    try and revert

  • Requied code in abap to display sales order header text

    hi all,
    can anybody help me to send the code in abap to display sales order header text.

    Use FM, Read_text. Pass the necessary parameters like object name, id, language. You can see some of the infos in by clicking the scroll-like button.
    Reward points if useful

  • 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

Maybe you are looking for