09-09-2008 2:13 PM
Hi All,
Please suggest me to fine tune below query with example. It is causing DUMP when I am executing it because of low memory..
select * from vbap into table it_vbap where vbeln = p_vbeln
or vgbel = p_vbeln
or vbeln = j_3avbfae-vbelv
or vgbel = j_3avbfae-vbelv
or vbeln = p_vgbel
or vgbel = p_vgbel.
Thanks in advance.
Regards,
Chandravadan
09-09-2008 2:17 PM
Check out this way...
declare 2 ranges it_vbeln and it_vgbel.
move values of p_vbeln, j_3avbfae-vbelv, p_vgbel to it_vbeln.
move values of p_vbeln, j_3avbfae-vbelv, p_vgbel to it_vgbel.
select * from vbap into table it_vbap
where vbeln in it_vbeln.
select * from vbap appending table it_vbap
where vbeln in it_vgbel.
09-09-2008 2:28 PM
Try this ,
Instead of * in below code fetch the specific fields you require.
SELECT * FROM vbap INTO TABLE it_vbap WHERE
vbeln IN (p_vbeln, j_3avbfae-vbelv, p_vgbel) OR
vgbel IN (p_vbeln, j_3avbfae-vbelv, p_vgbel).
09-09-2008 2:31 PM
Are you sure it duoms because of low memory? Looks more like a TIME_OUT to me, since you are selecting on the non-indexed field VBAP-VGBEL.
Analyze whether you can rather use table VBFA to quickly find the reference document.
Also, do you really need all fields from VBAP for further processing? If not, better declare table IT_VBAP with only the necessary fields and select using INTO CORRESPONDING FIELDS OF TABLE ... .
Thomas