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

Runtime error

Former Member
0 Likes
639

I am facing time_out error.

Wht exactly I dont know,but I am facing time_out error at this select stmt.

TYPES: BEGIN OF TY_DELIVERIES,

VBELN TYPE VBELN_VL,

POSNR TYPE POSNR_VL,

NTGEW TYPE NTGEW_15,

WADAT_IST TYPE WADAT_IST,

UECHA TYPE UECHA,

LFIMG TYPE LFIMG,

ERDAT TYPE ERDAT,

ERZET TYPE ERZET,

GEWEI TYPE GEWEI,

END OF TY_DELIVERIES.

DATA: T_DELIVERIES TYPE TY_DELIVERIES OCCURS 0.

DATA: ST_DELIVERIES LIKE LINE OF T_DELIVERIES.

-

-

-

IF NOT T_DELIVERIES[] IS INITIAL.

SELECT MANDT VBELV POSNV VBELN POSNN INTO TABLE T_VBFA FROM VBFA

FOR ALL ENTRIES IN T_DELIVERIES

WHERE VBELN EQ T_DELIVERIES-VBELN

AND POSNN EQ T_DELIVERIES-POSNR

AND VBTYP_V IN ('C' , 'H').

ENDIF.

I guess this might b the problem.

I am selecting from VBFA table where I have used only 3 key fields in condition stmt, although there are 5 key fields for that table.

let me know hw far this analysis is correct.If not,wht wud b the cause for the time_out at this select stmt.

reply me ASAP.

6 REPLIES 6
Read only

Former Member
0 Likes
607

T_DELIVERIES must be having many entries and when you selecting data from VBFA based on condition in that table..many records must be meeting that criteria and the select query is taking long to execute..hence a time-out error..see if you can restrict the where condition further..else sort t_deliveries or filter entries in that first..

Read only

dhruv_shah3
Active Contributor
0 Likes
607

Hi,

Key fields should come first when you declare the internal table.

in select statement the key fields should come first.

Again rewrite the statement and the try is again.

HTH

Regards,

Dhruv Shah

Read only

Former Member
0 Likes
607

Hi,

Are you selecting a huge number of data??

If there is a large number of data then it takes time to select the data..Also check out your system timeout period.

Read only

Former Member
0 Likes
607

Hi,

You can do as below.


ranges: gr_vbtyp for vbfa-VBTYP_V.

gr_vbtyp-sign  = 'I'.
gr_vbtyp-option = 'EQ'.
gr_vbtyp-low = 'C'.
append gr_vbtyp.

gr_vbtyp-sign  = 'I'.
gr_vbtyp-option = 'EQ'.
gr_vbtyp-low = 'H'.
append gr_vbtyp.

"Write the select statement as below :
IF NOT T_DELIVERIES[] IS INITIAL.
SELECT MANDT VBELV POSNV VBELN POSNN INTO TABLE T_VBFA FROM VBFA
FOR ALL ENTRIES IN T_DELIVERIES
WHERE VBELN EQ T_DELIVERIES-VBELN
AND POSNN EQ T_DELIVERIES-POSNR
AND VBTYP_V IN gr_vbtyp.
ENDIF.

OR

"take out vbtyp_v from the where condition of select statement and use below code and add field vbtyp_v in the internal table t_vbfa.

Delete t_vbfa where vbtyp_v not in gr_vbtry.

Thanks,

Sriram Ponna.

Read only

Former Member
0 Likes
607

Hi Divya,

This error is due to the qurey is taking much time in fecting data from the table. Better run this program in Background and check where the requied data is getting or not.

The table VBFA is very big table having lots of data it will definetly takes time... if your getting time out error run in background.

At slection screen after giving values in input field in menu bar -> program -> execute in background and follow the steps give the ouptu device name, windows pritner name and format, and run immediatly and check and save.

Go to SM 37 execute there in job status if u see finished click on job and click spool button .

regards,

sunil kairam.

Read only

Former Member
0 Likes
607

Hi Divyasree,

Try doing like this. take a temporary internal table.

TYPES: BEGIN OF TY_DELIVERIES,

VBELN TYPE VBELN_VL,

POSNR TYPE POSNR_VL,

NTGEW TYPE NTGEW_15,

WADAT_IST TYPE WADAT_IST,

UECHA TYPE UECHA,

LFIMG TYPE LFIMG,

ERDAT TYPE ERDAT,

ERZET TYPE ERZET,

GEWEI TYPE GEWEI,

END OF TY_DELIVERIES.

DATA: T_DELIVERIES TYPE TY_DELIVERIES OCCURS 0.

DATA : T_DELIVERIES_temp TYPE standard table of TY_DELIVERIES

DATA: ST_DELIVERIES LIKE LINE OF T_DELIVERIES.

-

-

-

T_DELIVERIES_temp[ ] = T_DELIVERIES[ ]

sort t_deliveries_temp by vbeln posnr.

delete adjacent duplicates from t_deliveries_temp comparing vbeln posnr

IF NOT T_DELIVERIES_temp[ ] IS INITIAL.

SELECT MANDT VBELV POSNV VBELN POSNN INTO TABLE T_VBFA FROM VBFA

FOR ALL ENTRIES IN T_DELIVERIES_temp

WHERE VBELN EQ T_DELIVERIES-VBELN

AND POSNN EQ T_DELIVERIES-POSNR

AND VBTYP_V IN ('C' , 'H').

ENDIF.

Hope this will help u.