Skip to Content
0
Former Member
Feb 15, 2011 at 01:58 PM

Split field values into range

1001 Views

Hi,

I have a 'Company Code' field in an input file that can contain 1 or multiple company codes, separated by comma (,). e.g it could be anything from '1105' to '1105,3000,2000,2200' etc up to about a max of 20 company codes.

I don't think it's efficient or good programming to do the following;

SPLIT l_bukrs_string AT ';' INTO

l_bukrs1

l_bukrs2

l_bukrs3

l_bukrs4

l_bukrs5

l_bukrs6.

etc etc up to the maximum (I would be declaring up to 20 more fields).

The ideal would be if I can get the list of company codes (from the field), into a range. So as per my example above, I would left with a range R_BUKRS that contains the single values 1105,3000,2000,2200. I can then loop at this range later on and do the rest of my company code specific processing.

And ideas - possible use of field symbols? Thanks alot