03-06-2009 11:50 AM
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
03-06-2009 11:52 AM
03-06-2009 11:56 AM
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
03-06-2009 11:56 AM
03-06-2009 11:57 AM
03-06-2009 12:00 PM
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
03-06-2009 12:34 PM
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.
03-06-2009 11:58 AM
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
03-12-2009 8:03 AM