on 01-06-2010 11:29 AM
Hello All,
I have a smartform, and in the print program i have included the SF FM in loop ...end loop.
Now the problm is that if the loop passes for 5 times i am getting the print preview dialog box for 5 times.. but i want that print preview dialog box only once.. how can we acheive that.
i know it is not a good idea to put hte SF FM in loop,... but i have no option for my req... so i had gone with that loop .. endlop..
please help me with a quick solution
Thanks in Advance
hi
why is not good idea? it's not true
All u need to do is just to open/close the spool once and show the dialog at the beginning.
That means after the first calling u need to transfer the same print data to the following calls:
DESCRIBE TABLE ITAB LINES TOT_LINES.
LOOP AT ITAB.
IF SY-TABIX = 1.
* Dialog at first loop only
CONTROL_PARAMETERS-NO_DIALOG = SPACE.
* Open the spool at the first loop only:
CONTROL_PARAMETERS-NO_OPEN = SPACE
* Close spool at the last loop only
CONTROL_PARAMETERS-NO_CLOSE = 'X'.
ELSE.
* Dialog at first loop only
CONTROL_PARAMETERS-NO_DIALOG = 'X'.
* Open the spool at the first loop only:
CONTROL_PARAMETERS-NO_OPEN = 'X'.
ENDIF.
IF SY-TABIX = TOT_LINES.
* Close spool
CONTROL_PARAMETERS-NO_CLOSE = SPACE.
ENDIF.
CALL FUNCTION <SMARTFORM
EXPORTING
CONTROL_PARAMETERS = CONTROL_PARAMETERS
OUTPUT_OPTIONS = OUTPUT_OPTIONS
........................
IMPORTING
JOB_OUTPUT_OPTIONS = JOB_OUTPUT_OPTIONS
........................
* the same output options for all:
MOVE-CORRESPONDING JOB_OUTPUT_OPTIONS TO OUTPUT_OPTIONS.
ENDLOOP.
Max
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
When you are calling the smartform FM,
there is one parameter
CONTROL_PARAMETERS.
Inside that there is one field NO_DIALOG
Just make this as 'X',
when you call the FM 2nd time and onwards.
regards,
amit m.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
using no dialog, you can achieve this, but it will generate 5 spools.
You can also use NO_OPEN and NO_CLOSE from CONTROL_PARAMETERS.
like this:
LOOP...
MOVE 'X' TO CONTROL_PARAMETERS-NO_OPEN.
MOVE 'X' TO CONTROL_PARAMETERS-NO_CLOSE.
AT FIRST.
CLEAR CONTROL_PARAMETERS-NO_OPEN.
ENDAT.
Call Smartform...
AT LAST.
CLEAR CONTROL_PARAMETERS-NO_CLOSE.
ENDAT.
ENDLOOP.
Regards,
Frisoni
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.