‎2008 Feb 13 12:44 PM
Hi Gurus,
i m fetching data from A005 table and according to selection criteria there is 223,233 entries in the table because of that taking so much time.......and giving runtime error.......
this is code
SELECT MARAMATNR MAKTMAKTX MARAMATKL MARCWERKS
INTO TABLE IT_MARC
FROM MARC
INNER JOIN MARA ON MARCMATNR = MARAMATNR
INNER JOIN MAKT ON MARCMATNR = MAKTMATNR
WHERE MARC~MATNR IN S_MATNR AND
MARC~WERKS IN S_WERKS AND
MAKT~SPRAS = 'EN' AND
MARA~XCHPF = 'X' AND
MATKL IN S_MATKL.
IF IT_MARC[] IS NOT INITIAL.
SELECT KUNNR MATNR DATBI DATAB KNUMH
FROM A005
INTO TABLE IT_A005
FOR ALL ENTRIES IN IT_MARC
WHERE KSCHL = 'ZMRP' AND
VKORG = '1000' AND
VTWEG = '10' AND
KUNNR IN S_KUNNR AND
MATNR = IT_MARC-MATNR AND
datab le s_datbi-low and
DATBI ge s_datbi-low.
***
ENDIF.
during debugiing report taking time to fetch data from A005 table
IF IT_A005[] IS NOT INITIAL.
SELECT KNUMH KBETR
FROM KONP
INTO TABLE IT_KONP
FOR ALL ENTRIES IN IT_A005
WHERE KNUMH = IT_A005-KNUMH.
ENDIF.
give me some solution
‎2008 Feb 13 12:48 PM
Create the Indexes for respective database tables, then your problem solved
‎2008 Feb 13 12:47 PM
you need to include primary key field A005-KAPPL for quicker access. It should always have the same value for your selected data, so once you find out which one it is, you can put that literal into your select statement.
Cheers
Thomas
Edit: possible values for KAPPL are stored in table T681A.
‎2008 Feb 13 12:48 PM
Create the Indexes for respective database tables, then your problem solved
‎2008 Feb 13 12:51 PM
> Create the Indexes for respective database tables, then your problem solved
Bollocks. Always check first whether you can use an existing, fully qualified primary or secondary key access path.
‎2008 Feb 13 12:50 PM
Hi,
The number of records in table IT_A005 is too high to use the FOR ALL ENTRIES OPTION. One solution would ne to copy say 500 records of table IT_A005 and do the same. So loop over table IT_A005, and after each 500 records execute the selection.
Regards,
John.
‎2008 Feb 13 12:55 PM
Use KAPPL in where condition.
Field order should be the same in where condition as in the
table ..
field DATAB is after DATBI in the table ..
change the where condition accordingly ..
‎2008 Feb 13 5:45 PM
Absolutely no guarantees, but you can try:
TABLES a005.
RANGES: r_kappl FOR a005-kappl.
* Get all values of KAPPL into a range table.
MOVE 'EQ' TO r_kappl-option.
MOVE 'I' TO r_kappl-sign.
SELECT kappl FROM t681a
INTO r_kappl-low.
APPEND r_kappl.
ENDSELECT.
SELECT kunnr matnr datbi datab knumh
FROM a005
INTO TABLE it_a005
FOR ALL ENTRIES IN it_marc
WHERE kappl IN r_kappl
AND kschl = 'ZMRP'
AND vkorg = '1000'
AND vtweg = '10'
AND kunnr IN s_kunnr
AND matnr = it_marc-matnr
AND datab LE s_datbi-low
AND datbi GE s_datbi-low.See if it can use the primary index.
Rob
‎2008 Feb 15 4:21 AM
thnks to all of u i hv tried as all of u said......................
A005 not allowing me to cerate index.......................
i hv tried with all primary key and maintain sequence as in the table and removed for all entries* but still taking so much time