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: 

Dynamic New-Line in write statement

lijisusan_mathews
Active Contributor
0 Kudos

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

1 REPLY 1

Former Member
0 Kudos

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.