Bkpf-xblnr & bseg-rebzg

hi all,
may i know where does the system define or which tcode that i can see to have the billing number updated in bkpf-xblnr and bseg-rebzg after posted to fi?
thanks
rgds

Dear Eliana,
I think you should confirm the billing doc No in BSEG-VBELN.
Best Regards,
Gladys xing

Similar Messages

  • Performance issue in BI due to direct query on BKPF and BSEG tables

    Hi,
    We had a requirement that FI document number fieldshould be extracted in BI.
    Following code was written which has the correct logic but performance is bad.
    It fetched just 100 records in more than 4-5 hrs.
    The reason is there was a direct qury written on BSEG and BKPF tables(without WHERE clause).
    Is there any way to improve this code like adding GJAHR field  in where clause? I dont want to change the logic.
    Following is the code:
    WHEN '0CO_OM_CCA_9'." Data Source
        TYPES:BEGIN OF ty_bkpf,
        belnr TYPE bkpf-belnr,
        xblnr TYPE bkpf-xblnr,
        bktxt TYPE bkpf-bktxt,
        awkey TYPE bkpf-awkey,
        bukrs TYPE bkpf-bukrs,
        gjahr TYPE bkpf-gjahr,
        AWTYP TYPE bkpf-AWTYP,
        END OF ty_bkpf.
        TYPES : BEGIN OF ty_bseg1,
        lifnr TYPE bseg-lifnr,
        belnr TYPE bseg-belnr,
        bukrs TYPE bseg-bukrs,
        gjahr TYPE bseg-gjahr,
        END OF ty_bseg1.
        DATA: it_bkpf TYPE STANDARD TABLE OF ty_bkpf,
        wa_bkpf TYPE ty_bkpf,
        it_bseg1 TYPE STANDARD TABLE OF ty_bseg1,
        wa_bseg1 TYPE ty_bseg1,
        l_s_icctrcsta1 TYPE icctrcsta1.
        "Extract structure for Datasoure 0co_om_cca_9.
        DATA: l_awkey TYPE bkpf-awkey.
        DATA: l_gjahr1 TYPE gjahr.
        DATA: len TYPE i,
        l_cnt TYPE i.
        l_cnt = 10.
        tables : covp.
        data : ref_no(20).
        SELECT lifnr
        belnr
        bukrs
        gjahr
        FROM bseg
        INTO TABLE it_bseg1.
        DELETE ADJACENT DUPLICATES FROM it_bseg1 COMPARING belnr gjahr .
        SELECT belnr
        xblnr
        bktxt
        awkey
        bukrs
        gjahr
        AWTYP
        FROM bkpf
        INTO TABLE it_bkpf.
        IF sy-subrc EQ 0.
          CLEAR: l_s_icctrcsta1,
          wa_bkpf,
          l_awkey,
          wa_bseg1.
          LOOP AT c_t_data INTO l_s_icctrcsta1.
            MOVE l_s_icctrcsta1-fiscper(4) TO l_gjahr1.
          select single AWORG AWTYP INTO CORRESPONDING FIELDS OF COVP FROM COVP
          WHERE belnr = l_s_icctrcsta1-belnr.
          if sy-subrc = 0.
              if COVP-AWORG is initial.
           concatenate l_s_icctrcsta1-refbn '%' into ref_no.
                  READ TABLE it_bkpf INTO wa_bkpf WITH KEY awkey(10) =
                  l_s_icctrcsta1-refbn
                  awtyp = COVP-AWTYP
                  gjahr = l_gjahr1.
            IF sy-subrc EQ 0.
              MOVE wa_bkpf-belnr TO l_s_icctrcsta1-zzbelnr.
              MOVE wa_bkpf-xblnr TO l_s_icctrcsta1-zzxblnr.
              MOVE wa_bkpf-bktxt TO l_s_icctrcsta1-zzbktxt.
              MODIFY c_t_data FROM l_s_icctrcsta1.
              READ TABLE it_bseg1 INTO wa_bseg1
              WITH KEY
              belnr = wa_bkpf-belnr
              bukrs = wa_bkpf-bukrs
              gjahr = wa_bkpf-gjahr.
              IF sy-subrc EQ 0.
                MOVE wa_bseg1-lifnr TO l_s_icctrcsta1-lifnr.
                MODIFY c_t_data FROM l_s_icctrcsta1.
                CLEAR: l_s_icctrcsta1,
                wa_bseg1,
                l_gjahr1.
              ENDIF.
            ENDIF.
                ELSE. " IF AWORG IS NOT BLANK -
                concatenate l_s_icctrcsta1-refbn COVP-AWORG into ref_no.
                READ TABLE it_bkpf INTO wa_bkpf WITH KEY awkey(20) =
                ref_no
                awtyp = COVP-AWTYP
                gjahr = l_gjahr1.
            IF sy-subrc EQ 0.
              MOVE wa_bkpf-belnr TO l_s_icctrcsta1-zzbelnr.
              MOVE wa_bkpf-xblnr TO l_s_icctrcsta1-zzxblnr.
              MOVE wa_bkpf-bktxt TO l_s_icctrcsta1-zzbktxt.
              MODIFY c_t_data FROM l_s_icctrcsta1.
              READ TABLE it_bseg1 INTO wa_bseg1
              WITH KEY
              belnr = wa_bkpf-belnr
              bukrs = wa_bkpf-bukrs
              gjahr = wa_bkpf-gjahr.
              IF sy-subrc EQ 0.
                MOVE wa_bseg1-lifnr TO l_s_icctrcsta1-lifnr.
                MODIFY c_t_data FROM l_s_icctrcsta1.
                CLEAR: l_s_icctrcsta1,
                wa_bseg1,
                l_gjahr1.
              ENDIF.
            ENDIF.
               endif.
          endif.
            CLEAR: l_s_icctrcsta1.
            CLEAR: COVP, REF_NO.
          ENDLOOP.
        ENDIF.

    Hello Amruta,
    I was just looking at your coding:
    LOOP AT c_t_data INTO l_s_icctrcsta1.
    MOVE l_s_icctrcsta1-fiscper(4) TO l_gjahr1.
    select single AWORG AWTYP INTO CORRESPONDING FIELDS OF COVP FROM COVP
    WHERE belnr = l_s_icctrcsta1-belnr.
    if sy-subrc = 0.
    if COVP-AWORG is initial.
    concatenate l_s_icctrcsta1-refbn '%' into ref_no.
    READ TABLE it_bkpf INTO wa_bkpf WITH KEY awkey(10) =
    l_s_icctrcsta1-refbn
    awtyp = COVP-AWTYP
    gjahr = l_gjahr1.
    Here you are interested in those BKPF records that are related to the contents of c_t_data internal table.
    I guess that this table does not contain millions of entries. Am I right?
    If yes, the the first step would be to pre-select COVP entries:
    select BELNR AWORG AWTYP into lt_covp from COVP
    for all entries in c_t_data
    where belnr = c_t_data-belnr.
    sort lt_covp by belnr.
    Once having this data ready, you build an internal table for BKPF selection:
    LOOP AT c_t_data INTO l_s_icctrcsta1.
      clear ls_bkpf_sel.
      ls_bkpf_sel-awkey(10) = l_s_icctrcsta1-refbn.
      read table lt_covp with key belnr = l_s_icctrcsta1-belnr binary search.
      if sy-subrc = 0.
        ls_bkpf_sel-awtyp = lt_covp-awtyp.
      endif.
      ls_bkpf_sel-gjahr = l_s_icctrcsta1-fiscper(4).
      insert ls_bkpf_sel into table lt_bkpf_sel.
    ENDLOOP.
    Now you have all necessary info to read BKPF:
    SELECT
    belnr
    xblnr
    bktxt
    awkey
    bukrs
    gjahr
    AWTYP
    FROM bkpf
    INTO TABLE it_bkpf
    for all entries in lt_bkpf_sel
    WHERE
      awkey = lt_bkpf_sel-awkey and
      awtyp = lt_bkpf_sel-awtype and
      gjahr = lt_bkpf_sel-gjahr.
    Then you can access BSEG with the bukrs, belnr and gjahr from the selected BKPF entries. This will be fast.
    Moreover I would even try to make a join on DB level. But first try this solution.
    Regards,
      Yuri

  • BKPF x BSEG records

    Hello All,
    We must to extract an Excel file for auditing which has to have all the account documents created during last year with their values. I got all the records (34K) in BKPF table, but in BSEG it is being impossible due a dump error.
    The documents types are:
    - SA: G/L account document
    - XA: Acc. doc. only GL
    I know that BSIS, BSAS, BSIK, BSAK basically have the same information as BSEG, but as it is urgent I suppose that should be faster using BSEG.
    Question: what is the best/fast way to extract them by SE16 Transaction?
    Thanks in advance!
    Michel Khouri
    Mars, Inc - Brazil

    Hi,
    here's a very plain and simple report:
    file is transfere to appl-server
    you can ut run in background
    REPORT z12345.
    TABLES: bkpf,
            bseg.
    * structure  (Output)
    DATA: BEGIN OF datei OCCURS   0,
            gjahr LIKE bkpf-gjahr,
            bukrs LIKE bkpf-bukrs,
            belnr LIKE bkpf-belnr,
            buzei LIKE bseg-buzei,
            monat LIKE bkpf-monat,
            bldat LIKE bkpf-bldat,
            budat LIKE bkpf-budat,
            cpudt LIKE bkpf-cpudt,
            xblnr LIKE bkpf-xblnr,
            koart LIKE bseg-koart,
            konto LIKE bseg-saknr,
            mwskz LIKE bseg-mwskz,
            bschl LIKE bseg-bschl,
            shkzg LIKE bseg-shkzg,
            dmbtr(16),
            wrbtr(16),
            mwsts(16),
            wmwst(16),
            waers LIKE bkpf-waers,
            kostl LIKE bseg-kostl,
            sgtxt LIKE bseg-sgtxt,
          END OF datei.
    DATA str TYPE string.
    FIELD-SYMBOLS <f>.
    PARAMETERS file LIKE rlgrap-filename OBLIGATORY DEFAULT
    '/home/ftp/pub/test001'.
    START-OF-SELECTION.
      OPEN DATASET file FOR OUTPUT IN TEXT MODE.
    GET bkpf.
      CHECK select-options.
      MOVE-CORRESPONDING bkpf TO datei.
    GET bseg.
      CHECK select-options.
      MOVE-CORRESPONDING bseg TO datei.
      CLEAR str.
      DO.
        ASSIGN COMPONENT sy-index OF STRUCTURE datei TO <f>.
        IF sy-subrc <> 0.
          EXIT.
        ENDIF.
        CONCATENATE str <f> ';' INTO str.
      ENDDO.
      TRANSFER str TO file.
    END-OF-SELECTION.
      CLOSE DATASET file.
    kind  regards to all
    and nice weekend
    God bless
    Andreas
    Message was edited by:
            Andreas Mann
    Message was edited by:
            Andreas Mann

  • How to use BKPF and BSEG without using  inner join

    Hi,
    can anybody plz tell me the logic about how to complete the report without inner joining bkpf and bseg.Is this report can be really be made by using only bseg,bkpf ?
    *selection-criteria .
    BKPF-USNAM
    BKPF-CPUDT
    BKPF-BUDAT
    BKPF-GJAHR
    BKPF-BUKRS
    BKPF-BELNR
    BSEG-SAKNR
    BSEG-LIFNR
    BSEG-KUNNR
    BSEG-ZUONR
    BSEG-SGTXT
    Output fields required.
    BKPF-BUKRS
    BKPF-BELNR
    BKPF-GJAHR
    BKPF-MONAT
    BKPF-BLART
    BKPF-CPUDT
    BKPF-BLDAT
    BKPF-BUDAT
    BKPF-USNAM
    BKPF-XBLNR
    BKPF-STBLG
    BKPF-BKTXT
    BKPF-WAERS
    BKPF-KURSF
    BSEG-BUZEI
    BSEG-BSCHL
    BSEG-KOART
    BSEG-UMSKZ
    BSEG-SHKZG
    BSEG-MWSKZ
    BSEG-PSWBT
    BSEG-PSWSL
    BSEG-DMBTR
    BSEG-SAKNR
    BSEG-HKONT
    BSEG-KOSTL
    BSEG-KUNNR
    BSEG-VBELN
    BSEG-LIFNR
    BSEG-ANLN1
    BSEG-ANLN2
    BSEG-AUFNR
    BSEG-MATNR
    BSEG-MENGE
    BSEG-MEINS
    BSEG-ZUONR
    BSEG-SGTXT
    Thanks,
    Rahman
    Moderator Message: Please search before posting your question. Thread locked.
    Edited by: Suhas Saha on Jan 31, 2012 3:07 PM

    Quick question - what's preventing your from using built-in functions?
    I suggest mapping your Time Dim to a standard Time Dim and work with it - you'll save a lot more time. You'd even need this table if you wanted to work around Todate/AGO.
    It is possible to model this functionality w/o functions, but it'll be time consuming task, similar to using Time Series Wizard in Siebel Analytics. You'll need to build aliases and views along with some complex joins (such as TIME.KEY=TIME.KEY-365), introduce a bunch of variables to control. Also, you might not get much flexibility in terms of years. For each year, you'd need an alias table. (TIME_DIM_PY).

  • How to populate invoice reference field (bseg-rebzg) in accounting document

    Hi,
    I am working on a scenario in which first a billing document and its corresponding accounting document (say A) is generated.
    Then if there ia any correction, we create a credit memo request. From this credit memo request we create a credit note.
    After saving this credit note another accounting document (say B) is created. This new accounting document has "Invoice ref." field blank (BSEG-REBZG). However, I want to display first accouting document's number (i.e. A) in "Invoice ref." field.
    I tried to change the reference number field in user exits (called during credit note creation) but it didn't help and accounting document didn't get created.
    Can anyone please suggest how this can be done?
    Thanks in Advance!!
    Kind Regards,
    Priyanka.

    Hi,
    I really doubt that the number of invoice document get stored here. This is only filling up with "V" in our system for the credit memo accounting document referencing to an invoice document created with reference to billing document.
    Please read the help on this filed.
    In the standard system the field is used for:
    Credit memos which refer to a particular invoice item
    Subsequent invoices for an invoice item
    Partial payments for an invoice item
    Partial clearings of down payments.
    In the first two cases mentioned, the terms of payment are copied from the cross-referenced invoice item into the item currently being processed. This ensures that items due on the same date are paid together by automatic payment.
    A special rule applies to credit memos which have a "V" in this field. The due date is determined in the same way as for an invoice. If the field is empty (containing neither a document number nor a "V") the due date is the baseline date for payment.
    Regards,
    Ravi

  • Update Credit Note Invoice Ref. (BSEG-REBZG) with original billing document

    Hello Experts,
    I would like to update the field Invoice Reference (BSEG-REBZG) on my credit note with the original SD billing document number.
    The business process is:
    1. We create a Credit Memo Request with reference to the SD order number through transaction code VA01. (I also tried to create it with reference directly to the billing document)
    2. We create a Credit Memo with reference to Credit memo request through transaction VF01 and the accounting document is created accordingly.
    I have tried several combinations in the setup of the Copy Control (VTFA and VTFF) without success.
    Please let me know how to solve the issue.
    Best regards
    Birgit

    Hi,
    Had you created the credit memo with reference to billing document you could have maintained copy controls in VTFF under Header Reference number.
    In case you dont have return delivery for your returns, why dont you create a credit memo using the invoice itself.
    In your case you will have to do this with the help of an enhancement.
    Check user exit RV60AFZC for this and take the help of your ABAPer on the same.
    Regards,
    Amit

  • How set the FI Document's Invoice ref.(BSEG-REBZG) to 'V' when SD billing.

    How can automatic set the FI Document's Invoice ref.(BSEG-REBZG) to 'V' when I do a SD billing.(VF01 credit memo)
    How can automatic set the FI Document's Invoice ref.(BSEG-REBZG) to 'V' when I do a MM billing.(Miro  credit memo)
    How can automatic set the FI Document's Invoice ref.(BSEG-REBZG) to 'V' when I do a FI billing.(FB65,FB75)
    Thank you very much.

    Hi,
    This has something to do with the payment terms of the invoice. When credit memos are created with reference to an invoice, there is a pattern of behaviour on how the field is updated. Similarly when the same is created without reference, the behaviour of this field is dfiferent.
    Look at the note 17410, it explains when is the field updated with V.
    As per this, when a credit memo is created with reference to an invoice, the invoice number is updated in this field and the payment term of the invoice will become the payment term of the credit memo also
    When CM. is created without invoice reference, it is updated with teh value V along with the payment terms in BSEG. In this case the credit memo is always due on the baseline date.

  • ABC COPA, how to derive charateristic value from BKPF-XBLNR

    Hello,
    As we only use FI-CO modules in our SAP solution, I am implementing the ABC COPA
    I have created one characteristic (user defined, with reference to existing field - data element XBLNR1)
    When I post my invoice I want to pass the value in the BKPF-XBLNR to my characteristic.
    I used the" table lookup" to get my value for this characteristic (the only one which allows getting values from non COPA tables)
    SAP automatically suggests company code, document number and fiscal year as source fields for lookup.
    Then I assign BKPF-XBLNR to my characteristic.
    In OKB9 I have also checked the indicator "Find profitability segment using substitution" for the GL account I use for my test.
    When I enter my customer invoice in FB01, I press the "segment" button, but my characteristic is empty (unlike the profit centre characteristic which is taken over from my entry screen)
    When I execute "analyse derivation", the document number has no content (Source field contain no value) which is normal as the accounting document is not yet posted...
    I tried to post my invoice using document type with external numbering, but it doesn't work neither.
    When I save the document it automatically creates a segment with empty values.
    So how can I pass the characteristic values from the accounting document fields?
    In this example from BKPF-XBLNR?

    Hi Dawid,
    First think I would recommend you is not to attempt this step at all. Once you create FI document as a chaechteristic it will spoil the performance of your CE4 table totally. So we do not recommend to do this. The second thing is it is technically not possible to derive FI document number from SD invoice as these are two completely different tables and there are no link between them at all.
    Regards,
    Abhisek

  • Validate duplicated BKPF - XBLNR

    Does anybody knows if there is any standard functionality in order to validate if a document already exist in the system with the same BKPF - XBLNR ? (Duplicated invoices).
    I need to check that for <b><u>customer </u></b> invoices. I know that there is this functionality for vendors.
    Thanks in advance
    Rafa

    Hi,
    Good morning and greetings,
    The standard SAP Process is as below for Sales & Distribution
    Create a Sale Order (VA01)
    Create an Outbound Delivery (VL01N)
        The system would be using Movement Type 601 (Using OBYC Customization)
        The system would pass the following accounting entry and creates a delivery
              Dr. Cost of Sales
              Cr. Inventory
    Create an Invoice (VF01)
       The system will ask for the Delivery document number
       Providing the Delivery document number that was created in the above step
       The system will pass the following accounting entry (using VKOA Customizn.)
       Dr. Customer (picked up from Sales Order)
       Cr. Sales (picked up from VKOA Customization)
       Cr. Sales Tax (picked up through FTXP)
    If you provide the delivery document again, the system will not bill the customer again and that is the standard check.
    Please reward points if found useful
    Thanking you
    With kindest regards
    Ramesh Padmanabhan

  • How set the FI Document's Invoice ref.(BSEG-REBZG) to 'V'  automatic.

    How can automatic set the FI Document's Invoice ref.(BSEG-REBZG) to 'V' when I do a SD billing.(VF01 credit memo)
    How can automatic set the FI Document's Invoice ref.(BSEG-REBZG) to 'V' when I do a MM billing.(Miro credit memo)
    How can automatic set the FI Document's Invoice ref.(BSEG-REBZG) to 'V' when I do a FI billing.(FB65,FB75)
    Thank you very much.
    Can I customize in sap but exit?

    Hi,
    For general clarification, please refer:-
    https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=17410
    You can use userExit EXIT_SAPLV60B_002 which is part of Enhancement SDVFX002 (Transaction SMOD):-
    https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=301077
    Regards,
    Gaurav

  • Mass Update for the invoice reference (BSEG-REBZG)

    Dear All ,
    I need mass update for the invoice reference (BSEG-REBZG) . Is there any way to update it ?
    Best Regards
    Dash

    HI,
    Contact your ABAPer to Write BDC to update the Invoice reference.

  • User exit -  Default 'V' within field BSEG-REBZG - fb01 and more

    Hi experts,
    I need to get the user exit so i can fill in the field BSEG-REBZG as default 'V' (picture from [User Exit in fb01|http://imageshack.us/photo/my-images/442/userexitfb01.png/])
    Can anyone help me out how to do this? I've read previous threads and i did the same but i still doesn't get the V in that field as you can see in the picture above.
    [Default Setting for BSEG-REBZG field in all Sales Orders|Default Setting for BSEG-REBZG field in all Sales Orders]
    Regards,
    Michael
    << Moderator message - Please do not promise points >>
    Edited by: Rob Burbank on Dec 14, 2011 9:33 AM

    i tried substitution but it doesn't seem like you can substitute that field  BSEG-REBZG.
    So how can you resolve this?
    I seem any topics about this but not really a good result....
    anyone please help?

  • How to create view on bkpf and bseg?

    friends,
      can we create views on bkpf and bseg if yes wht are the steps...please note it down n send me..regards essam ([email protected])

    Hi,
    Use standard views...
    View name                      Short text
    BKPF_AEDAT                     BW FI: BKPF Extraction Using AEDAT
    BKPF_BSAD                      BW FI: BSAD Extraction Using CPUDT
    BKPF_BSAD_AEDAT                BW FI: BSAD Extraction using AEDAT
    BKPF_BSAK                      BW FI: BSAK Extraction Using CPUDT
    BKPF_BSAK_AEDAT                BW FI: BSAK Extraction using AEDAT
    BKPF_BSID                      BW FI: BSID Extraction Using CPUDT
    BKPF_BSID_AEDAT                BW FI: BSID Extraction using AEDAT
    BKPF_BSIK                      BW FI: BSIK Extraction Using CPUDT
    BKPF_BSIK_AEDAT                BW FI: BSIK Extraction using AEDAT
    CRMV_BKPF_BEBD                 FI Documents Relevant for Feedback to CRM
    V_EWU_BKPF                     Update View for Parallel Processing on BKPF
    V_VBSEGK
    V_VBSEGS
    Regards,
    Omkar.

  • How to join anla anlc bkpf and bseg in sap

    any can u tel me how to join the anla anlc bkpf and bseg tables in sap.if any body having asset report send me plz

    Moderator message - Welcome to SCN
    But please search for answers here before posting and do not ask the forum to do your work for you.
    Thread locked.
    Please read [Rules of Engagement|https://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement], How to post code in SCN, and some things NOT to do... and [Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers] before posting again.
    Rob

  • How to join BKPF and BSEG

    Hi Experts,
    how to join BKPF and BSEG
    Thanks
    nagini

    Hi,
    BKPF is Transparent table but BSEG is cluster table.  We can't create views by joining cluster tables.
    hope it helps...
    regards,
    Raju

Maybe you are looking for