2014 Dec 02 9:44 AM
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.
2014 Dec 02 10:05 AM
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
2014 Dec 02 11:07 AM
2014 Dec 02 11:53 AM
Hi Bernsen,
Could you please explain why would you need this loop? maybe we can look for a work around or an altrenative.
2014 Dec 02 12:10 PM
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.
2014 Dec 02 12:50 PM
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.
2016 Mar 15 12:22 PM
Ever found a solution for your issue?
I would like to do the same.
2016 Mar 15 12:38 PM
2016 Mar 15 1:10 PM
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..
2016 Mar 15 1:15 PM
Hi Patrick,
as i also mentioned before. There are workarounds, but you still need a (dummy) internal table.
Regards,
2016 Mar 15 2:51 PM
2016 Mar 15 2:58 PM
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.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |