2007 Jul 27 8:08 AM
hi experts,
I have a typical requiremnt .i need to get some numbers during section screen .i have created a smartform with a table in it .according to the number i have selected at selection screen .the tables should be printed that much times .how to do this.?
hi experts,
I have a typical requiremnt .i need to get some numbers during section screen .i have created a smartform with a table in it .according to the number i have selected at selection screen .the tables should be printed that much times .how to do this.?
2007 Jul 27 8:12 AM
Use DO-ENDDO loop.
e.g.
DO # OF TIMES VARYING info-ocd
FROM MY-ocd01
NEXT MY-ocd02
VARYING info-odt
FROM MY-odT01
NEXT MY-odT02
VARYING info-otm
FROM MY-otm01
NEXT MY-otm02 .
Regards,
Amit
Reward all helpful replies.
2007 Jul 27 8:28 AM
2007 Jul 27 8:12 AM
Hi,
While looping for smart form write the condition as follows.
<b>IF <Value from selection screen> = SY_TABIX.
EXIT.
ENDIF.</b>
This will exit from the loop.
Regards,
Ranjit Thakur.
<b>Please Mark The Helpful Answer.</b>
2007 Jul 27 8:15 AM
where to write this code ranjith .
in table DATA or
in table conditions
mani
2007 Jul 27 8:30 AM
Hi Manikandan,
While you are calling the SMARTFORM, you can pass the Number that you select in the selection screen as one of the parameters.
Now in SMARTFORMS, display the TABLE.
Use PROGRAM LINES.
Initialize a counter variable. Put a DO ENDDO loop for the Number selected in selection screen of your program.
Introduce COMMAND where you can set a condition like IF Counter <= (Number selected in selection scren), call NEXT PAGE.
This would help you print the table, number of times according to the n umber selected.
<b>Reward points for useful answers.</b>
Best Regards,
Ram.
Hope this solves your issue.
<b>Reward for informatory answers.</b>
Best Regards,
Ram.
2007 Jul 27 8:59 AM
ram upto table lines it is working properly .
no of times i have given 3 .so it goes 3 times and counter also becomes 3 .but the window is displaying only once .
pls tell me what to do in command line .
in condition tab i have given
fieldname = c(my counter variable)
comparison value = times (the number i have given in selection screen )
in general attributes i have ticked the options for next page .
i have copied first page and pasted as second page .
whjat else to do?
2007 Jul 27 9:25 AM
Hi Manikandan,
The flow would be like this:
MAIN WINDOW
FIRST PAGE
1. Print the Table lines - First Time
2. Once you print the table, in PROGRAM LINES - Increment the counter (Initialized variable) by ONE. Here check if it less than or Equal to Varaible(Selection screen number) before initializing.
3. Now using COMMAND LINES - in condition tab check if Counter <= Variable(Selection screen number). If yes, then GOTO NEXT PAGE.
4. In MAIN WINDOW or FIRST PAGE Attributes (Am not sure), the NEXT PAGE option is available. Here also you need to default it to the same page again, So that the same page appears again.
This would be the object flow. Try few things out here and you should be able to print the tables with out any issues.
If you are still not very clear about the flow, please try SFTRACE - this will help you to DEBUG the smartform which would help you inturn to know whats happening exactly (Object Flow) when it is getting executed.
For help on SFTRACE
http://help.sap.com/saphelp_erp2004/helpdata/en/49/c3d8a4a05b11d5b6ef006094192fe3/frameset.htm
Hope this helps you solve the issue.
<b>Reward points for helpful answers.</b>
Best Regards,
Ram.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |