2006 Sep 15 11:25 PM
SELECT * " bukrs lifnr gjahr belnr blart
FROM bsak
appending table gt_bsak
INTO CORRESPONDING FIELDS OF TABLE gt_bsak
WHERE cpudt in r_cpudt
AND blart in r_blart
AND bukrs in s_bukrs
AND lifnr in s_lifnr
AND belnr in s_belnr
AND gjahr in s_gjahr
What is wrong in above stmt .
As one record is selecting from db table (se11) bsak with the set of values of
r_cpudt, r_blart, s_bukrs, s_belnr, s_gjahr .
2006 Sep 15 11:32 PM
Hi,
Nothing is wrong the select statement..
Compare the values you give in SE11 with the values in the where clause..
Check your values in r_cpudt and r_blart..looks like you are populating manually in your program..
Populate the range only if the value is present..
Example..
RANGES r_matnr for mara-matnr.
if not v_matnr is initial.
r_matnr-sign = 'I'.
r_matnr-option = 'EQ'.
r_matnr-low = v_matnr.
append r_matnr.
endif.
Thanks,
Naren
SELECT * " bukrs lifnr gjahr belnr blart
FROM bsak
appending table gt_bsak
INTO CORRESPONDING FIELDS OF TABLE gt_bsak
WHERE cpudt in r_cpudt
AND blart in r_blart
AND bukrs in s_bukrs
AND lifnr in s_lifnr
AND belnr in s_belnr
AND gjahr in s_gjahr
What is wrong in above stmt .
As one record is selecting from db table (se11) bsak with the set of values of
r_cpudt, r_blart, s_bukrs, s_belnr, s_gjahr .
2006 Sep 15 11:32 PM
Hi,
Nothing is wrong the select statement..
Compare the values you give in SE11 with the values in the where clause..
Check your values in r_cpudt and r_blart..looks like you are populating manually in your program..
Populate the range only if the value is present..
Example..
RANGES r_matnr for mara-matnr.
if not v_matnr is initial.
r_matnr-sign = 'I'.
r_matnr-option = 'EQ'.
r_matnr-low = v_matnr.
append r_matnr.
endif.
Thanks,
Naren
2006 Sep 16 4:05 AM
It would be correct if you left it by selecting on lifnr. But since you are now selecting on bukrs, belnr and gjahr, you should select against BSEG and not BSAK. This way you will use the primary index. As coded, you will not. If you only want cleared items (what you would get if you kept it against BSAK) you should also add AUGDT <> ' ' and KUART = 'K'.
Rob
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |