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

Similar Messages

  • 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

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

  • Sales order number in customer invoice

    Hello,
    I have an FI custome invoice created automatically from SD module.
    Is it possible to enter the sales order number in the fI invoice?
    In the FIinvoice there is the field KDAUF (Sales order number) how is possible to popultate automatically this field?
    Thanks a lot,
    Cheers,
    Emanuela

    In standard this is not possible.
    You have to develop a zee transaction which should consider Tables VBFA and VBRK or VBRP.  In this zee transaction, automatically you can populate sale order reference and billing documents with the above table combinations so that the end user can see against one sale order, how many billing documents have generated in a day.  There should be one more editable field  where the end user has to key in the value against the sale order so that the same has to be updated in VBRP table.
    This is possible only if the accounting document has not been generated.
    thanks
    G. Lakshmipathi

  • Getting purchase order number from sales order number

    Hi Experts,
    My requirement is to fetch the following values from a sales-order number:
    Purchase Order Number,
    Delivery Date
    Order Type(Source of Order EDI/EFAX/..)
    Ship To,
    Sold To.
    We are trying to fetch this data from the ECC system in our CRM system.We are exploring the possibilty of RFC calls to get the data from ECC system.
    Is there any standard FM present in ECC which gives the above information from the sales order number?
    Thanks in advance
    Regards
    Shilpi

    Hi,
    Check the FM BAPISDORDER_GETDETAILEDLIST
    It provides the whole data for a particular Sales order which you need to provide Sales order number in the table 'SALES_DOCUMENTS' in tables parameter.
    You have to provide the view what you need and in the import parameter 'I_BAPI_VIEW' like all the views that are in the tables parameter...
    HEADER, ITEM etc...
    The fields
    PO_METHOD
    PURCH_NO
    REQ_DATE_H
    SOLD_TO " will provide you the details you need in the table 'ORDER_HEADERS_OUT'
    SHIP_POINT in ORDER_ITEMS_OUT table provides the ship to
    Regards
    Sarves

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

  • Purchase order number from Sales order

    hi gurus,
             i wan to pull PO number from SO number.i saw the customer PO in VA03 for that SO.
    what is the customer PO(in vbkd-bstnk)?.what is the PO in EKKO-ebeln?what is the diffrent between these two?

    Pradeep Chintala is right!
    vbak-bstnk is not long enough!
    if you va01 create a SO with customer po num's length exceeding 20, you'll find the vbak-bstnk is incomplete.
    and you would never find the vbak-bstnk in screens of  va01, va02, va03
    but you can find vbkd-bstkd.

  • Cannot edit header price when sales order copied from sales order

    I have a requirement to copy a sales order with Freight manually added in Header Pricing to another sales order.  The Header Price for Freight is grayed out on the target document and the requirement is to have that price field open to edit.  I've tried several copy control settings to no avail.  Will a copy control routine need to be written in order to open the freight price field for edit in the target document?
    I very much appreciate your assistance.
    NP

    Hi Nancy,
    Validate the Pricing Type in the copy control at item category level, by default Pricing type is equal to A (Copy price components and redetermine scale), which can be adjusted to adjust your requirement in copying from another sales order.
    Make sure your setting in the condition type under "Changes which can be made" are supporting the necessary changes a user needs to make.
    Regards,
    Naveen Aggarwal

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

  • Fetch Sales order number and PO number from ship to party and sold to party

    HI,
    I need to get Sales order number and PO number
    from ship to party and sold to party.
    I have only ______sold to party and ship to party and req del date_______ in selection screen as mandatory
    Please let me know
    Sreekanth

    Hi,
    You can do this:-
    SELECT VBELN FROM LIKP
    INTO TABLE T_DELIVERIES
    WHERE KUNNR = SHIP TO PARTY
    AND     KUNAG = SOLD TO PARTY
    AND LFDAT      = DEL DATE.
    You will get a table containing the list of deliveries.
    Use VBFA to get the sales orders from deliveries.
    SELECT VBELV FROM VBFA
    INTO TABLE T_SALESORDERS
    WHERE VBTYP_N = 'J'
    AND     VBELN  = T_DELIVERIES-VBELN.
    T_SALESORDERS WILL give you list of sales orders.
    From Sales Orders you can get Purchase orders through EKKN Table.
    Using EKKN pass T_SALESORDERS-VBELN and get corresponding EBELN.
    Regards,
    SUbhashini

  • How to show Invoice number same as Sales Order Number..?

    HI,
    I need to show Sales Order Number same as Invoice Number how i can setup this..? can any one help me on this..?
    Ex: I raised a Sales Order: 00001, this has booked and shpieed now i ran the WF back ground process and run the autocreate master program to generate the invoice, here i need to show the invoice number as 00001 i..e same as the Sales Order Number.
    How i can achieve this..?
    Please advice..
    Regards,
    KV.

    KV,
    I suspect you'll need to customize the Autocreate routine to ignore the sequence nextval call and instead look at your sales order number.
    You would also need to be very careful that your OM setups supported this. I've seen this as a 'business requirement' before but almost invariably it doesn't make a lot of sense when you have the originating sales order number, line and shipment to quote as a reference on the invoice. Have you considered all of the following:
    <li> If you ever need to short ship or to ship on different dates, you will need more than one invoice for the same order. How would you manage that given that those invoices would need unique numbers?
    <li> Different order types - by adopting a 'synchronized' invoice sequence, you will need to ensure that you don't create a conflict with order type sequences - i.e. OM allows you to have an order 100001 of Order Type A and an order 100001 of Order Type B if you give different sequence assignments but this would cause problems with your invoice sequence.
    Regards,
    Jon

  • How to look for sales order number if I know outbound delivery number?

    How to look for sales order number if I know outbound delivery number?

    Hi ,
        If you want to see the Sales order Number from Outbound delivery or invoice,go to their respective T-codes,say for example,
    for delivery,Goto Tcode: VL02N / VL03N.There you will find Document Flow Icon,click on that,or press F7.
    You will get a window,there you can see the Sales order Number before your outbound delivery Number
    With Thanks and Regards,
    Priya

  • Fetch Sales order & item from Prod ord to TR Header text when staging mat

    Hello
    We have a need to see Sales order and item number in TR header text when selecting TR to be processed in transaction LB10.
    TR´s are created via transaction LP10. Is there any solution to get Sales order number from Production order to be automatically pasted to TR header text field when generating TR?
    SO & item is always available in Production order General data.
    Thanks for answers!
    -A
    Edited by: A_R_FIN on Feb 5, 2010 8:34 AM

    Hi,
    I hope the below link will help you.
    Help needed with BAPI_SALESORDER_CREATEFROMDAT1 parameters
    Thanks,
    Khushboo.

Maybe you are looking for

  • Ok, ok, I give up since no one can solve

    my second database connection problem. I am thinking about worst case. How to remove a database from system completely and cleanly?? Thanks for any help...

  • Need to query workflow for Shopping Carts for a report

    Hello, I am not familar enough with SAP's workflow to know if there are tables or function modules that I can use.  I am requested to develop a report to allow selection of a user's id and find all shopping carts where that person is in the workflow.

  • OSS Message UPDATE to SOLMAN CALL

    Dear Experts, We have Service Desk in place where we have also configured 'Forward Message to SAP'. We are sending message to SAP by using 'Send Message to SAP' action. As soon as we perform the action and save, we are getting OSS Number and its stat

  • HT204053 Icloud won't accept my username and password

    iCloud won't recognize my Allpe ID or Password?  Any ideals of what I maybe doing wrong or how to get into iCloud.  I lost all my contacts when           I updated my iphone..the contacts are still on my mac.  How can I get them back to my phone? Tha

  • How to retrieve from email from Exchange server Mail Account ?

    Dear All, I get the email in my mail box from [email protected] I need to retrieve the from email address but i am unable to get this. Following is code i am using. Folder boundFolder = Folder.Bind(service, WellKnownFolderName.Inbox);