Get Sales order from Billing document number

Given Billing document number from VBRK-VBELN, how to get the Sales order number VBAK-VBELN?

Please check table VBFA.
Below code might give you some idea:
PARAMETERS: P_VBELN TYPE VBELN OBLIGATORY.
DATA: COMWA TYPE VBCO6.
DATA: IT_VBFA TYPE TABLE OF VBFA,
      WA_VBFA TYPE VBFA.
COMWA-VBELN = P_VBELN.
CALL FUNCTION 'RV_ORDER_FLOW_INFORMATION'
  EXPORTING
   BELEGTYP            = 'M'
   COMWA               = COMWA
  TABLES
    VBFA_TAB            = IT_VBFA
EXCEPTIONS
   NO_VBFA             = 1
   NO_VBUK_FOUND       = 2
   OTHERS              = 3.
LOOP AT IT_VBFA INTO WA_VBFA WHERE VBTYP_N = 'C'.
   WRITE:/ WA_VBFA-VBELN.
ENDLOOP.
Kind Regards
Eswar

Similar Messages

  • Sales Order and Billing Document Number

    Hi All,
    I have  Billing document Number (LIKP-VBELN).
    Based on Billing document number, how to find out the corresponding Sales Order....????
    Is there any logic to find out this...??????
    Regards
    Pavan

    Hi,
    Go to VF02 and enter your Billing Document Number and "Enter".
    Environment -> Display Document Flow.
    Select standard order ->  Diplay Document.
    It will shows the sales order.
    Thanks,
    Reward If Helpful.

  • 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

  • User exit to copy the data from sales order to billing document

    hi everyone,
    Is there an user exit to copy the data from sales order to billing document?
    Regards
    Prabudh

    hi
    copy control would be the better option to choose.. but still u can a give a search in list below and opt for the right one..Refer to the link below..
    http://www.planetsap.com/Userexit_List.htm
    User exits for Sales order
    1•USEREXIT_DELETE_DOCUMENT
    2•USEREXIT_FIELD_MODIFICATION
    3.•USEREXIT_MOVE_FIELD_TO_VBAK
    4.•USEREXIT_NUMBER_RANGE
    5.•USEREXIT_SAVE_DOCUMENT
    User exits for billing
    1.•USEREXIT_ACCOUNT_PREP_KOMKCV (Module pool SAPLV60A, program RV60AFZZ)
    2.•USEREXIT_ACCOUNT_PREP_KOMPCV
    3•USEREXIT_NUMBER_RANGE_INV_DATE (Module pool SAPLV60A, program RV60AFZC)
    4•USEREXIT_PRINT_ITEM (Module pool SAPLV61A, program RV61AFZB
    5.USEREXIT_PRINT_HEAD (Modulpool SAPLV61A, Programm RV61AFZB)
    Reward if Useful
    Thanx & Regards..
    Naren..

  • Copying Text From Sales order to Billing Document

    Hi all,
    I have searched all posts for my issue but found nothing so that i am posting this issue.
    I want to copy the Some text form sales order to billing document is there any cnfig to do this
    order is there any exit for billing in which i can write code to copy text from sales order to billing document.
    please provide me a solution.
    Thanks in adavnce.
    Vinod.

    Hi,
    Use the same t-code VOTXN to do access sequence assignment.
    When you choose text object Billing Doc (header/item), there is 3 folders in dialog structure:
    - Text procedure
    - Access sequence
    - text procedure assignment
    In the text procedure folder, select related text procedure, then assign the created access sequence to respective text id.
    Hope this help.
    Cheers,

  • Sales order and billing document fields

    what are the fields for sales order and billing document dates?

    Hi
      Couldnt really get the exact requirement:
    1. If Billing Dates are to be extracted from Sales Documents, we can do that by extracting field <b>FKDAT</b> from table <b>VBKD</b>.
    2. If it is Billing Document creation date, extract from VBRK-ERDAT with below condition.
      select vbrp~vbeln vbrp posnr vbrp~aubel
             vbrp~aupos vbrk~erdat into table itab
             from vbrp as a
             inner join vbrk as b
             on vbrp~vbeln = vbrk~vbeln
             where vbrp~aubel in s_vbeln.  "Sales Documents
       Hope this gives you some idea.
    Kind Regards
    Eswar

  • Variant configuration statistics of sales order and billing document

    Is there any transaction that allow me to get statistics from the sales orders and billing document for configurable materials ? (like VA05) better if using the values of the characteristics that make up the positions of order.
    Thera are any information from "Sales Information System" using LIS?
    Thanks.

    Hi,
    With LIS, we'll find different infostructures.
    See this link to configure LIS reports :
    http://help.sap.com/saphelp_47x200/helpdata/en/c1/375723449a11d188fe0000e8322f96/frameset.htm
    Using many infostructures before to see sales analysis.
    Another solution :
    In sales order (by user exit), copy characteristics in new fields in VBAP.
    Then, you can use these fields in VA05 (add user exit) or new ABAP report.
    Regards,
    Lionel

  • Sales order and billing document modify log

    Dear Gurus,
    I would like to know if there are any standard report with Sales order and billing document modifies by a user.
    I know that you can see modifies by going to VA03/VF03 -> Environment -> Changes. But this report is too poor.
    Thanks in advance.
    Best regards.
    Juan

    Tcode  AUT10  is the best one    Here, maintain From-To date and TCode and execute.
    thanks
    G. Lakshmipathi

  • Authorization for Change Conditions in Sale order or Billing document

    Good Morning
    In my scenario we have same pricing procedure for sale order and billing document. My requirement is to enter one condition manually in sales order.
    I want a specific user to enter this discount condition for a specific distribution channel only manually only in Sales order, not in billing document.
    Now here are some problems i am facing now.
    We have to make this for one user and for one distribution channel only.
    I can't use transaction variant to make condition tab in display because all users are allowed to enter freight condition manually at the time of invoicing.
    I have tried authorization object V_KONH_VKS but its not working. This is for maintain condition record not for entering in sales or billing document manually.
    Please suggest me is there any standard way to do this or should I go for ABAP?
    I prefer to do this with authorizations control. ABAP will be the last solution.

    I have a feeling that via PFCG,  this can be controlled and of course, with the object what you had indicated and Activity type.
    Create two roles one for maintaining manually in sale order and the other one for display.
    In one role, the activity can be 01 with TCode VA01 and VA02 and in the second role, the activity can be 03 with transaction VF01. Your basis guy should be able to do this so that the requirement can be achieved.
    thanks
    G. Lakshmipathi

  • Regresion test flow of Sales order and billing document to CO-PA

    Hi
    In the regresion test we need to test the  sales order and billing documents values are flown to CO-PA are not.
    May i know the transaction codes to test this scenario
    Best regards
    Thomas

    Hi
    1. Your sales ordre will have a pricing procedure in it.. Pricing procedure has condition typess. for revenues and discounts. Did you assign cond types in KE4I to your value field?
    2. Also, if your pricing procedure has cond type VPRS, this will contain the COGS.... Assign VPRS also to a value field in KE4I
    3. Check If you did the settings in COPA for
    a. Select Valuation Strategy 001 in KE4U
    In DETAILS tab: Assign it to Appl = KE, Check Mat Cstng, and Qty Field = ABSMG
    In Assignment tab: Assigning 001 to Point of valuation 01 and Record Type = F
    b. Creating a costing key in KE40
    Check : Transfer  Std cost estimate
    Period indicator =Current Cost estimate acc to entry in mat master
    c. assigning costing key to material types in KE4J or KEPC and
    d. assigning Cost Comp Structure to Value field in KE4R
    Regards
    Ajay M

  • Standard COGS cannot be Transferred from Sales Order to Billing Document

    I did a test in current client with the following steps:
    Create Sales Order for Configurable Material -> Execute Sales Order Costing Run, marked and Saved the result via CK51 -> Create Prodcution Order for such Sales Order -> Confirm Prod Order -> Conduct GR per the Prod Order -> Conduct Goods Delivery for the Sales Order-> Create Billing.
    (There is not any costing value during the whole process)
    There are many Value Fields in the CO-PA document regarding to this billing, the value of standard COGS items(including Material Cost, Period Machine, Variable Labor etc) are also included and their value are expected to be transferred from Sales Order. However,  in my testing, those COGS value failed to be transferred to Billing document. I am not sure whether there is any config related. (KEPC hs already been done in such case). Would any expert can help on that?

    en, It is solved now. Untick "Transfer aux. CC Split" in KE40, then the value can transported to billing.
    Edited by: Ying Zhu on Nov 18, 2008 1:10 PM

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

  • Difference amount in sales order and billing document (For one line item)

    Hi Experts,
    User created sales order with 3 line items and billing document. but problem is that there is difference in value of sale order and billing only for line item 10. The remaining items values are same in sales order & billing doc.if I check in sales order condition I found that VPRS condition is used and the value is 692.13and the amount is 3245.26in sales order. But if suppose I check the same value in billing doc the value is 0.69 and the amount is 3245.28. Can u suggest me which configuration I have to check for this.
    I also checked change lock but there is no change in sales and billing document & Material
    Regards
    Sunina agarwal

    Morning Sunina
    Now consider this scenario
    Item a - 10
    Item b - 20
    Item c - 30
    and the validity of condition rec for item C is 31st of Jan
    after 31st JAN the record changes or there isn't any.
    In Copy control the pricing type is 'B' i.e., carry out new pricing.
    Now if the document is created in January it will take all the above prices. and this document is then billed in Feb. Now the copycontrol, whilst copying the prices, will predetermine the same.
    Now your task is to check if there was user intervention, check the pricing in order and check what condition types got affected in order and in billing.
    If your scenario is still not amongst the above cases...
    I don't know what to do, if you figure out please let us also know, god know when we would face the same scenario....
    Take care

  • Copy Txt values of Text dertermination from sales order to Billing document

    Dear Forum,
    How can we copy a Text Determination proc from a Sales Transaction type to a Billing document.
    I have created a Text Determination proc for a Sales Transaction type..
    i.e
    Text Object: CRM_ORDERH (Transaction Header)
    Definition of Proc
    Text Object               CRM_ORDERH
    Text Det.Proc.           ZMODKIT
    Text Type                  ZPAY
    Sequence                  0002
    Access Sequence      ZPAY
    Transfer Type             Save reference only 
    In Access Sequence
    Ref. Object        CRM_ORDERH
    Ref. Object         Transaction Header
    Ref. Text Type    ZPAY
    Ref. Text Type    Payment Details
    Text Determination For Billing
    Text Object      BEA_BDH
    Text Det.Proc.   ZMODKIT
    Text Type        ZPAY
    Sequence        0002
    Transfer Type   Copy
    Access Sequence ZPAY
    Desc. Access    Payment Details
    In Access Sequence
    Text Object      BEA_BDH
    Access Sequence  ZPAY
    Sequence         0002
    Ref. Object     CRM_ORDERH
    Ref. Object     Transaction Header
    Ref. Text Type  ZPAY
    Ref. Text Type  Payment Details
    Scenario:
    i create a Sales order by enetering few details along with Text types.
    When i go for the billing
    1) SAP Menu> Sales> Billing-->Maintain billing due list..
    2) Enter Document no and process
    3) Go for Individual billing
    4) Select Text Tab
    The values entered into the Text Determination for a Sales Transaction type is not getting copied here.
    Please look into this problem and revert back...
    Regards,
    Nirav / Ankush
    022-6767 2087
    [email protected]

    hi
    copy control would be the better option to choose.. but still u can a give a search in list below and opt for the right one..Refer to the link below..
    http://www.planetsap.com/Userexit_List.htm
    User exits for Sales order
    1•USEREXIT_DELETE_DOCUMENT
    2•USEREXIT_FIELD_MODIFICATION
    3.•USEREXIT_MOVE_FIELD_TO_VBAK
    4.•USEREXIT_NUMBER_RANGE
    5.•USEREXIT_SAVE_DOCUMENT
    User exits for billing
    1.•USEREXIT_ACCOUNT_PREP_KOMKCV (Module pool SAPLV60A, program RV60AFZZ)
    2.•USEREXIT_ACCOUNT_PREP_KOMPCV
    3•USEREXIT_NUMBER_RANGE_INV_DATE (Module pool SAPLV60A, program RV60AFZC)
    4•USEREXIT_PRINT_ITEM (Module pool SAPLV61A, program RV61AFZB
    5.USEREXIT_PRINT_HEAD (Modulpool SAPLV61A, Programm RV61AFZB)
    Reward if Useful
    Thanx & Regards..
    Naren..

  • Need to copy a custom field from sales order to billing document

    Hi All,
    I have a requirement, I need to add a new field in the sales order header part and even a field in the billing document, once i add this field up in both the documents in the header part i need to create a copy routine using the VOFM tran, can any body help me on what's the procedure to add a field in billing document and does the copy routine transfer the data ( Custom Field ) from Sales Order to the Billing Document, if yes can somebody help me with the procedure on how to and code of it.
    solved it myself ....
    Regards.
    Message was edited by: seshi
            seshi

    Hello,
    Regarding item 1, is it in the region of the global links (ie logout, home, preferences, etc.)? If not, have you tried creating a link via personalizations to the region you wish to have the link displayed (item type = link, destination = fully qualified name of your .xml page/region?
    Regarding item 2, you may have to create the custom subtab programatically using the controller for the region of the current subtab layout.
    Regarding item 3, you can also add a submit button to the page button bar region via personalizations. You can then add any logic you want to the button in the controller for the page.
    Hope this helps.

Maybe you are looking for