Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Select On MARD Table-Maximum Time Exceeded

Former Member
0 Likes
1,337

Hi..

I have the following select query.


SELECT matnr werks lgort labst insme einme speme
        FROM mard
        bypassing buffer
        into table it_collect_ln
        FOR ALL ENTRIES IN it_data
        WHERE matnr = it_data-matnr
          AND    werks = it_data-werks
          AND    lgort IN s_lgort
          AND ( labst GT 0
          OR    insme GT 0
          OR    einme GT 0
          OR    speme GT 0 ).

it_data consists of records from MARA and MARC innerjoin.

The internal it_data which is sorted by Matnr and werks and has about 80 000 records in Dev System.

But in Quality and Production there may be more than 100 000 records.

When I run the report in the selection process I just run for 2000 to 4000 plants.

It comes out of the program and gives me a message Maximum Time Exceeded.

There is no much difference by using bypassing buffer.

Should I create a secondary index in MARD table on labst insme einme speme

Any suggestions would be appreciated.

Thanks,

Chaithanya

Points will be rewarded

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,105

hi,

Yes ask him to increase the SAP memory ....

Regards,

Santosh

Hi..

I have the following select query.


SELECT matnr werks lgort labst insme einme speme
        FROM mard
        bypassing buffer
        into table it_collect_ln
        FOR ALL ENTRIES IN it_data
        WHERE matnr = it_data-matnr
          AND    werks = it_data-werks
          AND    lgort IN s_lgort
          AND ( labst GT 0
          OR    insme GT 0
          OR    einme GT 0
          OR    speme GT 0 ).

it_data consists of records from MARA and MARC innerjoin.

The internal it_data which is sorted by Matnr and werks and has about 80 000 records in Dev System.

But in Quality and Production there may be more than 100 000 records.

When I run the report in the selection process I just run for 2000 to 4000 plants.

It comes out of the program and gives me a message Maximum Time Exceeded.

There is no much difference by using bypassing buffer.

Should I create a secondary index in MARD table on labst insme einme speme

Any suggestions would be appreciated.

Thanks,

Chaithanya

Points will be rewarded

6 REPLIES 6
Read only

Former Member
0 Likes
1,105

hi Chaitanya,

Contact your basis guy in increasing the memory. He can assist you on that.

Regards,

Santosh

Read only

0 Likes
1,105

Hi Santosh,

Thanks for your reply.

But when I use an inner join for MARC and MARA it gives those 80,000 records may be in 10 sec.

I have checked the total no of records in MARD it is 80,911

Why does it time out??

What should I mention exactly to the basis guy?? (increase in SAP Memory)

Thanks,

Chaithanya

Read only

0 Likes
1,105

hi,

In some cases, Join is better than for all entries...why dont u add MARD to ur first select.

if not, this is a hunch. try removing the OR conditions, and see if theres any improvement in the performance.

regards,

madhumitha

Read only

0 Likes
1,105

madhumitha's suggestion would be the first way to go, before talking to your basis administrator.

BTW: Don't think this has anything to do with memory, selection of the data just takes more time than allowed. You can however extend this maximum time, also via your basis administrator. However, most of the times they will tell you to change your selection, or change to whole report or whatever. Since changing this parameter will affect all reports, which in turn can have quite some impact on system.

Try removing the OR's the begin with, and maybe even the first AND ... GT 0. Later on, when data is in internal table, you can still remove these records.

Other option would be be to limit the number or plants, since 2000 - 4000 plants is quite a lot. This will take time one way or the other.

Good luck.

Read only

0 Likes
1,105

Hi Madhumitha,

Thanks for your reply. I have removed the OR Conditions. It started working out. Thanks.

Hi Micky Oestreich,

Thanks for your suggestions too. It worked out.

regards,

chaithanya,

Points have been awarded.

Read only

Former Member
0 Likes
1,106

hi,

Yes ask him to increase the SAP memory ....

Regards,

Santosh