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

Shortdump in standard function 'TR_SPLIT_TEXT'

Former Member
0 Likes
1,273

When I use this standard function 'TR_SPLIT_TEXT' to split text.

If the text that i want to split is longer than length parameter (IV_LEN) 1 character, then it will cause a shortdump.

For example, my test data is IV_TEXT = 'ABCD' and IV_LEN = 3.

After execute function, it will occur Runtime Errors 'ASSIGN_LENGTH_0'.

Please help to suggest how to fix this shortdump. Thank you.

5 REPLIES 5
Read only

Former Member
0 Likes
1,002

Hi

This is not suitable function module for splitting the text.

try TEXT_SPLIT function module for splitting text.

Regards

sateesh

Read only

former_member209217
Active Contributor
0 Likes
1,002

Hi,

Why do you need a function module when SAP is providing you Simple SPLIT statement.

Regards,

Lakshman..

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,002

Why cant you write a logic.


parameters:pa_text type char255.
parameters:pa_pos type i.

types:begin of ty,
      line type char255,
      end of ty.

data:len type i.
data:cntr type i.
data:offset type i.

data:itab type table of ty.
data:wa type ty.

len = strlen( pa_text ).
cntr = ceil( len / pa_pos ).
offset = 0.

do cntr times.
if sy-index = cntr.
wa-line = pa_text+offset(*).
append wa to itab.
clear wa.
endif.
wa-line = pa_text+offset(pa_pos).
append wa to itab.
clear wa.
offset = offset  + pa_pos.
enddo.

Read only

Former Member
0 Likes
1,002

I want to fix shortdump in this function because it is being used in 2-3 programs in my system.So, I don't want to change source code in every program that use this function.

Read only

Former Member
0 Likes
1,002

Hi

Take IV_LEN as type I or String.

if you dont want to change it take Temp Variable type String or type I.

First you do your operation and then pass it to IV_LEN

Cheeerz

Ram