on 09-18-2008 2:17 PM
Dear fellow ABAPers
I've created a SMARTFORM with one page and the next page is itself.
i need to make a loop with in a loop. The outer loop is based on the number of entries in the internal table passed in the FM, within that ,the inner loop is based on a value in a field in the structure of outer loop.
ie DO <n> times....ENDDO within a LOOP...ENDLOOP.
<n> will flow from the field in the outerloop.
my SF structure is
First page
Main window
Loop1
Loop2
Text
for evey iteration of DO a new page to be triggered and details to be printed.
Please give me a solution
Regards
Prabumanoharan
in the main window you have your first loop. table node or loop node.
within this node you create your second loop, also a table node or a loop node.
when the second loop is finished put a command node with page-break.
this should work.
Regards,
Guido
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all
Thanks for all ur answers
I've solved that issue , the method i followed is as follows
first loop is based on the number of entries
second loop has to pass <n> times based on a value from the first loop..
in first loop i've inserted a program line and populated a new internal table with <n> records using DO...ENDDO
under the LOOP1 (after command) , created LOOP2 and looped it based on the new internal table
since the (main) window can print only contents of one page, it gave me required number of pages.
i don't know whether this approach is efficient enough, but it solved my problem .
Regards
Prabumanoharan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
wt i understand from your requirement is ,
You have to create 'n' pages and details on each page.
For this try this.
1. Declare var as 1.
Create loop or table node with rows 0 to n.
create command node with condition var > 1. "In main area of table.
*for first time it wil not create page and print on first page itself.
create code .
var = var + 1.
2. Second loop.
Print all details.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
declare two variables in global definitions...
one for capturing the lines in the outer loop internal table
and the second one a counter variable
main window
create program code node -> capture the number of lines in the variable using describe table stmt.
loop -> outer loop.
create program code node... increment the counter variable
loop -> inner loop
after the inner loop--> create command node and in the field condtions
specify the condition
counter variable < total lines
regards
padma
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
After your LOOP2, you can introduce the Control Node. Set the Control node to go on your desired page.
Regards,
Naimesh Patel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.