01-03-2014 2:26 PM
Hi Experts,
During a loop, say:
LOOP 5 times.
CALL SMARTFORM
ENDLOOP.
When a smartform is called, why doesn't it return/proceed to the next iteration? Does the call of a smartform indicate End of Program? Why, and how so?
Thanks in advanced.
01-06-2014 9:52 AM
Dear Jack,
The next iteration of the smartform will be processed after you press the BACK button.
To skip this and bring all the iterations in a single spool with multiple pages, you need to use
NO_OPEN and NO_CLOSE additions of the Control Parameter which you are passing to Smartform.
On first iteration, it should be set like below,
control_param-no_open = ' '.
control_param-no_close = 'X'.
On last iteration it should be set like below,
control_param-no_open = 'X'.
control_param-no_close = ' '.
And for the remaining iterations, it should be set like below,
control_param-no_open = 'X'.
control_param-no_close = 'X'.
This will create all the iterations in a single spool with multiple pages.
01-03-2014 2:52 PM
Hi,
please look at program SF_EXAMPLE_03.
note the use of functions 'SSF_OPEN','SSF_CLOSE'.
Regards.
01-03-2014 3:00 PM
I'm aware of these FMs. What I would like to know is why it isn't the same with:
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
CALL FUNCTION FMNAME. - Does this part immediately indicate end of program? when not matched with SSF OPEN and CLOSE?
01-03-2014 6:10 PM
I wrote programs before where Smartform(s) were called in a loop using the CALL FUNCTION <FMNAME>, never had any issues.
You might want to be more specific, e.g. post the actual code and what exactly is happening in debugger.
01-04-2014 3:23 AM
Hello Jack.
Call to a smartform does not terminate the calling program. Control will return back.
You can test it by yourself by setting a BREAK-POINT after the loop.
Regards.
01-04-2014 4:45 AM
Hi Jack,
irrespective of looping on your smartforms, i don't know how you have done it, as once you are
in smartforms, then how again you will back to your driver program again.
Anyhow, i will sujjest you to drop the concept of looping on your smartform, and within smartform
call your smartform as many times you wants by writing these code lines within smartforms.
DESCRIBE TABLE it_tab LINES v_count.
where you have to declare v_count as i, and it_tab will have the internal table in which your data
has been fetch for as many times you wants to run your smartforms.
01-04-2014 7:36 AM
Hi,
Allow me to disagree the concept is working very well.
Some debugging is in order that is all.
And please look at program SF_EXAMPLE_03.
Regards.
01-04-2014 4:59 AM
Hi Jack -
Please press the 'Back' Button once you have the Print Preview (if you are seeing the preview), it will go to next iteration.
OR please put a break point on the loop and 'Back' Button once you have the Print Preview. You will see the iteration.
Let us know for further help.
Regards,
Atul Mohanty
01-04-2014 7:46 AM
Jack
What happens when you execute smartform is displayed and when you press back button what happens?? Next smartform is called or not??
Nabheet
01-04-2014 11:17 AM
Hi Jack,
did you already try the smartform trace as offered by transaction SMARTFORM_TRACE or SFTRACE and documented in SAP Library - Information System Administration.
I remenber when there is not enough space in an output cell structure for a specific value, processing is finished without any message. As you might expect from any quality software 🙂
Regards
Clemens
01-06-2014 9:52 AM
Dear Jack,
The next iteration of the smartform will be processed after you press the BACK button.
To skip this and bring all the iterations in a single spool with multiple pages, you need to use
NO_OPEN and NO_CLOSE additions of the Control Parameter which you are passing to Smartform.
On first iteration, it should be set like below,
control_param-no_open = ' '.
control_param-no_close = 'X'.
On last iteration it should be set like below,
control_param-no_open = 'X'.
control_param-no_close = ' '.
And for the remaining iterations, it should be set like below,
control_param-no_open = 'X'.
control_param-no_close = 'X'.
This will create all the iterations in a single spool with multiple pages.
01-06-2014 10:13 AM
hello jack ,
if u r internal table having 20 records u r calling the smart form with in loop it will print 20 times
but each time u have to give the printer name and printing mode after print print privew are print u again interactively go back for each loop iteration.
if u want to print 20 line items in one time u should create the single spool
for this u have to pass the control parameters to the smart forms that already explained by
davisraj and also see the bellow code
loop at itab .
AT FIRST.
lv_controlparms-no_open = ' '
lv_controlparms-no_close = 'x '
ENDAT.
Lv_controlparms-no_open = 'X'.
Lv_controlparms-no_close = 'X'.
ATLAST.
lv_controlparms-no_open = ' X'
lv_controlparms-no_close = ' '
ENDAT
call function " ur form name "
endloop.
Regards ,
Pramodh.
01-06-2014 11:39 AM
As already mentioned by many here .
The reason is that One form ( Smartform Print Command ) is called into one print request until and unless you explicitly provide conditions to include several forms into one print request
Control Structure (SAP Library - Smart Forms)
Printing Several Forms in One Print Request (SAP Library - Smart Forms)
These two links will brief you the idea.