2006 Nov 16 3:32 AM
Hi,
i have to access bseg withoout using belnr primary key,
i have to access all the record of bseg using vbel2 or zuonr field..
since i am not using belnr it is taking time to retrieve the data and fill the internal table.
can anyone help me how to improve the performance and also if anyone can help me of how to do with <b>field symbols</b>
2006 Nov 16 3:37 AM
accessing bseg in this way will be very slow, there is no way round it. Do you have to read bseg? Depending on what it is you are trying read maybe there is another table...for example bsid or bsad for cleared or open items is one possibility and there are other BS* tables that might suit you.
2006 Nov 16 3:37 AM
accessing bseg in this way will be very slow, there is no way round it. Do you have to read bseg? Depending on what it is you are trying read maybe there is another table...for example bsid or bsad for cleared or open items is one possibility and there are other BS* tables that might suit you.
2006 Nov 16 3:40 AM
I don't think field symbols will help much. Try to work out a way to use the index. Where do you get vbel2 and zuonr?
Rob
2006 Nov 16 3:41 AM
Hi,
Besg is the most busiest table in the SAP and moreover it is a cluster table so we cant even go for the secondary indexes.
Even if u want to access it. U go for other tables which are in contact with the same data of BSeg such as BSIK, BSAK, BSIS, BSAS,BSIS,BSAS.
This might help u..
Cheers,
SImha.
Reward if helpful...
2006 Nov 16 3:53 AM
I know its the busiest table and it is very slow....
i am getting the sales order from user as input and checking it with vbak and vbap and passing the same to get amounts in bseg...
otherwise i am getting belnr from bkpf to pass it to bseg...but the belnr that is related to sales order is not fully coming...
2006 Nov 16 3:58 AM
OK - you can use the sales document flow to help you out here. Which FI document(s) do you need? Those related to invoices?
(Not GR/IR.)
Rob
Message was edited by:
Rob Burbank
2006 Nov 16 4:20 AM
you should be able to use table vbfa to find links to accounting documents from sales orders.
2006 Nov 16 5:31 AM
Hello Mohammed,
If you are getting Sales order number form the user then I would suggest u don't access BSEG directly but go through VBFA table which is nothing but sales document flow. In this use the document category VBTYP_N and select the releavant documents. Then u will get full key to acess BSEG for any further information.
2006 Nov 17 7:04 PM
One NOTE - doc flow may not be updated from sales order up to accounting, so you may need to select docs step-by-step (depending on the level of doc.flow updates),
like - select all deliveries for your order, then select invoices base don delivery, then accounting. OR if you have order-related billing you can go by order-> invoice-> accounting.
If in your system you have all documents (full chain) in VBFA for sales order - then you a lucky 🐵 and 1 select will do the job.
One more thing - in our case accounting doc number = invoice doc number., so if you know invoices from VBFA - you can use these numbers to select from BSEG.
2006 Nov 21 11:41 PM
I would like to add one little point to Siarhei's answer.
Please refer to this link:
and I think this could be a solution if you find the Billing Doc from sales order doc.
You can join them as bkpf-awtyp = 'VBRK'
bkpf-awkey = .... " this will be your billing doc ( vbrk-vbeln )
and you can get Belnr for Bseg then
hope this helps.