2006 Nov 28 6:24 AM
Currently my code is as below:
SELECT * FROM bkpf INTO CORRESPONDING FIELDS OF TABLE zbkpf
WHERE bukrs = pbukrs
AND gjahr = pgjahr
AND belnr IN belnr
AND bstat = space
AND monat = period.
these paramaters are the indexs...
Still its taking a long time...
any idea to share?
Hi,
Can you swap the positions of GJAHR and BELNR positions in the statement. There are chances that it is not going thru the index rather going for a full table scan.
Use the fields which are required instead of * and use INTO TABLE rather than INTO CORRESPONDING FIELDS OF
Hope this helps.
Thanks
Naresh
2006 Nov 28 6:29 AM
Hi ,
Instead of using INTO CORRESPONDING FIELDS OF TABLE zbkpf
declare a type like types: begin of itab ,
field1
field2
end of itab.
this table should include all the required fields .
After that :
SELECT * FROM bkpf INTO table itab
WHERE bukrs = pbukrs
AND gjahr = pgjahr
AND belnr IN belnr
AND bstat = space
AND monat = period.
Hope this helps.
2006 Nov 28 6:30 AM
HI,
don't use INTO CORRESPONDING FIELDS.
declare zbkpf with same structure as bkpf and then use.
SELECT * FROM bkpf <b>INTO TABLE zbkpf</b>
WHERE bukrs = pbukrs
AND gjahr = pgjahr
AND belnr IN belnr
AND bstat = space
AND monat = period.
2006 Nov 28 6:31 AM
Hi,
Do you need all the fields of BKPF table in your internal table ZBKPF. You can just declare your internal table with only those fields which you require for your processing & then select them in the same order from BKPF.
In this manner you can remove the usage of INTO CORRESPONDING FIELDS OF TABLE construct as well as select *.
This would reduce the time drastically.
Regards,
Chetan.
PS:Reward points if this helps.
2006 Nov 28 6:37 AM
instead declare an internal table itab with the fields required....
then as the table is BKPF...the best way is
select <fields> from bkpf
where <conditions>.
move data from bkpf to itab.
endselect.
This process is faster for FI related tables...
2006 Nov 28 6:50 AM
Hi,
Can you swap the positions of GJAHR and BELNR positions in the statement. There are chances that it is not going thru the index rather going for a full table scan.
Use the fields which are required instead of * and use INTO TABLE rather than INTO CORRESPONDING FIELDS OF
Hope this helps.
Thanks
Naresh
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |