Application Development 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: 

offset problem more than 240 characters

Former Member
0 Kudos

hi all,

please find the coding,when i run this program i got dump.

how to correct this dump.

wa_prchr = 'In Stahl India various sales scenarios are created standard orders (Order type - OR)Sale order is created based on the customer purchase order from Chennai KanpurKolkattasample orders (Order type - FD)sample orders (Order type - FD)sample '..

a = 0.

b = 0.

do 15 times.

b = b + 72.

wa_text = wa_prchr+a(b).

wa_tline-tdline = wa_text .

wa_tline-tdformat = '*'.

append wa_tline to tlinetab.

a = a + 72.

clear b.

clear wa_text.

enddo.

i got dump like this

Invalid access to a string (offset and length too large).

However, the sum of the offset (216) and length (72) specification

was greater than the length of the string (240).

This is not allowed.

Edited by: bala chandran on Jun 26, 2008 7:27 AM

6 REPLIES 6

Former Member
0 Kudos

Hello Bala,

Check the data declarations for the lenghts allocated to the variables a,b, wa_text--plz increase the length sufficiently to avoid the dump.

Reward, if helpful.

Rgds,

Raghu.

former_member195383
Active Contributor
0 Kudos

see ...

the dump came at

wa_text = wa_prchr+216(72).

this means the wa_text will contain the string staring from 217th character and then will take next 72 characters including that one.

But ur length of the string is 240.

That caused the dump.

Reward points..if ans is helpful...

Edited by: Rudra Prasanna Mohapatra on Jun 26, 2008 7:33 AM

Former Member
0 Kudos

Hi,

pls chk the size in the LINE-SIZE of the REPORT stmt.

if not specified, it will take the standard size.

go thru the F1 help.

reward if useful,

regards,

teja.

Former Member
0 Kudos

Problem occurs because length of wa_prchr is 240.

Whereas you are doing loop for 15 times and reading 72 characters in each loop pass.

so in 3rd loop pass, program tries to read 72*3 = 216 (72). As a result, program tries to read wa_prchr till (216+72 ) 288 characters.

As a result, there is a length mismatch and you get a dump.

Solution: Either specify length of wa_prchr to 1080 characters.

Or modify your do loop.

Reward if useful.

Former Member
0 Kudos

Hai Balachandran,

Inside the loop ur clearing the value of variable u2018bu2019, But the Value of u2018au2019 is going on increasing and thereby the length is exceeding. Try to make changes in ur code. I think u have to increase the length wa_text, wa_prchr.. Check it out.

It will be resolved.

Reward if found useful,

Regards,

Swapna.

huseyindereli
Active Contributor
0 Kudos

Hi , i think you're trying to do sth like this ;

temp_str is any string to divide...

  • calculate iteration number

i = STRLEN( temp_str ).

j = FLOOR( i / 72 ).

IF j EQ 0.

ADD 1 TO j.

ENDIF.

DO j TIMES.

CLEAR lv_line.

lv_line = temp_str+k(*).

k = k + 72.

IF lv_line IS NOT INITIAL.

APPEND lv_line TO p_t.

ENDIF.

ENDDO.

p_s = temp_str.