cancel
Showing results for 
Search instead for 
Did you mean: 

Catching COLLECT_OVERFLOW in a start routine of UR

Former Member
0 Kudos

I am trying to add additional records in the start routine of an update rule (basically, trying to transpose from Key figure model to account model). Some time, my codes add too many records and I get COLLECT_OVERFLOW dump as RECNO field in DATA_PACKAGE type is INT4. I worked around this using smaller data package size. But, I want to catch this exception in my codes so that if at all it happens, I can log the error into the monitor.

I tried to catch in following ways :

i) CATCH SYSTEM-EXCEPTIONS COLLECT_OVERFLOW = 5.

...

ENDCATCH.

syntax error as it doesn't recognize

COLLECT_OVERFLOW type.

ii) CATCH SYSTEM-EXCEPTIONS OTHERS = 5.

...

ENDCATCH.

Complied fine, but, during run time, still the

exception was not caught and ended up with dump.

iii) TRY.

....

CATCH CX_SY_ARITHMETIC_OVERFLOW INTO OREF

(of type CX_ROOT).

...

ENTRY.

Won't get activated as TRY.. ENDTRY was used. My

colleague said TRY.. ENDTRY can be used only in OO.

Any further inputs are most appreciated. Thanks.

Accepted Solutions (0)

Answers (1)

Answers (1)

edwin_harpino
Active Contributor
0 Kudos

hi,

could it happened that wrong looping in the start routine ? can you post the code ?

Former Member
0 Kudos

My acutal code is little too long, but, here is the version I am trying to test. Thanks.

FIELD-SYMBOLS: <dp_wa> LIKE LINE OF DATA_PACKAGE.

DATA: l_data_package TYPE STANDARD TABLE OF data_package_structure

WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.

DATA: ls_data_package LIKE DATA_PACKAGE,

lt_data_package LIKE DATA_PACKAGE OCCURS 0,

lt_data_p_coll LIKE DATA_PACKAGE OCCURS 0.

DATA: w_break,

text TYPE string.

WHILE w_break IS INITIAL.

ENDWHILE.

CATCH SYSTEM-EXCEPTIONS OTHERS = 8.

LOOP AT DATA_PACKAGE INTO ls_data_package.

  • Append a record to IT for Amount record.

ls_data_package-recno = 99999999.

DO.

COLLECT ls_data_package INTO lt_data_package.

ENDDO.

ENDLOOP.

ENDCATCH.

  • If Overflow occurs.

IF sy-subrc NE 0.

MONITOR-msgty = 'E'.

MONITOR-msgv1 = 'Too many recs created in UR start '.

MONITOR-msgv2 = 'routine. Try reducing data packet '.

MONITOR-msgv3 = 'size in info package.'.

APPEND MONITOR.

ABORT = 1.

ENDIF.

DATA_PACKAGE[] = lt_data_package[].