Delivery address updating based on Plant in ME21N

Dear All,
My requirement: I have a plant consider 0900, we have updated the plant address in MEAN Tcode.
I can see an entry in ADRC table, but while creating the PO in ME21N by giving the plant as 0900, system is fetching
the old address, not the new address.
Please suggest me the solution and if any code.
Thanks in Advance
Sandeep.

Hi Felipe,
I have done the coding like this, please let me know if i am wrong.
  DATA: ls_mepoitem    TYPE mepoitem,
        ls_mepoitemx   TYPE mepoitemx,
        ls_mepoheader  TYPE REF TO if_purchase_order_mm,
        ls_mepoheader2 TYPE mepoheader,
        header         TYPE ekko,
        lv_adrnr       TYPE adrnr,
        ls_ekpo        TYPE ekpo,
        ls_adrc        TYPE adrc,
        ls_cmmda       TYPE cmmda.
  ls_mepoheader  =  im_item->get_header( ).
  ls_mepoheader2 =  ls_mepoheader->get_data( ).
  ls_mepoitem    =  im_item->get_data( ).
  IF ls_mepoitem-adrn2 IS INITIAL AND
     ls_mepoitem-lgort IS NOT INITIAL AND
     ls_mepoitem-werks = '0900'.
    SELECT SINGLE *
     FROM ekpo
     INTO ls_ekpo
      WHERE werks = ls_mepoitem-werks
*      AND ekgrp = ls_mepoheader2-ekgrp
      AND wepos = ls_mepoitem-wepos.
*      and adrn2 = ls_mepoitem-adrn2.
    ls_ekpo-adrn2 = '00091647'.
    IF sy-subrc = 0.
      ls_mepoitem-adrn2 = ls_ekpo-adrn2.
      CALL METHOD im_item->set_data
        EXPORTING
          im_data = ls_mepoitem.
    ENDIF.

Similar Messages

  • Default Delivery Address in PO at plant level,vemdor level or material leve

    Hi
    Suppose my Plant address is XXXXX .
    For each PO created for that plant I want to  delivery address as YYYY comes as default ( No selection under item delivery address tab)
    or Same for particular material. or particular material.
    How to achieve this.
    Edited by: Sanjay  Shah on Jan 15, 2010 5:58 PM

    Dear Jurgen,
    If there are more than 1 adreess at the storage location customizing, when the PO is created the 1st one is copied at the delivery address of the order.
    Is there a way to choose another one or an automatic way to determine the appropriate one (let's say if the Communication language of the PO is EN choose 2nd address or the 3rd).
    Thanks in advance.
    BR,
    Elly

  • Delivery address update on Purchase Req Exit MMDA0001

    Functionality : I'm creating the PR from Sales order. this is achieved through the item category configurations on Sales order.
    Requirement: During PR Creation, I need to change the delivery address on the PR from default plant address. Sap provided the User exit MMDA0001 Function Exit : EXIT_SAPLMMDA_001 for this purpose.
    Problem: I'm passing Address number on this exporting parameter of this Exit, But SAP is not populating this delivery address on the PR. I couldn't find any article on this issue. Below is my code
    Data Declarations
      DATA   : lv_partner TYPE char30,
                     lv_kunnr   TYPE kunnr.
      TYPES : tt_vbpavb TYPE STANDARD TABLE OF vbpavb.
      FIELD-SYMBOLS : <lt_xvbpa> TYPE tt_vbpavb,
                                   <ls_xvbpa> TYPE vbpavb.
      lv_partner =  '(SAPMV45A)XVBPA[]'.
      ASSIGN (lv_partner) TO <lt_xvbpa>.
      IF <lt_xvbpa> IS ASSIGNED.
        SORT <lt_xvbpa> BY parvw.
    Get the Ship-to-party information
        READ TABLE <lt_xvbpa> ASSIGNING <ls_xvbpa>
              WITH KEY parvw = 'WE' BINARY SEARCH.
        IF sy-subrc = 0.
    Assign the Ship-to-party address information to the PR Address
          lv_kunnr = <ls_xvbpa>-kunnr .
          SHIFT lv_kunnr LEFT DELETING LEADING '0'.
          SELECT SINGLE addrnumber FROM adrc INTO e_adrnr
              WHERE sort1 = <ls_xvbpa>-kunnr AND
                    addr_group = 'ME01'.
        ENDIF.
      ENDIF.
    Please help on this issue and suggest me if i need to raise any SAP service ticket on this issue.
    Thanks,
    Selvaraj

    Hi
    Are you able to get the address no from the query? Place a break point on this and check when the value of adrnr gets changed and analyze it.
    Regards
    Shiva

  • Delivery Address in Purchase order Create ME21N

    Hello all,
         I am trying to capture the value in the Country field on the Delivery Address tab when creating a PO (ME21N).  We only want to write a certain condition if the Vendor is non-US and the Delivery country is US. 
         The initial value is populated in KOMK but it doesn't change if the Delivery address is changed manually. 
    We are using subroutine KOBEV_600 in Include RV61A600.  I tried using GET PARAMETER ID 'LND' but it never worked.  It always came back blank. 
    Thanks for any help.
    Kind regards,
    Chris Mowl

    Thank you for the responses although they didn't quite address my issue. 
    The solution we are testing at the moment is using the following code in User Exit ZXM06U14:
    DATA: lv_country TYPE land1.
    IF i_ekpo-adrn2 IS NOT INITIAL.
      SELECT SINGLE country FROM adrc
      INTO lv_country
      WHERE addrnumber = i_ekpo-adrn2.
      IF sy-subrc = 0.
        EXPORT lv_country TO MEMORY ID 'adrn2'.
      ENDIF.
    ELSEIF i_ekpo-kunnr IS NOT INITIAL.
      SELECT SINGLE land1 FROM kna1
      INTO lv_country
      WHERE kunnr = i_ekpo-kunnr.
      IF sy-subrc = 0.
        EXPORT lv_country TO MEMORY ID 'adrn2'.
      ENDIF.
    ELSE.
      CLEAR lv_country.
      EXPORT lv_country TO MEMORY ID 'adrn2'.
    ENDIF.
    When an Address number or Customer number are filled in on the "Delivery Address" tab for the item, they are filled in the i_ekpo-adrn2 or i_ekpo-kunnr fields respectively.  I then export the country value to memory and import it in RV61A600 where we check that value.

  • How to get delivery address for PO

    I have a problem.
    I am working on a SAP Script , which is for PO(Zmedruck_po) , which is a copy of
    MEDRUCK.
    I am asked to print the delivery adress in a window .
    The scenario is like this .
    In ME23N , under item details , there is a tab called DELIVERY ADDRESS
    this has option to enter the adress details or a delivery number in the  address text box .
    If the address number is present i have to print that address , else i have to print the address which is entered in the delivery address tab.
    If the delivey address number is there i have no problem in printing it ,But if address number is not there ,I need to know how to get the delivery address,
    is it the plant address, company code address ... ?
    I debuged ,but could not find out.
    Can anyone help please .

    Hi,
    I don't know the table that is used to store the manual address on the PO but if you get your ABAPer to checkl the code in ME21N they should be able to tell you.
    Or better still, if one of the other experts here know the table that is used they will post the solution.
    Steve B

  • How to get the Delivery address for PO

    I have a problem.
    I am working on a SAP Script , which is for PO(Zmedruck_po) , which is a copy of
    MEDRUCK.
    I am asked to print the delivery adress in a window .
    The scenario is like this .
    In ME23N , under item details , there is a tab called DELIVERY ADDRESS
    this has option to enter the adress details or a delivery number in the  address text box .
    If the address number is present i have to print that address , else i have to print the address which is entered in the delivery address tab.
    If the delivey address number is there i have no problem in printing it ,But if address number is not there ,I need to know how to get the delivery address,
    is it the plant address, company code address ... ?
    I debuged ,but could not find out.
    Can anyone help please .

    Hi,
    try using the below method:
    Goto TWLAD table with storage location (EKPO-LGORT) as key to get address number (ADDRNUMBER).  then goto ADRC table to get the address of the delivery
    Regards
    Shiva

  • Return delivery address determination

    Folks,
    PO with items received from vendor. The same PO is used to return one of the items. By adding a new line and check the return item box, the return item is created. The return address however is still the original delivery address, i.e. the plant. Should the return address be re-determined? I would expect by setting the return flag, the vendor address is determined as that is the address where the item is sent to.

    Hi MdZ,
    I can't answer your question.
    I guess your PO is proper, so the 'Delivery address' tab should contain the address of your plant.
    I think that MVT 161 includes that this delivery is an outbound delivery and the destination is not your plant (I mean the direction is reverse).
    Maybe maintaining suitable settings you could create delivery for this item and refering to the PO the address (destination) will be automatically your vendor's address.
    I hope somebody of higher knowledge can give you an exact answer.
    BR
    Csaba

  • In SAP 4.6 - Purchase order delivery address - Change

    Hi All
    I have created a PO and in print preview i can see the delivery address as plant address, which is also in PO item details. Now the EKPO-Address number does not have any value.
    Once I have changed the delivery address in item details, the delivery address is blank in PO - print preview and also i can see a value in EKPO - Address number.
    This value is exists in ADRC, which has the changed address. But the changed address is not in PO print preview, the preview is without deliver address only.
    Please give some views about this. SAP version is 4.6
    Thanks in advance
    ARAS

    Delivery address follows the rule
    1. If Plant Address is maintained  in Customisation, system will pick Plant address as delivery address
    2. If Plant and Storage location address is maintained in customization and both plant and Sloc is maintinaed in P.O line item then Storage location address will pick.
    3. If you cahnge the derived Default address to your own address, system will take precedence over the above 2 and create a address record, where you can see at ADRC, ADR6 I believe.
    At  present when you are making blank manually in the delivery address system is behaving properly by not picking the address.
    Hope the above clarification will help you understanding , and you also simulate to get the result.

  • Sorting TO for group & delivery address

    Folks,
    I have the following scenario:
    I create 1 shipment with multiple deliveries for multiple delivery addresses. Based on this shipment I create a group (VL35_S) and based on the group I create 1 TO. HOw will the sorting on the TO take place? Will it take over the exact sort of the stages in the shipment? So based on the sequence of the deliveries in the shipment, it will create TO items?
    Beside above, the to location is the delivery number. Is it possible to have either the address as to location or have the address printed on the TO?
    Thanks.

    Hi,
       You can create a sort profile in the config. based on which the TO items will be sorted.
    Logistics Execution->Warehouse Management->Activities->Transfer Orders->Define Profile->Sort Profile for TO splitting.
    If that does not suffice the requirement then you can go ahead and sort TO items with in the User-Exit 'MWMTO012' Function Module 'EXIT_SAPLL03A_012'.
    Thanks
    Funky Tech.

  • STO - Delivery Address

    Hi Gurus
    My Interco STO --> Item Detail -->  Delivery Tab --> address is buying plant addres instead the shipping plant address.
    How to fix this.
    Regards
    RG

    Hi Vimal
    Agree with you as for the normal flow it is working fine.
    Now the issue is for the STO Return order.
    During the Return order (STO) process, since the reciving plant is still remains the same (Reciving plant), it popluates accordingly in the delivery addess.
    Since now the delivery address should be shipping plant address...? or can remains the same...
    regards
    RG

  • Delivery address in PO Creation through ME21N

    Hi All,
    I want to change the Delivery Address in ME21N. By default this delivery address is the Plant address which we enter at the line item level. Now my requirement is to default the delivery address to other address based on the vendor given at the header level.
    I had tried User exit, MMDA0001 but this is not triggering, then tried BADI ME_PROCESS_PO_CUST method PROCESS_ITEM , even this does not help.
    Can anybody please let me if you had requirement like this and how you solve this problem.
    Thanks n Regards
    Maruthi

    Hi Mr A
    Please tell me which user exit did you use to resolve this issue because I have to also do extra validations and changes to some PO Items when user creates PO with ME21N.
    Thanks

  • Plant and Delivery Address

    Hi Experts,
    From my understanding, the standard PO transaction (ME21N, ME22N) will auto populate the delivery address based on the plant you specify. Is there a configuration that I can set to remove this auto population?
    Thank You.

    no u can not remove that , as this address comes for plant addres, but if u want to change it u can create the address in MEAN transaction and put the number in ADDERSS so that u will get the desired Address
    hope this helps

  • Plant name missing in PO line item details (Delivery address tab)

    Hi
    We are facing issue with ECC PO migration to SRM SUS client due to missing line item delivery address field name. We have PI integration. Name exist in PO XML on ECC interface but not copied on to PO line delivery address details (ME23n)
    Impact:
    We have 3 way channel between SRM client --> ECC ---> to SRM SUS client.
    When we create PO in SRM it flows from SRM to ECC using Purchase order request_V1 sevice request. This part works PO get replicated successfully. But when this PO is pushed to SUS client we are facing error message : "Name details missing for the partner address" found from proxy debugging. Second part of PO migration from ECC to SUS is not working due to missing plant name details in ECC
    When I copy PO (with missing details) to new PO and manually enter the details, scenario works with out any issue.
    Please comment.
    Regards
    Prashanth K Saralaya

    Hi Prashant
      Did SRM--> ECC PO have address details updated properly. It seems the address did not get updated when the PO is coming from SRM to ECC and when you manually update it, it goes to SUS Perfectly.
    For Delivery address , Name field is mandatory and ECC PO has to have the Name updated in Delivery Address.....
    If ECC PO has Name field updated in delivery address tab, then check the XMLs between ECC and SUS whether XML has carried Name field to SUS or not
    Regards
    Virender Singh

  • Plant address version in PO's delivery address

    Hi All,
    I have defined 2 international versions for our plant address.
    Is it possible to propose the plant address verion as the PO's item delivery address depending on vendor's communication language automatically? That is, if vendor's language is 'English', PO's delivery address will be 'I' version address. Otherwise, another version address will be display.
    Thanks

    HI,
    Yes offcourse you can do that in the programming logic of the form.
    Say if the vendor is English then the address will be in english
    if the vendor is in china then the address will be in chinease.
    YES you can do that. tell the abaper about the requirement and he will help you out in designing the form according to your requirements.
    Thanks & Regards,
    Kiran

  • Plant address not changed in PO delivery address

    Hello, I have changed a plant address in DEV & moved to QAS.i can find all the changed data in QAS in OX10.but when i create a new po for the same plant, print preview & delivery address tab is picking old address. how to handle this? please guide me.
    Regards
    Bheema

    have changed a plant address in DEV & moved to QAS.i can find all the changed data in QAS in OX10.
    Where exactly did you change the address and check for the address?
    Often misunderstood, the address has to be maintained by clicking the envelope button in OX10

Maybe you are looking for

  • How can I share a project to iTunes?  I am  getting an "quit unexpectedly" message

    I have a pretty long (45 minutes) video/slide show with mostly pictures and a very few short video clips.  Every time I try to share this movie to itunes so I can publish it, I get a message that iMovie has quit unexpectedly.  Can anyone help?

  • Custom "Draggable" progress bar in Flash

    I have created a custom skin for a Flash video that I wish to use. I currently have a shape tween within an MC that acts as the progress bar for the Flash video. Is there code that will allow me to click and drag that shape tween and control the movi

  • A bug in the Music App in iOS 6.1

    I'm on an Iphone 5 running iOS 6.1. Is this happening only to me? I'm looking for a song by Janis Ian on the Music App, and as you can see in the capture, there aren't any songs by her in the library (after Janet Jackson is Jarcha)... but if I search

  • SQL Statement on JDBC Adapter

    Hi all, how can I see the SQL Statement which is made by the JDBC Adapter. I have createt the XML Structure, but I want to know how PI (7.11) transformed the XML to SQL. How can I trace the JDBC Adapter? Which configuration is neccessary? Where can I

  • Updating from 1.4.0 to 5.0

    Hi, I have been using version 1.4.0 that came with my Java book. I went to go get the latest Eclipse IDE and it said that it is compatible with versions of Java 1.4.1 and higher. I guess that it is not compatible with version 1.4.0. If I want to use