on 06-26-2008 12:49 PM
i hav two pages in a smartform and
i want to repeat these two pages based on customer no:
how it is possible?
Hi
You can use break point incase you create multiple pages in smart forms but for your requirement i understood u need different pages for different customers i.e one single form prints for different customers this is called dynamically while you loop (in print program) it as i showed in that example.
But why do you need a command or page break here.
Once you call your smart form this way independently it prints for all the customers your loop executes in print program and for each customer each page is displayed. No need for your smart form to hold pages. The print prgram will take care.
Reward Points If helpful.
Swetha.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Follow This
Initially :
data: v_function type rs38l_fnam ,
wa_otf type ssfcrescl ,
i_otfdata type table of itcoo ,
i_otfdata2 type table of itcoo ,
v_function type rs38l_fnam.
1. CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = ''
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
FM_NAME = v_FUNCTION
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
2. *-- managing print parameters for the PDF output
wa_param-langu = sy-langu.
wa_param-no_dialog = 'X'.
wa_param-getotf = 'X'.
CALL FUNCTION v_FUNCTION
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS = wa_param
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS =
USER_SETTINGS = 'X'
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO = wa_otf
JOB_OUTPUT_OPTIONS =
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5
.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
refresh i_otfdata.
3. Here do this
i_otfdata = wa_otf-otfdata.
loop at i_otfdata into wa_otfdata.
append wa_otfdata to i_otfdata2.
clear wa_otfdata.
endloop.
This all to be done after your end of selection event.
4.call function 'SSFCOMP_PDF_PREVIEW'
EXPORTING
i_otf = i_otfdata2
EXCEPTIONS
CONVERT_OTF_TO_PDF_ERROR = 1
CNTL_ERROR = 2
OTHERS = 3.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
after each customer put a forceful page break..use the command node
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
You can do this by keeping one single smart form common and your print program loop around this form to print it for any number of customers.
In smartform dynamically pass your customer number.
Swetha
Edited by: Swetha on Jun 26, 2008 6:03 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Good morning!!
You must be using pdf output in order to print the output for 1 customer.
And there you must be passing OTF table. There you loop around the OTF internal table and append it into another inertnal table.
example:
data: v_function type rs38l_fnam ,
wa_otf type ssfcrescl ,
i_otfdata type table of itcoo ,
i_otfdata2 type table of itcoo .
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'Form Name'
IMPORTING
FM_NAME = v_FUNCTION
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION v_FUNCTION
EXPORTING
CONTROL_PARAMETERS = wa_param
OUTPUT_OPTIONS = wa_options
USER_SETTINGS = 'X'
IMPORTING
JOB_OUTPUT_INFO = wa_otf
TABLES
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
i_otfdata[] = wa_otf-otfdata[].
loop at i_otfdata into wa_otfdata.
append wa_otfdata to i_otfdata2.
clear wa_otfdata.
endloop.
If you look at the otf table iam looping it where this contains your pdf form with 1 customer when iam appending it the form is being printed for those many customers in individual pages.
Revert if you have doubts.
Have a nice day!
Swetha.
not getting ur requirement mate!!!!!!! pls elaborate
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.