05-30-2007 7:01 AM
Hello everybody.
can anyone help me in finding relationship between VBRK and BSEG. I want to find out BSEG-BELNR using VBRK-VBELN.
please note: VBRK-VBELN = BSEG-VBELN works but takes too much time.
is there any other way or table which can relate these two tables.
Txs in advance.
05-31-2007 5:25 AM
05-30-2007 7:31 AM
05-30-2007 7:56 AM
You mean search should be BUKRS + GJAHR + VBELN in BSEG.
if so, but since BSEG does not have any index on VBELN , it uses a
sequential index and hence it takes too much time to locate on desired record.
05-30-2007 7:41 AM
Hi,
Could you please specify the fields which you are looking for from BSEG?
Regards,
Bharati
05-30-2007 7:50 AM
05-30-2007 8:08 AM
Hi,
The best solution would be fetch all the entries from BKPF for the given company code, fiscal year.
Then select entries from BSEG for the given set of billing documents and relevant accounting documents fetched from BKPF. Eliminate the ones which are not relevant.
Hope this helps.
05-30-2007 8:32 AM
Txs for your response.
i want the search should be done from VBRK/VBRP(invoice) to BSEG/BKPF (billing).
we have a report in smartforms for Credit/Debit note (invoice).
user demanded for Billing detail (BELNR) also. but by searching in
BSEG using VBRK-VBELN = BSEG-VBELN it takes
too much time to hunt down the desired record because no index is maintained
on this field in BSEG, it uses a sequential index.
05-30-2007 8:26 AM
Hi
There is no need of querying on BSEG.
Use the function module RV_ORDER_FLOW_INFORMATION.
This will list the function module name. If your requirement is for a single document then this approach will work fine. If you have multiple records then you can't use this FM in a loop because of performance constraints.
Regards,
Sreekanth
05-31-2007 5:24 AM
txs for your response.
My problem is solved by applying a search like
where
VBRK-VBELN = BKPF-AWKEY
BKPF-AWTYP = 'VBRK'
this work faster.
05-30-2007 2:32 PM
You can also use table BKPF (which is the Acctng. document header). The billing document should be stored in field XBLNR (reference field). BKPF has an index for this field so it shouldn't take long. Once you have the accounting document #, you can read BSEG for other field information. Hope this helps.
05-31-2007 5:23 AM
txs for your response.
My problem is solved by applying a search like
where
VBRK-VBELN = BKPF-AWKEY
BKPF-AWTYP = 'VBRK'
this work faster.
XBLNR found empty.
05-31-2007 5:25 AM