Inclusion of MANDT in the SQL statement
My apologies if this is the incorrect forum to post this question in. Please feel free to direct me towards the correct one if needed. I am not an ABAP(er), so please bear with me.
My question is as follows-
What decides the inclusion of Mandt in the Where clause of the SQL Statement even if it is not specified in the ABAP code ? My problem is that MANDT makes the index very unselective.
Here is an example
ABAP Code :
Open cursor with hold wa_dbcur for
SELECT matnr bwkey lbkum salk3 verpr vksal BKLAS
WHERE matnr in smatnr
AND bwkey in sbwkey
AND LBKUM ne 0.
fetch next cursor wa_dbcur into corresponding fields of table it_collect
package size 10000.
if sy-subrc <> 0.
SQL statement :
"MATNR" , "BWKEY" , "LBKUM" , "SALK3" , "VERPR" , "VKSAL" , "BKLAS"
"MANDT" = :A0 AND "MATNR" BETWEEN :A1 AND :A2 AND "BWKEY" BETWEEN :A3 AND :A4 AND "LBKUM" <> :A5
Also, is there a way to avoid this ? If there isn't a way to avoid this, what would be a workaround.
Thank you everyone in advance.