09-24-2008 6:24 AM
Hi,
I have a requirement where I have a string variable but depending on the programming conditions, the value in that string should come in 'n' no of lines..
for eg.;suppose my string is 'MAIN: place1 DP: place1'
it should be displayed as :
MAIN: place1
DP: place1..
and if my string is 'MAIN: place1 DP: place1 'MAIN: place2 DP: place2'', then it should be displayed as ;
MAIN: place1
DP: place1..
MAIN: place2
DP: place2.
But the value in the string can be determined only at runtime.. Please give me a solution for this.
Thanx in advance,.
Regards,
Suzie
Edited by: Suzie on Sep 24, 2008 7:35 AM
09-24-2008 6:37 AM
Hi
you can go for SPLIT into <itab> statement. it will solve your purpose. here after getting data into itab you have to display new line for each 2 records of itab.
here is sample code.
split p_str at SPACE into table itab.
loop at itab.
w_flag = sy-tabix mod 2.
if w_flag ne 0.
write: /.
endif.
write: itab-f1.
endloop.