on 03-25-2008 5:40 AM
Hi All,
I have a requirement to print a form and Ive chosen to use smartforms but I dont know how to implement it.
I'll be passing a table to the smartforms but the requirement is to print one form for each line item in the table. So if there are 4 line items in the table, there will be 4 identical forms generated with different values.
How do I go about this?
Please help.
Thanks.
Tyken
Hi,
You can call the smartform in a loop for Total Number of items times. So now u can pass only single line to the smartform each time.
awrd points if useful
Bhupal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Following are some poin ts to be copnsidered when you print miltiple forms at a time.
1) when you give for printing theys should be in one spool because when you give for direct printing they may appear in different spools
2) when you see the print preview they should appear one below the other
In print preview you cant see all at a time . like If you give it for print priview first it will display first form and when you go on pressing back button it will display one by one . To avoid this write the following code.
DESCRIBE TABLE it_mdocm LINES v_lines.
LOOP AT it_mdocm INTO wa_mdocm.
IF sy-tabix EQ 1.
wa_ssfctrl-no_open = space.
wa_ssfctrl-no_close = c_x.
ELSEIF sy-tabix EQ v_lines.
wa_ssfctrl-no_open = c_x.
wa_ssfctrl-no_close = space.
ELSE.
wa_ssfctrl-no_open = c_x.
wa_ssfctrl-no_close = c_x.
ENDIF.
IF p_pv = c_x.
wa_ssfctrl-preview = c_x. " printpreview required ( I think this you dont need)
ENDIF.
wa_ssfctrl-device = 'PRINTER'. " Device
wa_ssfctrl-no_dialog = c_x. " Dialog
wa_ssfctrl-langu = sy-langu. " langauage
CALL FUNCTION v_func_mod_name
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
control_parameters = wa_ssfctrl
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
output_options = x_output_options
user_settings = space
mdocm = wa_mdocm-mdocm
point = wa_mdocm-point
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO =
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.
endloop.
Reward points if useful.
Regards,
Nageswar
Hi,
Firsty... what data are you displaying? is it Sales order data?
Will your line items be unique or will you have mulitple data for same line item?
Firstly take all items in an internal table say it_itab.
Now in your printer program
Loop at it_itab into st_itab.
CAll your smartform here.
Endloop.
Scenario 1 : Unique line item..
In your smartform, in the main window, display this header string by creating a template in your main window
I wuld use a template since your data is fixed.
Scenario 2 :
But in the scenario where you have multiple lines for a single item..then go for a table in your smartform.
Manipulate your data in the printer program to send a table with similar line item number to the smartform and use a table in main window to display this data.
Please let me know if you need more help.
Regards,
Soumya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Simply you can put your smartform funciton module with in LOOP AT ITAB...... ENDLOOP. Then you requirement will fulfill.
Thanks,
shyla
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
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.