BSEG Table
Hi,
I have an existing code that says
select bukrs belnr gjahr buzei augdt shkzg dmbtr kokrs kostl aufnr
hkont werks prctr projk fkber
from bseg
into table t_bseg
for all entries in t_jrnl_chg_ptr
where bukrs = t_jrnl_chg_ptr-bukrs
and belnr = t_jrnl_chg_ptr-belnr
and gjahr = t_jrnl_chg_ptr-gjahr
and buzei = t_jrnl_chg_ptr-buzei
and vorgn <> c_recur_doc.
In this, sometimes FKBER might be empty, in that case the functional consultant asked me to take fkber_long whenver fkber is empty.
Since it is BSEG table, I need some tips on performance based how to further check and achieve fkber_long instead of FKBER.
Hi Kris,
U have an existing code that says
select bukrs belnr gjahr buzei augdt shkzg dmbtr kokrs kostl aufnr
hkont werks prctr projk fkber
from bseg
into table t_bseg
for all entries in t_jrnl_chg_ptr
where bukrs = t_jrnl_chg_ptr-bukrs
and belnr = t_jrnl_chg_ptr-belnr
and gjahr = t_jrnl_chg_ptr-gjahr
and buzei = t_jrnl_chg_ptr-buzei
and vorgn c_recur_doc.
in the internal table decleration declare FKBER as type FKBER_LONG as it is of 16 charecters.
now write the following select queries:
select bukrs belnr gjahr buzei augdt shkzg dmbtr kokrs kostl aufnr
hkont werks prctr projk fkber
from bseg
into table t_bseg
for all entries in t_jrnl_chg_ptr
where bukrs = t_jrnl_chg_ptr-bukrs
and belnr = t_jrnl_chg_ptr-belnr
and gjahr = t_jrnl_chg_ptr-gjahr
and buzei = t_jrnl_chg_ptr-buzei
and vorgn c_recur_doc
and fkber ne space.
select bukrs belnr gjahr buzei augdt shkzg dmbtr kokrs kostl aufnr
hkont werks prctr projk fkber
from bseg
appending table t_bseg
for all entries in t_jrnl_chg_ptr
where bukrs = t_jrnl_chg_ptr-bukrs
and belnr = t_jrnl_chg_ptr-belnr
and gjahr = t_jrnl_chg_ptr-gjahr
and buzei = t_jrnl_chg_ptr-buzei
and vorgn c_recur_doc
and fkber eq space
and fkber_long ne space.
The above coding might solve u'r problem.
Regards,
Thabitha.
Similar Messages
-
F110 - Grouping the vendor invoices by BSEG table fields
Hi,
I want to group the vendor invoices while making the payment through F110, based on a BSEG table field. The settings in Grouping Key configuration (OBAP) only allows me to choose the fileds from BSIK table and not possible to select the fields from BSEG table. Is there any other way to group the vendor invoices based on BSEG fileds? How can we achieve this requirement in SAP?
Thanks and Regards
Koteswararao padartiHi,
I created the substitution and also grouping key based on the BSIK-KIDNO filed. But the system is not able to group the vendor invoices by payment reference. I already tried the following options
Seperate Payments for each Ref in FBZP settings
Can anyone let me know what is missing in the configuration to group the invoices for payment by payment reference.
Regards
Koteswararao Padarti -
XREF3 field not getting populated in BSEG table while posting MIRO
Hi,
I have one query in MIRO tcode.I have activated xref3 field in MIRO tcode using enhancement LMR1MF6Q.Now when i try to post document with some values in xref3 field on screen ,value is not getting populated in BSEG table.Please tell me what else needs to be done to achieve this ?
any hint on this?
Thanks & Regards,
Soniya S.Hi,
1.- According to SAP Note 904652 - MIRO: Different from FB60
https://service.sap.com/sap/support/notes/904652
MIRO is an independent Materials Management (MM) transaction that does not
claim to be the same as the accounting transactions (such as FB60 or FB01).
MIRO was developed to allow users to process vendor invoices within the
context of the MM procurement processes as simply as possible.
For this reason, among other differences, the field selection was limited
to the absolutely necessary. For example, the following fields from the
accounting document are not available in Transaction MIRO (this list is not
complete):
Reference key (BSEG-XREF1, -XREF 2, -XREF 3)
2.- SAP Note 1156325 - BAdIs in the Logistics Invoice Verification environment
https://service.sap.com/sap/support/notes/1156325
Have a look at badi MRM_ITEM_CUSTFIELDS.
This badi will create a new tab at item level in order to display the new fields.
I haven´t used this badi so i cannot talk from experience here.
Think twice before deciding.
Best regards. -
Error while activating the BSEG table
hi guys ,
today i joined SAP SCN . I have this error
First i appended a structure of 5 fields in BSEG table .Then i tried to delete this append structure.
But while deletiing it took nearly 20-25 minutes to process and timed out.So the structure is deleted
from BSEG table but those 5 fields are still present in view V_QCMBSEG .Because of this BSEG table
is now partially active .what should i do other than access key .Dear Deepak,
welcome to SCN.
How did you append structure in BSEG without access key, if you had appended you must have done it will access key as it is a standard table.
secondly, the time out error is because BSEG is a cluster table, and the data volume in Bseg is very large as all the accounting document from various module is stored in this table, hence while deleting it system will check each line item wise before activating the table.
Now the workaround is to check with your basis team to increase the memory index so that time out dump is eradicted and BSG becomes Active.
Best practice: Don't append structure to standard table unless it is very crucial. if you are doing it for some report, kindly do a table join ( BSEG cannot be used as it is a cluster), you will get the same data in various secondary index table, by doing this the performance of the report will be better.
Regards,
M S Lokesh -
Error while appending structure into BSEG Table
We had appended BSEG table with a ZSTRUCTURE to enable Custom field in MIRO. Subsequently there was a change required in the appended field. After Changing the field there was adjustment required to activate the appended table . However due to slow system performance during that time the Adjustment SE14 timed out. And created inconsistency in BSEG table.
If I Do the Table adjustment now it is showing below error.
We tried to delete the append structure also but the structure is not appearing in the append structure list to delete.
Even if we try deleting the Z structure from se11 it is throwing below error.
Any one could help me out to resolve this..hi Ramesh,
Please First Check if the Database version and disctionary version are in sync.
Also, it could be the case that you would have enhanced an already existing Append stucture. which might be being used in other BKPF dependent tables.
Please check -
PO Line Item Number not filled in BSEG Table
HI,
While posting to goods receipt through MIGO FI documents are generated.
For these FI documents , in BSEG table the corresponding PO line item numbers (EBELP )are not getting filled up,
How can they be filled. can it be done through any standard configuration?Hi,
Check if you are doing the summarization of FI doc. You can check reading these notes:
SAP Note 36353 - AC interface: Summarizing FI documents
SAP Note 77161 - Summarization of FI postings w.ref.to purchase orders
I hope this helps you
Regards
Eduardo -
FBL5N t code and BSEG table is showing wrong contract number
Hi,
The proces flow is contract number>sales order>DMR-->Invoice
Now when I am checking the VBFA table it's showing correct contract number against invoices but FBL5N t code and BSEG table are showing wrong contract numbers.
Why FBL5N and BSEG table is showing wrong contract number?
Currently we are using one enhancement and user exit is used to incorporate one customized field as identifier for bill type.
1. During the billing document release to accounting VFX3, The user exit triggering and it is update the customized fields and Net settlement indicator.
2. Using the Invoice number, get the fields VGBEL(Document number of the reference document) and VGPOS (Item number of the reference item) from VBRP and read table VBAP with VBELN and POSNR, to get DMR number (Sales Document) that created for the Invoice.
3. Use fields VGBEL and VGPOS on table VBAP to get the sale order number.
4. By using the Sales order number, get the Distribution channel to update Net indicator field
In accounting table BSEG-UZAWE = JF must be updated on the customer line.
5. Retrieve the sale order number and item level to get customized field from table VBAP
Any pointers.
Thanks
AshuHi Reazuddin,
Thanks for your reply,
I am concercerned about BSEG table and using user exit EXIT_SAPLV60B_008 to post the document in FI.
Now in we have enhanced this user exit for contracts and included in this way.
SELECT SINGLE ZZ_CONTRACT FROM VBAK INTO (LC_CONTRACT) WHERE VBELN EQ cvbrp-vgbel.
Endloop.
*Moving the values to final accounting table
loop at xaccit.
xaccit-vertn = lc_contract.
xaccit-VBEL2 = xaccit-AUBEL.
xaccit-xref3 = lc_vbel2.
MODIFY xaccit .
ENDLOOP.
Clear: lc_contract,lc_vgbel,lc_vgpos,lc_vbel2.
But I am getting correct data when checked other clients( development and quality), this problem I am getting in production.
Do I need to ask the ABAP'er to debug this enhancement in production?
Thanks
Ashutosh -
Hi,
I have used smartforms for generating suppler payment statement for financial department. more time duration is taken by the program when it is generating.
I think this problem comes while data fetching from BSEG table. because, it has more records for one vendor ID.
I want reduce this time duration.
Please guide me.Have you tried this selection in se16? I'm quite sure that It will take
a long time.
The problem has been explained in this group before and I think you
should search for bseg in the answers given.
As a hint: It has to do with the selection universe. You are restricting
only bukrs from the primary key (all the other restrictions in your
where clause are filters that are applied on SAP's side (not on the
database side)). The problem is that bseg isn't stored as separated
fields in the RDBMS, but as a table with the primary key and a stream of
bits in a raw field.
You should review and change the logic you're using before reading bseg.
It's the only way you'll improve the performance of this select. (for
example, you could use one or more secondary index tables - bi or ba
to retrieve belnr and access bseg with a better where clause). -
Hi,
How to update PERNR Field BSEG Table?
My scenario is to update the (Personnel Number ) PERNR Field in FB50 Transaction.
I get the following fields details from a third party system
Document Information
o I_BUKRS (Company Code) u2013 example: 0010
o I_BELNR (Document Number) u2013 example: 1700006041
o I_GJAHR (Fiscal Year) u2013 example: 2008
u2022 Final Approver ID
o I_PERNR (Personnel No.) u2013 example U0050049
For all line items of the document (represented by the key (I_BUKRS, I_BELNR, I_GJAHR)) need to update the BSEG-PERNR field in FB50.
Please let me know if you have any ideas like BAPI's or any alternative.
Thanks & Regards,
SatyaHi
Try to use below the FM's
FMUDBSEGH_UPDATE
FMUDBSEG_UPDATE
G_BKPF_BSEG_UPDATE
before to that you need to read data from FM READ_BSEG. then update.
hope it helps you
Thanks!
Edited by: Prasanth Maddela on Apr 21, 2009 6:26 PM -
Hi,
Below is my code, it taking much time to get the data from BSEG table and even after executing for long time it not populating the data into internal table. If i pass single account in selection screen, it is displaying the data.
Please help me out.
SELECT hkont lkorr FROM t030hb INTO CORRESPONDING FIELDS OF
TABLE gt_tr_t030hb
WHERE ktopl = 'ZCOA'
AND bwber = 'TR'
and hkont in so_hkont.
IF gp_pprct IS INITIAL.
loop at gt_tr_t030hb.
SELECT hkont prctr bewar dmbe2 FROM bseg INTO CORRESPONDING
FIELDS OF table gt_hkont for all entries
in gt_tr_t030hb
WHERE bukrs IN so_bukrs
AND prctr IN so_prctr
AND saknr = gt_tr_t030hb-hkont
AND vbund IN so_vbund
and gjahr in so_gjahr
and xauto = 'X'.
Thanks,
Pavan.
Message was edited by: Pavan PanduruHi
Try to select the items from BSIS/BSAS:
- One solution can be:
TABLES: BSIS.
DATA: GT_TR_T030HB LIKE STANDARD TABLE OF T030HB.
SELECT-OPTIONS: SO_BUKRS FOR BSIS-BUKRS,
SO_HKONT FOR BSIS-HKONT,
SO_GJAHR FOR BSIS-GJAHR,
SO_PRCTR FOR BSIS-PRCTR,
SO_VBUND FOR BSIS-VBUND.
DATA: BEGIN OF GT_HKONT OCCURS 0,
BUKRS LIKE BSIS-BUKRS,
HKONT LIKE BSIS-HKONT,
GJAHR LIKE BSIS-GJAHR,
BELNR LIKE BSIS-BELNR,
BUZEI LIKE BSIS-BUZEI,
PRCTR LIKE BSIS-PRCTR,
BEWAR LIKE BSIS-BEWAR,
DMBE2 LIKE BSIS-DMBE2,
END OF GT_HKONT.
DATA: XAUTO.
SELECT * FROM T030HB INTO TABLE GT_TR_T030HB
WHERE HKONT IN SO_HKONT
Open Items (BSIS)
SELECT BUKRS HKONT GJAHR BELNR BUZEI
PRCTR BEWAR DMBE2
FROM BSIS INTO TABLE GT_HKONT
FOR ALL ENTRIES IN GT_TR_T030HB
WHERE BUKRS IN SO_BUKRS
AND HKONT = GT_TR_T030HB-HKONT
AND GJAHR IN SO_GJAHR
AND PRCTR IN SO_PRCTR
AND VBUND IN SO_VBUND.
Cleared items
SELECT BUKRS HKONT GJAHR BELNR BUZEI
PRCTR BEWAR DMBE2
FROM BSAS APPENDING TABLE GT_HKONT
FOR ALL ENTRIES IN GT_TR_T030HB
WHERE BUKRS IN SO_BUKRS
AND HKONT = GT_TR_T030HB-HKONT
AND GJAHR IN SO_GJAHR
AND PRCTR IN SO_PRCTR
AND VBUND IN SO_VBUND.
If you need to check if the item is automatically loaded:
LOOP AT GT_HKONT.
SELECT SINGLE XAUTO FROM BSEG INTO XAUTO
WHERE BUKRS = GT_HKONT-BUKRS
AND BELNR = GT_HKONT-BELNR
AND GJAHR = GT_HKONT-GJAHR
AND BUZEI = GT_HKONT-BUZEI.
IF XAUTO = SPACE.
DELETE GT_HKONT.
ENDIF.
ENDLOOP.
Other solution can be
TABLES: BSIS.
DATA: GT_TR_T030HB LIKE STANDARD TABLE OF T030HB.
SELECT-OPTIONS: SO_BUKRS FOR BSIS-BUKRS,
SO_HKONT FOR BSIS-HKONT,
SO_GJAHR FOR BSIS-GJAHR,
SO_PRCTR FOR BSIS-PRCTR,
SO_VBUND FOR BSIS-VBUND.
DATA: BEGIN OF T_DOCUMENT OCCURS 0,
BUKRS LIKE BSIS-BUKRS,
GJAHR LIKE BSIS-GJAHR,
BELNR LIKE BSIS-BELNR,
BUZEI LIKE BSIS-BUZEI,
END OF T_DOCUMENT.
DATA: BEGIN OF GT_HKONT OCCURS 0,
HKONT LIKE BSIS-HKONT,
PRCTR LIKE BSIS-PRCTR,
BEWAR LIKE BSIS-BEWAR,
DMBE2 LIKE BSIS-DMBE2,
END OF GT_HKONT.
DATA: XAUTO.
Open Items (BSIS)
SELECT BUKRS GJAHR BELNR BUZEI
FROM BSIS INTO TABLE T_DOCUMENT
FOR ALL ENTRIES IN GT_TR_T030HB
WHERE BUKRS IN SO_BUKRS
AND HKONT = GT_TR_T030HB-HKONT
AND GJAHR IN SO_GJAHR
AND PRCTR IN SO_PRCTR
AND VBUND IN SO_VBUND.
Cleared items
SELECT BUKRS GJAHR BELNR BUZEI
FROM BSAS INTO TABLE T_DOCUMENT
FOR ALL ENTRIES IN GT_TR_T030HB
WHERE BUKRS IN SO_BUKRS
AND HKONT = GT_TR_T030HB-HKONT
AND GJAHR IN SO_GJAHR
AND PRCTR IN SO_PRCTR
AND VBUND IN SO_VBUND.
Auto items
SELECT HKONT PRCTR BEWAR DMBE2
FROM BSEG INTO TABLE GT_HKONT
FOR ALL ENTRIES IN T_DOCUMENT
WHERE BUKRS = T_DOCUMENT-BUKRS
AND BELNR = T_DOCUMENT-BELNR
AND GJAHR = T_DOCUMENT-GJAHR
AND BUZEI = T_DOCUMENT-BUZEI
AND XAUTO = 'X'.
Try
Max -
Hi
Friends
we have around 50 millions records in the Bseg table.
i need to down load only 5 fields .
one our friend suggested using ABAP code we can down load.
But i would like to know from you is there any Transcation code to down load only 4 or 5 fields from bseg fro all the company codes since we have around 50 million Records inthe table.
Thanks in advance.Hi Ravindra,
Good afternoon and greetings,
In SE16 itself you can down only the selected field by choosing the User Parameters...Alternatively, you can create a query using SQVI and select only those fields for displaying and downloading.
If you require any assistance on SQVI, please let me know.
Points awarded is highly appreciated, if the above mentioned solution meets your requirement.
Thanking you
With kindest regards
Ramesh Padmanabhan
Consultant -
ST05 Trace on a select query on BSEG table
hi all,
this is my select query on table BSEG table:
SELECT bukrs
belnr
gjahr
buzei
KOART
mwskz
kostl
lifnr
aufnr
werks
ebeln
txjcd
projk FROM bseg
INTO TABLE i_bseg
FOR ALL ENTRIES IN i_ad_tab
WHERE bukrs EQ i_ad_tab-bukrs AND
belnr EQ i_ad_tab-belnr AND
gjahr EQ i_ad_tab-gjahr.
when i m doing SQL trace ST05 on this query and in the detail statement showed the following query
SELECT
"MANDT" , "BUKRS" , "BELNR" , "GJAHR" , "PAGENO" , "TIMESTMP" ,
"PAGELG" , "VARDATA"
FROM
"RFBLG"
WHERE
"MANDT" = ? AND "BUKRS" = ? AND "BELNR" = ? AND "GJAHR" = ?
ORDER BY
"MANDT" , "BUKRS" , "BELNR" , "GJAHR" , "PAGENO"
what is RFBLG table in SE11, but could not find it.
what is RFBLG?also, the above select query giving me performance issues.. the "for all entries" clause is used as per norms...
please suggest a solution..hi
good
The famous BSEG table is a cluster table.
It is as was correctly stated part of the Accounting Document Segment. It is part of the Pool cluster RFBLG and lives in the package: FBAS (Financial accounting 'Basis').
You can't read a cluster table exactly the way you read a database (old speak, transparent table).
You can use a program to read called RFPPWF05
Note 435694: Display BSEG item by calling FB09D (modified FB09)
Other possiblity: Other possibility: CALL DIALOG 'RF_ZEILEN_ANZEIGE', but since this is a dialog I don't think this would work.
In any event go to FBAS Package (development class) to see your business objects, class library and functions.
you must use keyfields bukrs , belnr, gjahr
(so 1st select table bkpf) to select bseg.
or use secondary index tables:
bsas, bsis, bsik, bsak, bsid, bsad
Regards,
Raj. -
How to improve performance by pulling data instead of BSEG table?
Hi,
We are facing issue in which we have to pull material no for some non copa postings.
But if we use BSEG table then serious performance issues are coming up..
so are there any other tables / combination of tables that we can look for instead of BSEG?Hi,
BSEG is Cluster table, you can only select with key fields.
if you have a select:
select belnr budat wrbtr from bseg
into table it_bseg
where bukrs = bukrs
and belnr = belnr
and gjahr = gjahr
and bschl = 31.
it's much better to select of this way:
select belnr budat wrbtr from bseg
into table it_bseg
where bukrs = bukrs
and belnr = belnr
and gjahr = gjahr.
delete it_bseg where bschl ne '31'.
Regards,
Fernando -
Hi Experts,
Users raising bill using MIRO it takes more time when i check throuh SM50 and st03 i found that the data fectching from the table BSEG takes more time kinldy let me know whether i need to increase table parameter.....size if so how can i do that ?
Regards...
VenkiThe famous BSEG table is a cluster table.
It holds the Accounting Document Segment. It is part of the Pool cluster RFBLG and lives in the package: FBAS (Financial accounting 'Basis').
You can't read a cluster table exactly the way you read a database (old speak, transparent table).
You can use a program to read called RFPPWF05
Note 435694: Display BSEG item by calling FB09D (modified FB09)
Other possiblity: Other possibility: CALL DIALOG 'RF_ZEILEN_ANZEIGE', but since this is a dialog I don't think this would work.
In any event go to FBAS Package (development class) to see your business objects, class library and functions.
Having such criticality, you set to tablepsace to 'autogrow'
Regards
Sekhar -
How to delete a record from BSEG table
Dear Experts,
How to delete a record from BSEG table.
If there possible to delete some records from transparent table ?
Please help.
Regards,
TanHi,
Deleting a record from a standard table can be done only if table maintenance exists - Cehck tcode - SM30. But it is not advisable to delete records, coz the records may be dependent on many other tables. If u delete in a single place, there may be chance that inconsistency in the data happens and hence will affect ur financial statements.
Pls. assign points, if useful
Regards,
Sridevi -
An FI consultant has informed us that he believes our BSEG table (a cluster table) is larger than it should be. We have been live with SAP for about 6 months and have about 10 million rows in BSEG (most of those in BSIS).
I'm not too concerned about it, we're runnining DB2 9 and have compression turned on for BSIS, but nevertheless, I was wanting to check with some other sources and see what a "normal" size for BSEG and/or BSIS is.
Can anyone tell me what size this table is on their system?
Thank you,
BrentHi Brent,
a normal size does not existis. BSEG contains one row per position (segment) of an accounting document. If you have 10.000 documents (BKPF contains the header informations) with 100 postions, you have 1.000.000 rows in BSEG. All depends on your bussiness. If you have 10.000.000 rows after 6 month, you probably should think about an archiving solution, because you will run into performance problems sooner or later.
You probably have no problem yet and wont have a problem within the next two-three years. But an archiving project took time. Our system runs with more than 80.000.000 rows without a problem with archiving active.
Best regards
Ralph Ganszky
Maybe you are looking for
-
My mac pro won't sleep on its own or when I try to put it to sleep.
Hello all, I have a 2007 Mac Pro and for some reason, it won't go to sleep. Normally if it was idle for an hour or two, it would automatically sleep but not anymore. If I put it to sleep manually, it wakes right back up. I have to shut it down so
-
Is there a way to either run a "Score" thing in Keynote, or a text box that can be typed in during the presentation?
-
Editing Text in Dreamweaver Display View
I have just started using Dreamweaver CS4. In older versions of Dreamweaver, I'm used to seeing text in Display view and being able to edit the text directly in Display view, rather than having to edit text in Code view. But when I'm trying to edit t
-
Exception in FLASH.OCX using Windows 8.1, latest Flash Version
I have many problems using the latest Flash Version 13.0.0.182. My applications use an embedded version of IExplorer 11 and use OSMF to display P2P Streams. If buffering starts, an exception is thrown and my app crashes with the message "Exception 00
-
I am getting the strangest error. I was wondering if anyone has seen this. Environment: Source server is NW 65 SP8 with eDirectory 8.8.4. Target server is Sles 10SP3 OES2 PS2 eDir 8.8.5. Installation of OES was done during the install of SLES not as