‎2005 Dec 07 7:41 AM
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!
‎2005 Dec 07 7:47 AM
Hi,
Can you send the dump details as it would help to analyse the problem,
Rgds,
‎2005 Dec 07 7:46 AM
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...
‎2005 Dec 07 7:47 AM
Hi,
Can you send the dump details as it would help to analyse the problem,
Rgds,
‎2005 Dec 07 7:49 AM
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
‎2005 Dec 07 7:49 AM
‎2005 Dec 07 8:00 AM
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.
‎2005 Dec 07 8:17 AM
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.
‎2005 Dec 07 8:21 AM
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 ..
‎2005 Dec 07 8:18 AM
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
‎2005 Dec 07 9:03 AM
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.