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

Similar Messages

  • COPA document created from billing document, cost components are twice

    Hi Experts,
    Ref Subject line : COPA document created from billing document, cost components are twice.
    I have checked the following :
    1.  Cost Estimate of a material
    2.  Production Confirmation of the Order
    When comparing both of the above, they are same, without variance.
    Now when a COPA document is created, we observe the Cost Component Split in Sales Order to be exactly TWICE as compared to Cost Estimate of the material.
    May I please request help from you all. What must be the cause & where do i check / rectify.
    Regards,
    Hussein.

    Hi Hussein
    If you are seeing double in KE30 Report - May be you are updating both sales order and billing doc in COPA and hence you are seeing 2 line items.. But one of them will be record type A and the other one with F
    If the above is not the case and you are seeing double in the COPA document itself - Then See if you have mapped VPRS cond type in KE4I to the same value fields as Cost Comp Split
    Also, one strong possibility that you are using Batch Split in SD.. .... Which means your delivery document (VL03N) will have multiple batches of materials being delivered to the customer....
    a. In this case, your Item Category for main item (HPOS) and Sub Item (UPOS) has to be different and the Item catg for UPOS should not be relevant for billing / Costs... Note 77414 descirbes this situation and the settings to be done in SD Customizing
    b. You may need to apply note 352441 in your system
    Regards
    Ajay M
    Edited by: Ajay Maheshwari on Dec 1, 2010 5:36 PM

  • 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

  • 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

  • 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

  • How to get the service address from service address number

    Hi, IS-U Gurus:
    I got the service address number by passing business partner number to  BAPI 'BAPI_ISUPARTNER_GETDETAIL'
    On return table of "bapiisubpa", the first field is service number, but what we need is service address,
    How can I get the service address from service number ?
    Thanks in advance.
    Liang
    Edited by: Liang Ji on Apr 27, 2009 6:57 PM

    hi
    are u looking for business partner address?
    if so u can ref table but020, get its bp no. and then refer table but000 for its address.
    Regards,
    Sumedha

  • How to get the raw data from particular document's schedule ?

    Hello,
    I am now able to get the data from a document usign RESTful Web Services SDK and what I need is to
    get the data not from the current version of the document but from the schedule that were executed some time ago
    with the older data than the current data.
    Any hints ?

    Hey Jacek,
    Please, look at the /schedules into Raylight API.
    Regards,
    Anthony

  • How to get one column value from a DOCUMENT TYPE attribute

    Hi,
    I have created a DOCUMENT TYPE attribute which queries from a table and all the column values( For Ex: Customer Name, Contact Name and Address) are displayed in the message body.
    I want one column value(For Ex: Customer Name) to be displayed in the SUBJECT of the message.
    How can this be done? Please let me know.
    Thanks in advance.

    Thanks Matt. I have used SETITEMATTRTEXT to get a single column value into an ITEM ATTRIBUTE.
    Please see the following procedure...
    ==========================================================
    PROCEDURE MisNotifyDataDesk(
         itemtype IN VARCHAR2
         , itemkey IN VARCHAR2
         , actid IN NUMBER
         , funcmode IN VARCHAR2
         , resultout OUT VARCHAR2
         ) IS
    p_Cart_Id               VARCHAR2(30);
    p_ORG_NAME                     VARCHAR2(360);
    BEGIN
         IF funcmode != WF_ENGINE.ENG_RUN THEN
              wf_log_pkg.string(5,'Notify_Cust_Data_Desk','Not in RUN mode');
         RETURN;
         END IF;
    p_Cart_Id := WF_ENGINE.GetItemAttrText ( itemtype => itemtype
    , itemkey => itemkey
    , aname => 'CART_ID' );
    p_code_position := 10;
         SELECT
              ORG_NAME
         INTO
              p_ORG_NAME                     
         FROM
              MISIBE_END_CUST_DETAILS
         WHERE
              QUOTE_HEADER_ID = p_Cart_Id;
    -- For TEXT BODY
    WF_ENGINE.SETITEMATTRTEXT(itemtype => itemtype , itemkey => itemkey , aname => 'ORG_NAME',avalue => p_ORG_NAME);
    resultout := WF_ENGINE.ENG_COMPLETED||':'||CUST_DATA_CHECK(p_Cart_Id);
    EXCEPTION
         WHEN OTHERS THEN
              WF_CORE.context (
              'WFCustCheck',
              'MisNotifyDataDesk',
              itemtype,
              itemkey,
              TO_CHAR(actid),
              funcmode,
              SQLERRM
    RAISE_APPLICATION_ERROR (-20005, SQLERRM);
    ===========================================================
    I am using &ORG_NAME in the body and subject of my message. But the value is
    not retrieved into the ITEM ATTRIBUTE when I run my process. It is just displaying in the message and the subject of hte message as "&ORG_NAME"
    CUST_DATA_CHECK used in the resultout, is a function which returns 'T' or 'F'. That part is working fine. Just retrieving the ORG_NAME in the ITEM ATTRIBUTE is not working.
    Am I going wrong somewhere? Please let me know.
    Thanks,

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

  • How to Copy from Billing document F2 to Credit or Debit memo?

    Hello,
    I know the Menu path for copy control of billing document to billing document which  is as follows
    SPROIMG-Sales and Distribution-BillingBilling Documents-Maintain Copy Control of Billing document--Copy COntrol: Billing Document to Billing Document where I give the Source and the target.
    Now I have a scenarion where F2 invoice has ForTrade/Customs information in the Header of F2 invoice which can be viewd through VF03->Header->ForTrade/Customs tab.
    Now that inforamtion has to be transferred to CR/DR which is now not being copied although I have set the copy controls between the billing document.
    So, can anyone help me by providing the information for the following questions?
    1.How will I acheive the copy of Foreign trade to CR/DR from F2?
    2. When I copy from F2 to CR/DR, which all information from F2 will be copied to CR/DR?
    Thanks for the help.
    Anupama Rao

    Anupama,
    The foreign trade data is copied from delivery to billing and any order doesn't contains the foreign trade data and when you create a credit memo request CR by copying F2 invoice the foreign trade data is not copied to CR and when you create a G2 invoice from CR the foreign trade data is not copied because it doesn't exists
    the optimal solution for this is to keep the incompletion for foreign trade in the G2 and L2 inovices
    Regards,
    Santosh

  • Transfer document header text from billing document to FI document

    Dear all,
    Where do I specify that the document header text out of the billing document should be transferred to the corresponding FI document?
    Currently, the FI document header text (BKPF-BKTXT) remeans blank after transfer from billing document. We need this field to be filled in, but I haven't found how to have this filled in.
    In copy control from sales doc to billing doc, there is the possibility to transfer the Reference number & Assignment, but nothing about document header texts.
    Some say that it would only be possible via coding, but anybody has any idea if it might be possible via standard SAP?
    Many thanks!
    Best regards

    Hi,
    We also had a bit same requirement, which is to copy the billing header text to FI item text (BSEG-SGTXT). The solution we took is to use FI Substitution (t-code GGB1), so that every time a FI document created from SD... the substitution reads the billing header text and put it in the FI item text. I think the same method could be used for FI header text (BKPF-BKTXT). Below is the solution for your reference.
    Prerequisite:
    Document Type = 'RV' AND Reference <> '' AND
    ( Transaction code = 'VF01' OR Transaction code = 'VF02' OR
    Transaction code = 'VF03' )
    Substitution:
    Using exit which coding is as below.
    *&      Form  u900
          Copy Billing Header Text to SGTXT
         -->P_SGTXT    FI Item Text
    FORM u900 USING p_sgtxt TYPE bseg-sgtxt.
      DATA: lv_name TYPE thead-tdname,
            lt_line TYPE STANDARD TABLE OF tline,
            lw_line TYPE tline.
      lv_name = bkpf-xblnr.
      CALL FUNCTION 'READ_TEXT'
        EXPORTING
          id                      = 'Z001'
          language                = sy-langu
          name                    = lv_name
          object                  = 'VBBK'
        TABLES
          lines                   = lt_line[]
        EXCEPTIONS
          id                      = 1
          language                = 2
          name                    = 3
          not_found               = 4
          object                  = 5
          reference_check         = 6
          wrong_access_to_archive = 7
          OTHERS                  = 8.
      IF sy-subrc EQ 0.
        READ TABLE lt_line
          INTO lw_line
          INDEX 1.
      In Billing Header Text, the sign '&' (ampersand) is automatically
      added some characters so it becomes '<(>&<)>'.
      The logic below is to fix that issue.
        REPLACE ALL OCCURRENCES OF '<(>' IN lw_line-tdline WITH space.
        REPLACE ALL OCCURRENCES OF '<)>' IN lw_line-tdline WITH space.
        p_sgtxt = lw_line-tdline.
      ENDIF.
    ENDFORM.
    Regards,
    Teddy Kurniawan

  • Origin of sales tax ID number in billing documents

    Hello,
    The field "Origin of sales tax ID number" in billing documents determines from where the tax ID number is taken, for example:
       A - Ship-to party
       B - Payer
       C - Sold to Party
    When the partner functions of the customer are different, how can I decide whose tax ID number the billing document takes? I need to take the tax ID of the payer but it takes of the ship to party.
    Thanks in advance, best regards,
    Silvia

    hi,
    The path here is IMG, Sales and distribution, Basic functions, Taxes, Maintain sales
    tax—Identification number determination.
    Three available options can be assigned to each sales organization. It is recommended that in order to keep consistency throughout the system, use the same determining rules across all sales organizations.
    The first is determination rule A, which indicates that the tax number and tax indicator classification are generally taken from the sold-to party customer master record.
    Determination rule B indicates that the tax number and tax classification are generally taken from the customer master record of the payer.
    Finally, if the field is left blank, the system determines the tax number and the tax classification according to the following sequence:
    1.If the payer has a VAT registration number and is identical to the sold-to party, the tax number and tax classification are copied from the payer (in this case, the ship-to party is not relevant). The tax number is copied according to the country of destination relevant for taxes.
    2. If 1 does not apply, the ship-to party has a VAT registration number, and the sold-to party does not, the tax number and tax classification are copied from the ship-to party.
    3. If 2 does not apply, the tax number and tax classification are copied from the sold-to party.
    CHAN

  • How can I find out in the billing document, who creat the billing.

    how can I find out in the billing document, who creat the billing.
    thanks.

    On  VF03 -Enter billing document number>>press on enter button>>you will get overview of billing document item>> select menubar>>Goto>>header>>header parthner>>you will get full screen with Name "Created By".
    Thanks&Rgds,
    Rajesh

  • How to extract audit log data from every document library in site collection using powershell?

    Hi All,
    I have n number of document library in one site collection,
    My query is- How to extract audit log data from every document library in a site collection using powershell?
    Please give solution as soon as possible?

    Hi inguru,
    For SharePoint audit log data, These data combine together in site collection. So there is no easy way to extract audit log data for document library.
    As a workaround, you can export the site collection audit log data to a CSV file using PowerShell Command, then you can filter the document library audit log data in Excel.
    More information:
    SharePoint 2007 \ 2010 – PowerShell script to get SharePoint audit information:
    http://sharepointhivehints.wordpress.com/2014/04/30/sharepoint-2007-2010-powershell-script-to-get-sharepoint-audit-information/
    Best Regards
    Zhengyu Guo
    TechNet Community Support

  • How to get all the values from the dropdown menu

    How to get all the values from the dropdown menu
    I need to be able to extract all values from the dropdown menu; I know how to get all those values as a string, but I need to be able to access each item; (the value in a dropdown menu will change dynamically)
    How do I get number of item is selection dropdown?
    How do I extract a ?name? for each value, one by one?
    How do I change a selection by referring to particular index of the item in a dropdown menu?
    Here is the Path to dropdown menu that I'm trying to access (form contains number of similar dropdowns)
    RSWApp.om.GetElementByPath "window(index=0).form(id=""aspnetForm"" | action=""advancedsearch.aspx"" | index=0).formelement[SELECT](name=""ctl00$MainContent$hardwareBrand"" | id=""ctl00_MainContent_hardwareBrand"" | index=16)", element
    Message was edited by: testtest

    The findElement method allows various attributes to be used to search. Take the following two examples for the element below:
    <Select Name=ProdType ID=testProd>
    </Select>
    I can find the element based on its name or any other attribute, I just need to specify what I am looking for. To find it by name I would do the following:
    Set x = RSWApp.om.FindElement("ProdType","SELECT","Name")
    If I want to search by id I could do the following:
    Set x = RSWApp.om.FindElement("testProd","SELECT","ID")
    Usually you will use whatever is available. Since the select element has no name or ID on the Empirix home page, I used the onChange attribute. You can use any attribute as long as you specify which one you are using (last argument in these examples)
    You can use the FindElement to grab links, text boxes, etc.
    The next example grabs from a link on a page
    Home
    Set x = RSWApp.om.FindElement("Home","A","innerText")
    I hope this helps clear it up.

Maybe you are looking for