05-15-2006 12:11 PM
Hello,
I have a loop node in which i am interating thru an internal table. I dont have a table node before this loop, so any calculation i have to do is in the loop node. I want to ask is how to iterate the loop only once ?
Thanks,
05-15-2006 12:15 PM
Hi shehryar,
If you want to execute this loop only one time then write this code
loop at itab.
// do your calculation here
if sy-tabix = 2.
exit.
endloop.
Ps reward points if helpful
Regards
Sumit Bhutani
05-15-2006 12:16 PM
05-15-2006 12:19 PM
hi use a flag and clear it
flag = 'x'.
if flag = 'x'.
loop
clear flag.
endloop.
endif
plz reward if useful
05-15-2006 12:23 PM
05-15-2006 12:29 PM
05-15-2006 12:20 PM
In the conditions tab.
YOu can specify the condition
sy-tabix = 1.
meaning that this node will be active for only that condition.
Regards,
ravi
05-15-2006 12:54 PM
if you are certain that u want one record (or you want to loop only once), then use READ statement instead of loop.
read table itab with key fi = a1
f2 = a2.
if sy-subrc eq 0.
< this means entry is found>.
endif.
05-15-2006 1:17 PM
Hi,
You can also use Loop with where condition.
The where condition on a primary key in the internal table can give you a single record.
Are you talking about a loop node in Smartforms?
Hope this helps,
Thanks,
Rashmi.
05-16-2006 7:48 AM
05-16-2006 7:52 AM
Hi,
can you set the result of the calculation in the structure that take the data of the internal table ?
(when you make a loop in smartforms, you set the data in a structure)
So you will have just to make a condition to didn't loop if the field where the calculation is made is empty or not.
Rgd
Frédéric
05-16-2006 8:23 AM
Hi,
Give the Line 1 to 1 in the data tab of the Loop Node or read the first line in the Program Lines Node and display it in Template Node.
Regards,
Arun.
05-15-2006 1:20 PM
Hi,
You can give 1 to 1 in ROW tab under the Internal Table in the DATA tab of the loop node.
Thanks and Regards,
Bharat Kumar Reddy.V