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

Run time error

Former Member
0 Likes
846

Hi

Am getting an runtime error in the below code.Its working fine in development if i move it to QUALITY am getting an ru time error in the

''READ TABLE it_mara with key matnr = it_S026-matnr."

Please help.

Vijay

REPORT ZCOP_TEST_O.

TABLES:S026,MARA,T023T,S023.

DATA:IT_S026 TYPE STANDARD TABLE OF S026 WITH HEADER LINE.

DATA:IT_MARA TYPE STANDARD TABLE OF MARA WITH HEADER LINE.

DATA:IT_T023T TYPE STANDARD TABLE OF T023T WITH HEADER LINE.

DATA:IT_S023 TYPE STANDARD TABLE OF S023 WITH HEADER LINE.

TYPES:BEGIN OF t_report,

ENMNG TYPE S026-ENMNG,

MATNR TYPE S026-MATNR,

SPTAG TYPE S026-SPTAG,

MATKL TYPE MARA-MATKL,

MCOMP TYPE S026-mcomp,

*WGBEZ TYPE T023T-WGBEZ,

WEMNG TYPE S023-WEMNG,

END OF t_report.

DATA:it_report TYPE STANDARD TABLE OF t_report WITH HEADER LINE.

PARAMETERS:p_werks type S026-WERKS OBLIGATORY.

SELECT-OPTIONS:p_sptag FOR S026-SPTAG.

SELECT-OPTIONS:p_mcomp FOR S026-MCOMP default '60000000' to '60000063' obligatory.

*RANGES:p_mcomp for s026-mcomp.

DATA:x TYPE ENMNG.

DATA:y TYPE ENMNG.

DATA:z TYPE WEMNG.

DATA:a TYPE WEMNG.

DATA:b TYPE WEMNG.

SELECT * FROM S026 INTO CORRESPONDING FIELDS OF TABLE

IT_S026 WHERE WERKS = P_WERKS AND

SPTAG IN p_sptag AND MCOMP NOT in p_mcomp.

SELECT *

INTO CORRESPONDING FIELDS OF TABLE IT_MARA

FROM ( MARA AS A

INNER JOIN S026 AS B ON B~MATNR = A~MATNR ).

SELECT * FROM s023 INTO

CORRESPONDING FIELDS OF TABLE IT_s023 WHERE

WERKS = P_WERKS AND

SPTAG IN P_SPTAG .

SELECT *

INTO CORRESPONDING FIELDS OF TABLE IT_T023T

FROM ( T023T AS C

INNER JOIN MARA AS D ON DMATKL = CMATKL ) .

LOOP AT IT_S026.

READ TABLE it_mara with key matnr = it_S026-matnr.

READ TABLE it_t023t with key matKL = it_MARA-matKL.

IT_REPORT-MATKL = IT_T023T-MATKL.

IT_REPORT-ENMNG = IT_S026-ENMNG .

IT_REPORT-SPTAG = IT_S026-SPTAG .

IT_REPORT-MATNR = IT_S026-MATNR .

IT_REPORT-MCOMP = IT_S026-MCOMP .

ADD IT_REPORT-ENMNG TO X.

APPEND IT_REPORT.

ENDLOOP.

LOOP AT IT_S023.

ADD IT_s023-WEMNG TO Z.

IT_REPORT-WEMNG = IT_S023-WEMNG.

APPEND IT_REPORT.

ENDLOOP.

LOOP AT IT_REPORT .

IF IT_REPORT-ENMNG IS NOT INITIAL.

WRITE:/5(10) IT_REPORT-ENMNG , 20(10) IT_REPORT-SPTAG ,40(20) IT_REPORT-MATKL .

*50(10) IT_REPORT-MATNR, 60(10) IT_REPORT-MCOMP .

ENDIF.

ENDLOOP.

WRITE:/ 'TOTAL::',x.

WRITE:/ 'Quantity of goods received ::',z.

b = x - z.

WRITE:/ 'Process Loss ::' , b .

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
809

Hi Vijay,

Could you please put "ERROR ANALYSIS" for the dump (by checking ST22) here so that we can analyze and revert.

Regards,

Aditya

7 REPLIES 7
Read only

Former Member
0 Likes
810

Hi Vijay,

Could you please put "ERROR ANALYSIS" for the dump (by checking ST22) here so that we can analyze and revert.

Regards,

Aditya

Read only

0 Likes
809

hi aditya

d below is d runtime analysis.Please help.

Vijay

After a specific time, the program is terminated to make the work area

available to other users who may be waiting.

This is to prevent a work area being blocked unnecessarily long by, for

example:

- Endless loops (DO, WHILE, ...),

- Database accesses with a large result set

- Database accesses without a suitable index (full table scan)

The maximum runtime of a program is limited by the system profile

parameter "rdisp/max_wprun_time". The current setting is 600 seconds. If this

time limit is

exceeded, the system attempts to cancel any running SQL statement or

signals the ABAP processor to stop the running program. Then the system

waits another 60 seconds maximum. If the program is then still active,

the work process is restarted.

Read only

0 Likes
809

Hi Vijay,

The program has dumped because it has taken too much time to execute. It is not a syntax problem but a performance issue. Your program is reading too much data or is not tuned properly.

One question, when you are executing how long before the program goes to dump?

Do revert.

Read only

0 Likes
809

Hi aditya

Almost it is taking 6 minute.Anyway out from the above code.Please help.

Vijay

Read only

0 Likes
809

Hi Vijay,

You system parameter for runtime dumps, viz. rdisp/max_wprun_time is set at 600 seconds, i.e. 10 minutes. You might want to consult BASIS and increase this to say 20 minutes. But this is not the solution here. You can optimize your code as below:

Change the following block of code:

SELECT * FROM S026 INTO CORRESPONDING FIELDS OF TABLE

IT_S026 WHERE WERKS = P_WERKS AND

SPTAG IN p_sptag AND MCOMP NOT in p_mcomp.

SELECT *

INTO CORRESPONDING FIELDS OF TABLE IT_MARA

FROM ( MARA AS A

INNER JOIN S026 AS B ON B~MATNR = A~MATNR ).

SELECT * FROM s023 INTO

CORRESPONDING FIELDS OF TABLE IT_s023 WHERE

WERKS = P_WERKS AND

SPTAG IN P_SPTAG .

SELECT *

INTO CORRESPONDING FIELDS OF TABLE IT_T023T

FROM ( T023T AS C

INNER JOIN MARA AS D ON DMATKL = CMATKL ) .

to

SELECT * FROM S026 INTO TABLE IT_S026

WHERE WERKS = P_WERKS AND

SPTAG IN p_sptag AND MCOMP NOT in p_mcomp.

IF IT_S026[ ] IS NOT INITIAL.

SELECT * INTO TABLE IT_MARA

FROM MARA

FOR ALL ENTRIES IN IT_S026

WHERE MATNR EQ IT_S026-MATNR.

ENDIF.

SELECT * FROM s023

INTO TABLE IT_s023

WHERE

WERKS = P_WERKS AND

SPTAG IN P_SPTAG .

IF IT_MARA[ ] IS NOT INITIAL.

SELECT *

INTO TABLE IT_T023T

FROM T023T

FOR ALL ENTRIES IN IT_MARA

WHERE MATKL EQ IT_MARA-MATKL.

ENDIF.

The inner joins impact performance. Also into corresponding clause is very bad for performance. You must not SELECT * instead better to select the required fields. But we shall skip this for now to test.

Please do test and confirm.

[ ] should be put without the space in above code.

Read only

0 Likes
809

Thanks aditya.got the required output.

vijay

Read only

0 Likes
809

Hi Vijay,

I'm glad your program worked, however, like I said there are a lot more aspects where you can improve the performance of your code.

I have seen you have posted the same doubt elsewhere and some suggestions have been regarding sorting the internal tables, using binary search and also selecting only required fields.

Try to incorporate these aspects to make your program even more efficient

Cheers,

Aditya