Application Development and Automation 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: 
Read only

Loop in smartform

Former Member
0 Likes
887

Hi,

I need to insert several texts in a smartforms. The number of texts is stored in a variable. I want to do a loop but i don't know how to proceed. I've never done a loop without an internal table.

I want to do that :

While line_nb < 20 do

...

endwhile.

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
832

Hi Dorien,

Define a Global variable in the smart form and set the value = 0.

Now do the loop on that global variable and put the condition . This will solve your problem.

Thanks,

Chidanand

6 REPLIES 6
Read only

former_member194669
Active Contributor
0 Likes
832

Try


do.
 ......
 ......
 ......
 if sy-index eq 20.
   exit.
 endif.
enddo

a®

Read only

Former Member
0 Likes
832

Hi,

Create a template.

Keep that template inside the loop.

Go to conditions tab and set ur condition.

Regards

Avi

Read only

Former Member
0 Likes
833

Hi Dorien,

Define a Global variable in the smart form and set the value = 0.

Now do the loop on that global variable and put the condition . This will solve your problem.

Thanks,

Chidanand

Read only

0 Likes
832

That's the solution i would use but I dont know how to create a loop with a simple variable. Smartform window only offers the possibility of creating loop for internal tables.

Thanks.

Read only

0 Likes
832

hi,

First create an internal table with one field.

Split the contents of your variable into this internal table.

Now use this internal table to display your contents.

I hope you know how to use a loop with internal table.

Regards,

Bhupal

Read only

0 Likes
832

Even if its not very clean, i will have to do that.

Thanks a lot.