2008 Apr 02 12:46 PM
Hi,
I am retriving data from BSEG table using BELNR, BUKRS, GJAHR in the where condition. I have to get 4 records which are present in the BSEG table. I am getting only 3 records from the select. What May be the problem in the retrival.
Kishore
2008 Apr 02 12:56 PM
Hi,
I have written a sample query on BSEG table . It is fetching the correct number of records.
Just compare the actual values in BSEG .
data: i_bseg type standard table of bseg.
data: wa_bseg type bseg.
data:v_belnr type BELNR_D.
v_belnr = '100000000'.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_belnr
IMPORTING
OUTPUT = v_belnr.
.
select * into table i_bseg
from BSEG
where BUKRS = '2580'
and BELNR = v_belnr
and GJAHR = '2006'.
if sy-subrc eq 0.
loop at i_bseg into wa_bseg.
write : / wa_bseg-bukrs,
wa_bseg-belnr,
wa_bseg-gjahr.
endloop.
endif.
Hope it helps you.
Kind Regards,
Ravi Sankar.Z
Hi,
I am retriving data from BSEG table using BELNR, BUKRS, GJAHR in the where condition. I have to get 4 records which are present in the BSEG table. I am getting only 3 records from the select. What May be the problem in the retrival.
Kishore
2008 Apr 02 12:56 PM
Hi,
I have written a sample query on BSEG table . It is fetching the correct number of records.
Just compare the actual values in BSEG .
data: i_bseg type standard table of bseg.
data: wa_bseg type bseg.
data:v_belnr type BELNR_D.
v_belnr = '100000000'.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = v_belnr
IMPORTING
OUTPUT = v_belnr.
.
select * into table i_bseg
from BSEG
where BUKRS = '2580'
and BELNR = v_belnr
and GJAHR = '2006'.
if sy-subrc eq 0.
loop at i_bseg into wa_bseg.
write : / wa_bseg-bukrs,
wa_bseg-belnr,
wa_bseg-gjahr.
endloop.
endif.
Hope it helps you.
Kind Regards,
Ravi Sankar.Z
2008 Apr 02 1:01 PM
Hi,
are you working in the same client as your information ?? have you proved in SE16 that the 4 records that you mention fulfill the conditions in WHERE ??
Additionally, you write that your select condition is loke this:
select * from BSEG
where BELNR = something
BUKRS = something
GJAHR = something.
If this is true, you might have some day a performance problem, ´cause you are not following the correct sequence of the key fields:
select * from BSEG
where BUKRS = something
BELNR = something
GJAHR = something.
Something else. In the data base you might find the records like '0000012345' and you´re probably searching with '12345'. Pay attention to this point.
2008 Apr 02 1:13 PM
I have taken 3 key fields in the where condition , we have 4 keyfields in the BSEG. i am selecting the 4th key field in the internal table..Is it may be reason....Do i need to take all the key fields in the internal table ....?
Kishore
2008 Apr 02 1:15 PM
Hi,
Go to Se11, and input the data similar to the data pass in the where condition of the select statement, and execute.
Check how any records are retrieved.
Thanks,
Sriram Ponna.
2008 Apr 02 1:25 PM
Hi,
I am not suggesting you to use BSEG table,Because performancewise it is poor.
Just know what you need to display exact detaisl and search
for relevant tables.
Regards,
Chandu
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |