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

is it possible to loop in smartforms without using an internal table

Former Member
0 Likes
3,763

Hi,

In smartforms you have a loop function.
In this loop i always looped using in an internal table

But now i have to loop n times. (n=3 or 4 or 5)

in the loop you have an chackbox for using an internal table or not.
So i think it must be possible to also loop without an internal table.
But i cannot figure out how to do this.
It seems impossible to me.

Does anyone knows a way to achieve this (without making a dummy table with 5 entries)

Thanx in advance.

Hi,

In smartforms you have a loop function.
In this loop i always looped using in an internal table

But now i have to loop n times. (n=3 or 4 or 5)

in the loop you have an chackbox for using an internal table or not.
So i think it must be possible to also loop without an internal table.
But i cannot figure out how to do this.
It seems impossible to me.

Does anyone knows a way to achieve this (without making a dummy table with 5 entries)

Thanx in advance.

11 REPLIES 11
Read only

krishna_k19
Contributor
0 Likes
2,635

Hi Bernsen,

    If you want to write any condition based loop means ,  you have to write the conditions in WHERE Condition (Field name & Comparison value ) in DATA tab and if you want to display the loop in particular time(loop index , means in CONDITION tab have to write take one field and and increase the tab value in loop, like ind = 3 ,4, or 5..).

Regards,

Krishna

Read only

former_member598305
Participant
0 Likes
2,635

I Guess its not possible.

Read only

Former Member
0 Likes
2,635

Hi Bernsen,

Could you please explain why would you need this loop? maybe we can look for a work around or an altrenative.

Read only

0 Likes
2,635

hi Arulmani,

An alternative is not hard to find. In program lines I create a dummy table with as many records in it as loops i need.and then loop over this table.

But i think in smartforms it must be possible to loop with out intranal tables. There must be a reason why there is a checkbox for using internal tables or not. i do expect SAP will create useless buttons for this in such a important transaction.

So i hope still for an alternative WITHOUT internal tables.

Read only

0 Likes
2,635

Hi Bernsen,

Unchecking the check box is used when we print  texts using a Table format (instead of using a template). In that case , since  Looping an internal table is not needed, we can uncheck the check box.

Thats the purpose for that check box.  (i.e. to avoid looping )

Using this for Looping (without internal table)  seems not possible with the check box field since it is meant to either enable or disable a Loop. 

So maybe we can look for the alternative.

Read only

Former Member
0 Likes
2,635

Ever found a solution for your issue?

I would like to do the same.

Read only

0 Likes
2,635

No, Sorry

Read only

0 Likes
2,635

You could create a template for 5 lines, and if less are required then you hide the remaining with some conditions (of course that only works for a relatively limited maximum amount of lines). Not a perfect solution, and it only works if you know the maximum up front..

Read only

0 Likes
2,635

Hi Patrick,

as i also mentioned before. There are workarounds, but you still need a (dummy) internal table.

Regards,

Read only

0 Likes
2,635

I don't see where the internal table is needed for my solution Frank. But since I guess the question was related to this thread , the issue is solved already.

Read only

0 Likes
2,635

Hi Patrick,
I know that in your work around there is no internal table. But the issue is to use the loop with the internal table button UNchecked.
I keep on hoping that anyone can explain me how to use it that way.