To Retrieve the sold to party ,ship to party data

I have to retrieve the sold to party ,ship to party and payer along with there description i.e. name from a billing doc number and populate in the corresponding fields of the final internal table.
Can somebody me with a sample code.
Regards
Jitendra

hi,
bill to party....
SELECT SINGLE kunnr FROM vbpa
                    INTO v_scustno
                    WHERE vbeln = is_bil_invoice-hd_gen-bil_number
                    AND parvw = 'RE'.
IF sy-subrc <> 0.
  CLEAR v_scustno.
ENDIF.
CLEAR gs_hd_adr.
get customer adress number
READ TABLE is_bil_invoice-hd_adr INTO gs_hd_adr
WITH KEY bil_number = is_bil_invoice-hd_gen-bil_number
partn_role = 'RE'.
adrnr = gs_hd_adr-addr_no.
ship to party address
CLEAR GS_HD_ADR.
get customer adress number
READ TABLE IS_BIL_INVOICE-HD_ADR INTO GS_HD_ADR
WITH KEY BIL_NUMBER = IS_BIL_INVOICE-HD_GEN-BIL_NUMBER
PARTN_ROLE = 'WE'.
ADRNR = GS_HD_ADR-ADDR_NO.
CLEAR GS_HD_ADR.
READ TABLE IS_BIL_INVOICE-HD_ADR INTO GS_HD_ADR
WITH KEY BIL_NUMBER = IS_BIL_INVOICE-HD_GEN-BIL_NUMBER
PARTN_ROLE = 'RE'.
IF  GS_HD_ADR-ADDR_NO EQ ADRNR.
CLEAR ADRNR.
ENDIF.
*Getting customer number
*for Ship to party
break njain.
CLEAR v_custno.
SELECT SINGLE kunnr FROM vbpa
                    INTO v_custno
                    WHERE vbeln = is_bil_invoice-hd_gen-bil_number
                    AND parvw = c_we.
IF sy-subrc <> 0.
  CLEAR v_custno.
ENDIF.
**End of HDT XXXX-XXX
Thanks
Ashu

Similar Messages

  • 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.

  • Sales order: price condition not working when i change the sold to party

    Hi guys,
    I've a strange problem by making the following steps:
    1. Create a sales order:
         By VA01 i create an order by filling the SOLD TO and one material - all OK. The price is calculated correctly.
    2. Change SOLD TO:
        I change the sold to by filling another payer that has a different price list (PLTYP) - the price is not re-calculated
    If i change with another payer with the same price list everything is ok.
    Can you tell me what could be the problem?
    Many thanks

    Did you actually change the sold-to party though or just the payer?  The sold-to party's price list type controls the price list type value copied into the order header.  Even if the payer has a different value, it's not copied to the order header.  You can see this behavior in FV45KFKD_VBKD_FUELLEN.  If you switch sold-to's then you should get a pop-up that new pricing was carried out; you should also see your new price list type value in the order header and you can use the 'analysis' function at the item level to verify that the correct price was used.

  • Reversing the billing an change the sold to party...

    Hello Experts...
    We have a complete Sales Order submitted which has a mile stone based billing. The sold to party (A) has paid 4 installments out of 10 installments. He now wants to take back his 4 payments and change the Sold to Party to B. The new Sold to party (B) will pay the 4 installments and continue with the payment of balance installements. There is no change in the materials sold and pricing. The customer does not want to cancel the sales order and create a new sales order.
    This is a high priority issue. Kindly advice asap.
    Thanks and Regards

    Dear Patnaik,
    I think you can do like this, try with this......
    You do the reverse or cacel for the 4 instalments which sold to party A has paid.
    You need to reverse or cancel the all susequent documents of the sales order
    Make sales order status as open
    Now you can change sold to party to B in the sales order in VA02 transaction
    I hope it will help you
    Regards,
    Murali.
    Edited by: Murali Mohan.Tallapaneni on May 16, 2008 2:43 PM

  • Change the sold to party

    Hi expert,
                     Can i change " Sold to party code"  after the creation of the sales order.
    Regard
    Shashi

    Hi
    After the sales order say order no 10000 saved for sold to party as X you cannot change the sold to party in VA02 transaction as Y for order no 10000
    That means if the order is created and saved then you cannot change the Sold to party for that order
    But while processing it self before saving in VA01 transaction itself it is possible to change the SP
    after the creation of the sales order.
    Not possible
    You cannot touch SP in VA02 transaction irrespective of subsequent document is there or not and the
    img settings said under partner determination for sales document types  say TA for standard order there also i dont think you can change the standard settings as the SP is mandatory and not modifiable
    You cannot  remove the tick in non modifiable for  SP for TA the standard sales doc type partner determination and make it
    modifiable
    Regards
    Raja
    Edited by: ramanathan raja on Nov 1, 2009 12:33 PM

  • Sold to Party data transfer from Order to Notification

    Hi,
    According to our process, the person who reports a malfunction or requests service for customer can also generate the appropriate order. In Order Customizing, the indicator "Maintain Notification data on order header" is set, this enables system to immediately create a notification in the background when you create the order. Due to this, reference objects, dates, work center, etc are automatically copied from Order to Notifications as expected. However, Sold-to Party / Customer is not getting copied from Order to Notification.
    Following items have been configured:
    - Both order & notification have the same partner procedure
    - No user-exit is active
    - We do not copy the partner from the reference object(e.g. equipment) to the service order. We plan to enter the customer number directly in the service order (as the equipment is not going to have a customer/partner number)
    - "Copy Partner Functions to Master and Movement Data" customizing is activated for our partner procedure
    Any suggestions, which will enable copying of customer / sold-to party data from Order to notification through configuration.
    Thanks in advance. Please let me know if you need any further details.
    Regards,
    Avinash

    [OSS Note 546738|https://websmp130.sap-ag.de/sap%28bD1lbiZjPTAwMQ==%29/bc/bsp/spn/sapnotes/index2.htm?numm=546738]
    http://www.sapfans.com/forums/viewtopic.php?f=7&t=323195&start=0&st=0&sk=t&sd=a
    Please check the above links. Also make that partner function as mandatory for that notification type & then try.

  • Block the sold to party

    Hi Gurus
    I had one senario with me wants to block the cust for billing with help of ship to party
    Regards
    shridhar

    Hi;
    You can do this with VD05.
    Regards;
    Avinash

  • BAPI to retrieve ship to party for a given sold to party

    Hi All,
    I have a requirement to get the ship to party details for a sold to party. The scenario is that we are using an excel sheet for order loading at the client's place.
    The CSR enters the sold to party in the excel sheet and there is a funcationality developed which will call RFC and connect to SAP. Now for the sold to party entered in the excel sheet, I need to have all the ship to party details for the sold to party entered. Now I need to know if there is a standard BAPI to retrieve all the ship to party.
    Kindly let me know if anybody is aware of the standard BAPI for the above requirement.

    Hi,
    I am not sure of any BAPI here.But I will give you the ogic to retrieve all Ship-to-parties for your customer.
    Goto T.Code SE11/SE16/SE16n T.Code.
    Enter the table name as KNVP.
    Enter your sold-to-party here for customer field.Execute or press F8.
    Retrieve all the partners and get the ship-to-parties having the partner function "WE".
    If you click on display by selecting that line all details will appaear here.
    Hope this helps you.
    Regards,
    Krishna.

  • Sold to party and Ship to party are the same but has different address

    Hi,
    I have problem here wherein Sales order has the same sold to party and ship to party but they have different address. When the customer master data is changed the sold to party in the sales order is also updated but the ship to party is not updated.
    I've checked the table VBPA and I noticed that the value of ship to party VBPA-ADRDA is 'E' (manually enetered).
    Is this the reason why the address of ship to party in sales order is not updated whenever the customer master is change?
    Another question, how does ship to party entered in sales order manually?
    Thanks in advance.

    Hi,
    Please correct me if I have understood the scenario incorrectly which I try to explain below:
    Sales order is created where SP and SH both have same address initially and while creating the SO, address of the SH was changed manually by Header>partners>SH
    Now master data for that customer is changed for address. As per the standard functionality of SAP, all sales order created for that customer will have new address for SP only.
    If address of SH needs to be changed in SO, it has to be done manually by the same way as explained in the above mails.
    As far as manually entering the SH in SO is concerned, system will automatcally selects the SH if only one record is available for SH. If you have specified more than one SH, system will give you an option to select one by displaying a pop up.
    Please let me know if you find this explanation suitable.
    Ravi

  • Hi , i want to find the names of ship to party , sold to party based likp

    Hi ,
    Could you plz help me .
    how to find the names of the ship to party , sold to party depending on the
    sold to party (likp-kunnr) and ship to party(likp-kuang).
    Thanks
    Suresh.

    Sold-to-party
    Take ur likp-kunnr ,do compare compare with kna1-kunnr,take adrnr number from kna1,use adrc table..
    so adrc table field is name1
    Ship-to-party :
    take LIKP-kunag,do compare with kna1-kunnr,get adrnr field from kna1,do compare with ADRC Table with adrnr,
    so you can use ADRC-NAME1 field
    Thanks
    Seshu

  • Enter Valid Ship-to-party/Sold-to-Party-

    Using T.code:J1ILIC01(Deemed Export License), I entered data for Series Group,License Type,License Name,Creation Date,Expiry Date
    and Pressed Enter.
    I get the error'Enter Valid Ship-to-party/Sold-to-Party'.
    I have entered a Valid Ship-to-party/Sold-to-Party and yet the error is present.
    How to overcome the error?Please advise.
    R.Rao

    Pls check the sold to party or ship to party are extended to the concerned sales area for which you are triggering the transaction.
    Reward point if it helps.

  • Sold to party adress copy to ship to party

    HI,
    when customers place an order on the internet they get a choice to deliver to a different delivery address.
    When customers choose this option and type in a different address it does not ask them to enter in a tel number.
    Would it be possible in sap to copy the main tel number entered on the internet  into the ship to party tel number on all occasions?
    Internet orders have shipping condition E1
    Example delivery 807924096 which is an internet order, the sold to party tel number is 07923622906 the ship to party has a different address and no tel number, could the sold to party tel number be copied to ship to party tel number?how
    reagrds,
    Debesh

    Hi,
    You cannot do this directly. But using the user exits you can enable it.
    You can also save the telephone number provided by the user in some Z table and then take the values from the Z table and then enter them in the telephone number of the ship to party. May be this can also be scheduled as a job and can run twice a day, by which you can actually optimise the system performance.

  • Sold to party, Ship to party in VA05 report

    Dear Experts,
    I have one requirement in which I am supposed to display Ship to party and Ship to address fields along with sold to party field in VA05.
    1. Document Date
    2.Delivery Date
    3.GI Date
    4.PO Number
    5.Name
    6.Sales Doc Type
    7.Sales Document
    8.Created By
    9.Sold-to-party
    10.Name 1
    11.City
    12.Region
    13.Material
    14.Description
    15.Sales Unit
    16.Order Qty
    17.Confirm Qty
    18.Shipping Point
    19.Status
    20.Net Value
    21 Ship-to-party
    22 Ship-to-address
    Now the problem is I am not able to find appropriate user exit for the above requirement since Ship to party and Ship to address fields are not available in VBAP or VBAK tables and the existing user exits are
      PERFORM move_userfields USING 'VBAP'.
      PERFORM move_userfields USING 'VBAK'.
    Thanks in advance!!!
    Vishal
    Vishal

    Hi,
    For the sold to party and ship to party, get the values from VBPA-ADRNR where VBPA-KUNNR = VBAK-KUNNR and VBPA-PARVW = SP (Sold to party)
    For ship to party get VBPA-ADRNR  where VBPA-VBELN = VBAK-VBELN, VBPA-PARVW = SH.
    Once VBPA-ADRNR is known for sold to and ship to , pass them in ADRC-ADDRNUMBER and then get ADRC-NAME1, ADRC-NAME2, ADRC-CITY, ADRC-REGIO etc for printing the address details.
    Hope this helps

  • Sold to Party and Ship to party field are in grey out mode in VA01.

    Hi Friends,
    I am facing a very critical situation, Please help me on this.
    While creating the sales order by VA01, the Sold to Party and Ship to Party field are in grey out, so we cannot enter sold to party and ship to party. This is happening for all Order types.
    And while checking the existing sales order by VA02, so I found that at Header level and Item level the Partner tab are disable
    ( mena partner tab are in grey mode,).
    But when we click on sold to party field in VA02 it directly moves to partner but all Partner shown in Sales tab.
    I have check all the partner function and partner determination configuration.
    So can any one help me out in this, how in VA01 sold to party and ship to party field are in grey out mode.
    How in VA02 the partner tab are disable.?
    Thanks
    Irfan Ullah
    09370236510

    Hai Irfan Ullah,
    In Sales - customer
    1. Partners are listed (SP,BP,PY, SH)for account group and Partner Determination procedure(TA) is assigned to it
    Now for sales order type you need to assign the partner determination process
    SPRO
    Sales and Distribution
    Basic Functions
    Partner Determination
    Set Up Partner Determination
    Execute
    Set Up Partner Determination for Sales Document Header
    Select TA - standard order from the right side list
    and select Partner Determination Procedure Assignment (from left)
    Now assign your sales type to Partner determination TA.
    Create a SALES order you can find the sold to and ship to are editable.
    Regards,
    Mani

  • Sold to Party and Ship to party are in grey out mode in VA01.

    Hi Friends,
    I am facing a very critical situation, Please help me on this.
    While creating the sales order by VA01, the Sold to Party and Ship to Party field are in grey out, so we cannot enter sold to party and ship to party. This is happening for all Order types.
    And while checking the existing sales order by VA02, so I found that at Header level and Item level the Partner tab are disable
    ( mena partner tab are in grey mode,).
    But when we click on sold to party field in VA02 it directly moves to partner but all Partner shown in Sales tab.
    I have check all the partner function and partner determination configuration.
    So can any one help me out in this, how in VA01 sold to party and ship to party field are in grey out mode.
    How in VA02 the partner tab are disable.?
    Thanks
    Irfan Ullah
    09370236510
    Edited by: Lakshmipathi on Aug 4, 2011 4:30 PM
    Thread Locked - Reason Cross Posted

    Hai Irfan Ullah,
    In Sales - customer
    1. Partners are listed (SP,BP,PY, SH)for account group and Partner Determination procedure(TA) is assigned to it
    Now for sales order type you need to assign the partner determination process
    SPRO
    Sales and Distribution
    Basic Functions
    Partner Determination
    Set Up Partner Determination
    Execute
    Set Up Partner Determination for Sales Document Header
    Select TA - standard order from the right side list
    and select Partner Determination Procedure Assignment (from left)
    Now assign your sales type to Partner determination TA.
    Create a SALES order you can find the sold to and ship to are editable.
    Regards,
    Mani

Maybe you are looking for

  • Regarding Logical systems

    Hi all,           when i was trying to create new logical systems in trnsaction code BD54. It is said that you are not authorization to create logical systems. To get authorize what should i required? venkat

  • XML Output doesn't work

    Hi everyone, im a newer in using BI Publisher, so when I create the Data Model then save and click Get XML Output, it's not work( just blank window is appear, what's wrong with it?

  • Address code in PO

    Hello, In PO item level, in delivery address I can see address details are populated but where as address field is empty with no number in it.Could some one let m eknow from where the address number is copied?

  • Past meeting - Participants

    Hi All, We are using collaboration rooms and we have an issue in " Past meetings" page ( 'meeting minutes" iview). Here when we create or edit sessions we have to select participants. Now the issue is, in participants I can search and select only ind

  • PDF / SWF reader on portal

    Experts, I'm looking for a way to embed a PDF and / or SWF reader in the portal. I'm looking for the functionality like Adobe Flashpaper is offering. I want to show some newsmagazines in the portal with the possibility to navigate through the pages,