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: 

Huge String Array into smaller different arrays

Former Member
0 Kudos

Hello,

I have an requirement wherein i'll be getting a huge array of Strings (say 10000) elements. This number is variable.

Now i have to break the same into smaller chunks/arrays (say 100 element each).

Thanks,

Piyush

8 REPLIES 8

Former Member
0 Kudos

Press F1 on split or use this FM RKD_WORD_WRAP

0 Kudos

Hi,

But that is splitting of a String value to ITAB.

I want split number of enteries of huge ITAB into different smaller ITAB's

Regards,

Piyush

Former Member
0 Kudos

hi piyush

check this

hope it helps you

thanks

SAchin

Former Member
0 Kudos

Hi Piyush

[FM for split long string|]

Thanks!

0 Kudos

These are all to split a String, but i want to break ITAB into smaller ITABs, the length for huge ITAB will be a Variable one.

Edited by: Piyush Bajaj on Mar 6, 2009 1:00 PM

0 Kudos

Hi,

try this.

TYPES :

BEGIN OF type_s_fs,

field(100) TYPE c,

END OF type_s_fs.

DATA fs TYPE type_s_fs.

DATA itab LIKE STANDARD TABLE OF fs.

DATA itab1 LIKE STANDARD TABLE OF fs.

DATA w_d TYPE i.

w_d = STRLEN( w_c ).-----> ( Declare ur longstring here with w_c )

DIVIDE w_d BY 100.

add 1 to w_d.

DATA w_t TYPE i.

DO w_d TIMES.

fs-field = w_c+w_t(100).

APPEND fs TO itab.

CLEAR fs.

ADD 100 TO w_t.

ENDDO.

LOOP AT itab INTO fs.

write 😕 fs-field.

ENDLOOP.

With this u can split at 100 characters into single internal table.

Now , loop at this table and assign each record to required internals tables just by reading 1 row.

Or

make use of fieldsymbols.

viquar_iqbal
Active Contributor
0 Kudos

Hi

use this FM

C147_STRING_SPLIT_AT_POSITION

C147_STRING_TRUNCATE

RM_PROT_SPLIT_INPUT_STRING

or these

HR_EFI_CONVERT_STRING_TO_TABLE convert a string into a table

CONVERT_STRING_TO_TABLE Convert string to table

CONVERT_TABLE_TO_STRING Convert string to table

BC402_CREATE_SEP_STRING Creates Character String from Table Data

/SAPSLL/TEXT_STRING_TO_TABLE

Former Member
0 Kudos

solved this by READ LINES