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

time_out ABAP runtime error

aris_hidalgo
Contributor
0 Likes
1,057

Guys,

I am trying to fix a program in which when I don't specify a material and storage location in the select-options in the selection screen and run the program it takes a long time to respond and it produces time out ABAP runtime error. Below is the select-options:

SELECTION-SCREEN BEGIN OF BLOCK BLOCK1 WITH FRAME TITLE TEXT-001.

PARAMETER: SP_PLANT LIKE MARD-WERKS OBLIGATORY.

SELECT-OPTIONS: SO_MATNO FOR MARD-MATNR,

SO_MGRP FOR MARA-MATKL DEFAULT 'PA001' to 'PA006',

SO_SLOC FOR MARD-LGORT.

SELECTION-SCREEN END OF BLOCK BLOCK1.

So after entering the plant in the select options and press F8 after a while the above error is created. Is there a way to fix this? Thanks and good day!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,001

Hi,

Can you send the dump details as it would help to analyse the problem,

Rgds,

9 REPLIES 9
Read only

Former Member
0 Likes
1,001

I think Try to give some conditions to fetch the data..

i think it is trying to read the Full table with large volume of data...

check the selects also...

Read only

Former Member
0 Likes
1,002

Hi,

Can you send the dump details as it would help to analyse the problem,

Rgds,

Read only

Former Member
0 Likes
1,001

HI,

your program must be having a select query whihc is selecting records from a sap table like MARA or MARC, which may contains thousands of records.

Whenever you specify the the materlial and plant..th quey might have been fetchng the records based on that.

NB. see the where condition of your select query.

But if you dont specify..its trying to fetch all the thousands of record...it takes lots of time, specially if use select..endselect...and thats why the time out error might have come.

plz reward points if it answer your query

Read only

Former Member
0 Likes
1,001

Problem with selects....

Read only

aris_hidalgo
Contributor
0 Likes
1,001

Guys I think the problem lies in the select statement of the program. Below is the select statement. Notice the where condition amatnr IN so_matno AND algort IN so_sloc. Below is one of the select statements that contains these where clauses:

SELECT A~WERKS

A~MATNR

A~LABST

A~LGORT

A~LGPBE

B~MATKL

B~MEINS

INTO (ITAB_1-GD_RPLANT, ITAB_1-GD_RMATNO, ITAB_1-GD_RQTY,

ITAB_1-GD_RSLOC, ITAB_1-GD_RSBIN, ITAB_1-GD_RMGRP,

ITAB_1-GD_RUNIT)

FROM ( MARD AS A INNER JOIN MARA AS B ON AMATNR = BMATNR )

WHERE A~WERKS = SP_PLANT AND

A~MATNR IN SO_MATNO AND

A~LGORT IN SO_SLOC AND

A~LGPBE IN SO_SBIN AND

A~LABST <> 0 AND

B~MATKL IN SO_MGRP.

APPEND ITAB_1.

ENDSELECT.

Read only

0 Likes
1,001

HI Viraylab,

I think it is because the select ...end select consuming too much time.

Try to use INTO CORRESPONDING FIELDS OF TABLE

TYPES: BEGIN OF T_ITAB ,

WERKS TYPE MARD-WERKS,

MATNR TYPE MARD-MATNR,

LABST TYPE MARD-LABST,

LGPBE TYPE MARD-LGPBE,

MATKL TYPE MARA-MATKL,

MEINS TYPE MARA-MEINS,

END OF T_ITAB.

DATA: ITAB_1 TYPE T_ITAB OCCURS 0 WITH HEADER LINE.

SELECT A~WERKS

A~MATNR

A~LABST

A~LGORT

A~LGPBE

B~MATKL

B~MEINS

INTO CORRESPONDING FIELDS OF TABLE ITAB_1

FROM MARD AS A INNER JOIN MARA AS B

ON AMATNR = BMATNR

WHERE A~WERKS = SP_PLANT AND

A~MATNR IN SO_MATNO AND

A~LGORT IN SO_SLOC AND

A~LGPBE IN SO_SBIN AND

A~LABST <> 0 AND

B~MATKL IN SO_MGRP.

Read only

0 Likes
1,001

use

SELECT A~WERKS
A~MATNR
A~LABST
A~LGORT
A~LGPBE
B~MATKL
B~MEINS
INTO TABLE ITAB_1 
FROM MARD AS A INNER JOIN MARA AS B 
ON A~MATNR = B~MATNR 
WHERE A~WERKS = SP_PLANT AND
A~MATNR IN SO_MATNO AND
A~LGORT IN SO_SLOC AND
A~LGPBE IN SO_SBIN AND
A~LABST <> 0 AND
B~MATKL IN SO_MGRP.

Into corresponding will icrease the load..

avoid that ..

Read only

abdul_hakim
Active Contributor
0 Likes
1,001

Hi

If you don't specify any value for material and storage location then all the values will be fetched from the table.

Either make those fields as mandatory or use PARAMETERS for those fields.

REgards,

Abdul

Read only

0 Likes
1,001

you may restrict the number of records being selected. Use the addition UP TO n ROWS in the SELECT ... FROM statement.

It may be convenient to have a Parameter P_MAXREC type SYDBCNT on the selection-screen with a default of (you decide). Or try what is a good value to avoid timeouts.

C.