Sales Document Number from billing document

Dear all,
How can i get the corresponding sales document number form a billing document number?
I currently have data from VBRK and VBAK tables.
so is it possible to get the corresponding sales order number for that billing doc no?
Plz let me know.
Regards
Rahul.

Dear Rahul
If you want to see for a particular billing document the corresponding sale order reference, go to VF03, input the billing document and click on Document Flow
If you want to see sale order references for multiple billing documents, go to SE16, input table VBFA, paste the billing document references in [Follow on doc] and C in [Prec doc categ] and execute.
thanks
G. Lakshmipathi

Similar Messages

  • How to get Accounting document number from billing document number

    Hi,
    How to get Accounting document number from billing document number i.e. from VBAK- VBELN.
    Cheta Pant

    Hi,
    VBAK is the Sale Order header table, Billing document table is VBRK.
    Sales tables (VBAK,VBAP,VBRP,VBRK) do not store accounting document numbers.
    You do other way around. Just go to SE16 and enter the Billing document number in field Billing document VBELN in BSEG or BSID or BSAD table and execute, you will find the accounting document number.
    If you just want collect this information once then you can use table BSEG, but if you think to develope a report then use table BSID and BSAD.
    Regards,
    Chintan Joshi

  • How to retrive ship to number from bill to number

    Hi ,
    I have to retrive ship-to-number from bill-to-no,
    Could you plz give me the idea.
    Thanks & Regards
    Suresh.

    Simple logic would be
    Take the sales order number from VBRP based on billing document..
    select single * from vbrp into vbrp
                             where vbeln = your billing number.
    if sy-subrc eq 0.
    here sales order number is VBRP-AUBEL
    now get the data from VBPA Table
    select single * from VBPA into vbpa
                            where vbeln = vbrp-aubel
                             and parvw = 'SH' or  'WE' .
    if sy-subrc eq 0.
    vbpa-kunnr is Ship to number..
    endif.
    Thanks
    Seshu

  • How to get master sales order number from delivery number

    Hi All,
    I need logic for getting master sales order number from available Delivery number.
    Note: There can be many SO's in diffrent levels.
    Finally i need to pick up master sales order no.
    Thanks in advance.
    Thanks,
    Deep.

    Hi,
    I have a outbound delivery[VL03N] 'X' in my system .
    Then for getting sales order no i am writing below code:
      SELECT single vbelv vbeln
             from vbfa
             INTO (vbelv, vbeln)
             where vbeln   EQ p_vbeln AND
                   vbtyp_n EQ 'J'.
    Then vbelv i need to pick up master sales order no.
        SELECT vbelv vbeln
               from vbfa
               INTO TABLE i_so
               where vbeln   EQ l_vbelv AND
                     vbtyp_n EQ 'C'.
    If i write code as above it is giving four sales orders which one of them is master sales order no!
    Thanks,
    Deep.

  • Find Sales order number from IDOC number

    I have a bunch of SO idocs, in status 64. They are then posted and Sales orders are created.
    How can I programatically find the Sales order Number from the Sales Order idoc number once it is in status 53 (other than going to EDIDS and checking if status = '53' and grabbing the 'STAPA2' field there ).

    Look at table EDIDS for sales order idocs and you can see SO number in any of STAPA1/2/3/4 variable for specific message id and message number.

  • Populate sales order number in billing document's reference field

    Hi,
    I have a requirement to populate the sales order number in the billing document's reference field. Hence, I have tried to find a user exits but sadly, all the user exits which I found does not break into my break-point.
    Thus, may i know whether any other people has similar requirements? In addition, how do you solve this issue?
    Thanks!

    Solve this issue. Apprantly, I break to the wrong user id which resulted in difficulty in finding the user exits.

  • How to trace sales order number from delivery number, when batch is split

    Hi All,
    I have created a Sales Order and a Outbound Delivery against the sales order.
    While creating the Outbound delivery, I have split the qty in two batches.
    Now when I go in table LIPS, and search on the basis of the Delivery number, I get two rows, one for each batch. But here the sales order LIPS-VGBEL, and Sales order item no (LIPS-VGPOS) is updated only for the 1st batch line item, but is not updated for the second batch line item.
    Please help me so that on the basis of the delivery number, i will be able to find record from tables for sales order for both the line items (i.e. for each batch).
    Immediate help would be appreciated.
    Thanks in Advance.
    Ankush

    Hi,
    I have created delivery against sales order.
    While picking (during delivery PGI), I selected two batches to suffice the delivery qty. Please refer the example quoted below.
    Sales order (SO1) - Material (Mat1) - qty (15 ea)
    Delivery against sales order (Del1) - batch split: batch1 - 10 ea
                                                                         batch2 - 5 ea
    In table LIPS: when I enter delivery number as "Del1" and execute, I get 2 records:
       del no.     Item No.      Material   Qty       Batch no       Sales Order no     Sales Order Item no
    1. DEL1       10              Mat1        10 ea    batch1          SO1                    10
    2. DEL1       20              Mat1         5 ea     batch2         ______                 ____
    Thus in the 2nd record, the Sales order no.(LIPS-VGBEL) and sales order item no. (LIPS-VGPOS) does not get updated.
    I have to develop a report to display the Sales Order number and sales order line item number for each batch of the Delivery for the same item number. Please guide me to know how I can get the same.
    Hope this clarifies the issue faced.
    Regards,
    Ankush

  • Accounting document number from billing data

    hi
    i have billing document with multiple items. I need to find out the accounting document number corresponding to each of the billing document item. which tables i need to refer for this.give me the field names.
    thanks

    Hi,
    You can read the FI document with the function module AC_DOCUMENT_RECORD
      call function 'AC_DOCUMENT_RECORD'
        exporting
          i_awtyp      = 'VBRK'
          i_awref      = awref
          i_aworg      = aworg
          i_awsys      = awsys
          i_awtyp_incl = 'BKPF'
          i_valutyp    = '0'
          x_dialog     = ' '
        tables
          t_documents  = docs_fi
        exceptions
          no_reference = 1
          no_document  = 2
          others       = 3.
    where docs_fi is as the table ACC_DOC. Read the records where awtyp = 'BKPF' in itab docs_fi. Search AWREF, AWORG and AWSYS in equivalent fields in table VBRK.
    I hope this helps you
    Regards,
    Eduardo
    Edited by: Eduardo Hinojosa on Jun 14, 2010 3:35 PM

  • Derivation of Batch number from billing documents

    Hi,
    The system picks up the batch number for the billing document when I do simulation thru KE4ST but when I release the billing document, it ends up in error of not finding the batch number. The system has default derivation based on table VBAP and I have put additional derivation on table VBRP. Both are working fine when I siumulate and it is not happening and the system end up in error. Anybody having experience in solving this impassee, kindly share.
    Regards,
    Ashok Singh

    Hi
    I never implemented this note, but am aware because others implemented it... They were able to get the result with it..
    you will ofcourse implement in a test client 1st, check it there and then move to production.. Meanwhile, also raise an OSS msg to SAP to confirm whether this is the right note to be implemented or not..
    By the time they reply, you will also have your test result on your hand
    Seems logical?
    regards
    Ajay M

  • Sales order number from Sales invoice

    Hello All ,
    I have a requirement in which when I am running a certain mass update program in which the sales invoice will be populated with a certain number in the Sales invoice text . However before running it I need to ensure that Sales order corresponding to the Sales invoice is updated with a certain number in the Sales order Text field  . The user will give the input SAP invoice number > I need to identify the most efficient/quickest way to find the sales order corresponding to the Sales Invoice and check if a particular field is updated or not I tried used VBFA , but it will point to delivery and time take is also more .

    Hi Nagabhushan,
    Since you say you will be given the Invoice no as an input from the user you can use VBFA table to get the cooresponding Sales order no.
    In VBFA table in the Prec.doc.categ. field enter C as the value which is Order and the system will give you the corresponding Sales Order that was created for the respective Sales Invoice.
    Hope thsi will help.
    Thanks and Regards,
    J Nagesh

  • Sales Order Number from BSID.

    How can I find Sales order no using the table bsid or bsad
    Regards

    Hi Nagabhushan,
    Since you say you will be given the Invoice no as an input from the user you can use VBFA table to get the cooresponding Sales order no.
    In VBFA table in the Prec.doc.categ. field enter C as the value which is Order and the system will give you the corresponding Sales Order that was created for the respective Sales Invoice.
    Hope thsi will help.
    Thanks and Regards,
    J Nagesh

  • Get the Sales Order number from Service Notification

    Hi Experts,
                       Please let me know if there are any BAPI's or standard Function modules to get the Sales order for a given Service Notification number.
    Thanks a lot

    Hi Ashish,
    Hope the listed BAPI's let you solve the issue:
    BAPI_SERVNOT_CLOSE Complete service notification
    BAPI_SERVNOT_CREATE Create service notification
    BAPI_SERVNOT_DEL_DATA Delete Items, Causes, Activities, Tasks, Partners of the service notif.
    BAPI_SERVNOT_GET_DETAIL Get details about a service notification
    BAPI_SERVNOT_MODIFY_DATA Modify a service notification or associated subdata
    BAPI_SERVNOT_POSTPONE Postpone service notification
    BAPI_SERVNOT_PUTINPROGRESS Put in process a service notification
    BAPI_SERVNOT_SAVE Save service notification
    BAPI_SERVICENOTIFICAT_CREATE Create service notification
    BAPI_SERVICENOTIFICAT_GETLIST Select service notifications according to customer or contact person
    BAPI_SERVNOT_CHANGEUSRSTAT Change the user status of a service notification
    Regards,
    Soundarya.

  • To know Customer from Billing Document number

    Hi,
    In VF03 IN we enter BILLING DOCUMENT NUMBER then we get detail of that. How can we find Customer(KUNNR from KNA1) from this BILLING DOCUMENT NUMBER. Please help me in this.
    Thanks in advance.

    Hi  Suresh..
    Table: VBFA (sales doc flow)
    From Billing Document No  find the Sales order no.
    Table VBAK - From sales order No find the Customer No.
    reward if Helpful.

  • Fetch Sales Order number VBELN from Purchase requisition number BANFN

    Hi,
    I'm not able to find a suitable method to fetch the sales order number(VBELN) from the purchase requisition number(BANFN).
    I tried using VBEP table to fetch the data, but it is giving serious performance issues, as in for fetching one record it is taking approx 20 seconds!!!
    Kindly suggest a suitable method for this.
    I've used the query as folllows:
    select single vbeln banfn
    from vbep
    into (wa_vbep-vbeln, wa_vbep-banfn)
    where banfn eq wa_eban_zdd1_x-banfn.
    where: wa_vbep is the workarea having two fields vbeln and banfn, and wa_eban_zdd1_x-banfn is the reference preq number.
    Scenario in brief described below:
    Whenever a direct delivery sales order is created on a supply chain plant, a dummy purchase requisition without source of supply is created automatically at preferred supplying plant for the customer in the sales order. Direct Delivery Sales Orders which are still in Open status and for the associated dummy purchase requisitions with these sales order, the deletion flag set has to be unchecked.
    in this case, only one sales order is created corresponding to a preq..
    BAPI: BAPI_PR_GETDETAIL is not giving entries for the table as this is a special case of direct delivery from the production plant directly to the customer, bypassing the warehouse / distribution center...
    selection screen has input fields preq, matnr(product) and plant. we fetch entries depending on the data filled in selection screen and also they should be of document type(BSART in EBAN table) ZDD1 and deletion indicator is set(LOEKZ in EBAN).
    then we check if the sales order corresponding to the preq is in open status...
    for this i need to programmatically fetch the sales order number corresponding to the preq...
    this is causing a performance issue as i could find only one way -- fetching sales order number from VBEP table corresponding to BANFN... indexing for easier also didnt work...
    no other way i could find to fetch sales order number corresponding to the preq number....
    there is a bapi: BAPI_PR_GETDETAIL, but this is not fetching entries to the changing tables related to sales order...
    also EBKN table doesnt have any entries as this is a special case of direct delivery preq..
    Guess i couldnt find anyother way...
    Thanks.

    I'm not sure as to why the select query was still throwing performance issues. I could see that the index had been created on only BANFN in the DB. Prior to creating the index, it was taking approx 20 seconds per entry, but after creating the index, it took 13seconds approx.
    I used the select query as follows:
    select single vbeln banfn
    from vbep
    into (wa_vbep-vbeln, wa_vbep-banfn)
    where banfn eq wa_eban_zdd1_x-banfn.
    where: wa_vbep is the workarea having two fields vbeln and banfn, and wa_eban_zdd1_x-banfn is the reference preq number.
    I tried a few other combinations also, but  those also didnt work effectively:
    select vbeln banfn
    from vbep
    into (wa_vbep-vbeln, wa_vbep-banfn)
    where banfn eq wa_eban_zdd1_x-banfn.
    without using SINGLE in the select query as the select query would implicitly pickup only a single record,
    select vbeln banfn
    from vbep
    into wa_vbep
    where banfn eq wa_eban_zdd1_x-banfn.
    and another query where the INTO statement was directed directly to a workarea.
    But unfortunately, nothing seemed to be working.
    The index i had created was on BANFN alone in the VBEP table.

  • Sales document flow(vbfa) entries are deleted

    Hi Guys,
            I am facing a problem with VBFA table. Actually for some delivery i am able to get Sales order number from VBFA table but for some delivery there is no records exists in VBFA table. So just want to know is there any program or Funtion module which delete entries from VBFA table if not then is there any functional configuration which not allowed to enter data in VBFA table. In my system i searched for all the programs and function module  but no luck.
    I can saw the Sales document flow in VL03N but no entries in VBFA table.
    thanks,
    Baidya

    Hi  Guys,
          Thanks for the replies.
    But this is true for some delivery there is no entries in VBFA table but entries are exist in LIKP and LIPS. We are using userexit in sales order program for creating delivery. The Function module  which creates delivery inside the USER-EXIT is : BAPI_OUTB_DELIVERY_CREATE_SLS.
    If anyone face this type of problem please reply..
    Thanks,
    Baidya

Maybe you are looking for