‎2011 Feb 15 1:58 PM
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
‎2011 Feb 15 2:21 PM
Hi,
You can split the entire line into a table ...
data : itab TYPE TABLE OF string,
SPLIT l_bukrs_string AT ';' INTO TABLE itab.
Itab contains the values , one line for each word .
Regards,
Srini.
‎2011 Feb 15 2:21 PM
Hi,
You can split the entire line into a table ...
data : itab TYPE TABLE OF string,
SPLIT l_bukrs_string AT ';' INTO TABLE itab.
Itab contains the values , one line for each word .
Regards,
Srini.
‎2011 Feb 15 2:21 PM
Hi,
why don´t you put in in an internal table.
do it 20 times.
SPLIT l_bukrs_string AT ';' INTO l_bukrs1 text1.
move l_bukrs to itab-bukrs.
append itab.
enddo.
Regards Nicole
‎2011 Feb 15 2:24 PM
Hi
You can use same slit statement to store data in internal table.
My idea is to slit the file into internal table and use this internal table like for all entries in or like select-options.
SPLIT text_flie AT ',' into table IT_BUKRS.
select * from dbtable for all entries in it_BUKRS
condn
Hi Shrini you I posted on the same time, I did not copied, sorry
Thanks,
Anmol.
Edited by: anmol112 on Feb 15, 2011 9:25 AM