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

Error : DATA_OFFSET_LENGTH_TOO_LARGE

Former Member
0 Likes
14,703

Hello Experts,

I am facing an error in ABAP program.

Following is the error :-

-------------------------------

Runtime Errors         DATA_OFFSET_LENGTH_TOO_LARGE
Except.                CX_SY_RANGE_OUT_OF_BOUNDS
Date and Time          12.07.2013 00:11:02

Short Text
     Invalid subfield access: Offset and length too large

What happened?
     Error in the ABAP Application Program

     The current ABAP program "Z0CKU_PRCTR" had to be terminated because it has
     come across a statement that unfortunately cannot be executed.

Error analysis
     An exception occurred that is explained in detail below.
     The exception, which is assigned to class 'CX_SY_RANGE_OUT_OF_BOUNDS', was not
      caught in
     procedure "DATA_COLLECTION" "(FORM)", nor was it propagated by a RAISING
      clause.
     Since the caller of the procedure could not have anticipated that the
     exception would occur, the current program is terminated.
     The reason for the exception is:
     In the running program "Z0CKU_PRCTR", the field "I_DATA-PRCTR", which is of the
      type "C" and
     length 10, was to be accessed with the offset 9 and the length 2.
     However, subfield accesses in which the sum of the offset and length
     specifications is greater than the field length are not allowed.

Missing RAISING Clause in Interface
     Program                                 Z0CKU_PRCTR
     Include                                 Z0CKI_PRCTR_F01
     Row                                     26
     Module type                             (FORM)
     Module Name                             DATA_COLLECTION

Code snippet and the values are attached as a screenshot.

Please let me know what can be done here.

4 REPLIES 4
Read only

Former Member
5,379

Hi Mangesh

The error reads clearly... but let it be explained.

The length of PRCTR is 10 characters and you are trying to read +9(2) which is the 10th and the 11th char that is why you are getting this dump.

Check the l_count variable it should be max 8 not more to get the last 2.

Regards

Read only

Former Member
0 Likes
5,379

Put a check in DO ENDDO

IF L_COUNT GT 8.

EXIT.

ENDIF.

Read only

arindam_m
Active Contributor
0 Likes
5,379

Hi,

Please read the text:

In the running program "Z0CKU_PRCTR", the field "I_DATA-PRCTR", which is of the
  type "C" and
length 10, was to be accessed with the offset 9 and the length 2.
However, subfield accesses in which the sum of the offset and length
specifications is greater than the field length are not allowed.

Does that give a better understanding of what's gone wrong.. Please read Short Dump Information. It has a lot more info that can guide you to know the reason.

Cheers,

Arindam

Read only

Former Member
0 Likes
5,379

Hi Mangesh,

As every one replied you are trying to access the place which does not exist. Try to change the logioc of the program where you are reading the prctr field.

If you cannot change the present logic,

write the if statement inside catch system-exceptions.

CATCH SYSTEM-EXCEPTIONS DATA_OFFSET_LENGTH_TOO_LARGE = 1.

*--Write your If statement Here.

ENDCATCH.

If sy-subrc <> 0.

*--You can give a message here and you can avoid the run time error.

endif.

Thanks and Regards,

Vinay Mutt