Smartform in priprinted format
Dear Expert
Here I have develop a smartforms for excise invoice, but there is requirement for print the smartform in pri printed format , please tell me how can i do this.
With Best Regards
Girdhari Mondal
Hi,
Check below links to get some idea:
[Printing on Preprinted form with EPSON LQ300 & EPSON LQ500 dot matrix print;
[Vertical Ruler and Preprinted Forms;
[preprinted form;
BR
Dep
Similar Messages
-
Convert Smartform in PDF format and send to SAP Workplace
Hi to all.
I need help of somebody expert in SMARTFORM's.
I need to convert a smartform into PDF format and to send as attachement for SAP workplace
of the user.
I developed the next code.
IT is to function and to send the mail for SAP workplace, but it happens that smartform
contains images (logos) and tables, when the user tries to open the file pdf in inbox gives
to error - "An unrecognized token ' q0 ' was found".
I tried to call a smartform only with text and functioned well.
Somebody can help me?
My code:
Begin ***********************************************
REPORT zteste_nsa_send_pdf_sap_office.
DATA: t_print LIKE zeps_fm04 OCCURS 0 WITH HEADER LINE,
v_size TYPE i.
DATA: ls_bil_invoice TYPE lbbil_invoice.
TABLES: nast.
DATA: i_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
i_tline TYPE TABLE OF tline WITH HEADER LINE,
i_receivers TYPE TABLE OF somlreci1 WITH HEADER LINE,
i_record LIKE solisti1 OCCURS 0 WITH HEADER LINE,
Objects to send mail.
i_objpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
i_objtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE,
i_objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE,
i_reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
Work Area declarations
wa_objhead TYPE soli_tab,
w_ctrlop TYPE ssfctrlop,
w_compop TYPE ssfcompop,
w_return TYPE ssfcrescl,
wa_doc_chng TYPE sodocchgi1,
w_data TYPE sodocchgi1,
wa_buffer TYPE string,"To convert from 132 to 255
Variables declarations
v_form_name TYPE rs38l_fnam,
v_len_in LIKE sood-objlen,
v_len_out LIKE sood-objlen,
v_len_outn TYPE i,
v_lines_txt TYPE i,
v_lines_bin TYPE i.
START-OF-SELECTION.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZFPS_FICHA_VALORIZACAO'
IMPORTING
fm_name = v_form_name
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.
w_ctrlop-getotf = 'X'.
w_ctrlop-no_dialog = 'X'.
w_compop-tdnoprev = 'X'.
CALL FUNCTION v_form_name
EXPORTING
control_parameters = w_ctrlop
output_options = w_compop
user_settings = 'X'
is_bil_invoice = ls_bil_invoice
is_nast = nast
is_repeat = 'X'
IMPORTING
job_output_info = w_return
TABLES
t_list = t_print
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_otf[] = w_return-otfdata[].
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
bin_filesize = v_len_in
TABLES
otf = i_otf
lines = i_tline
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
OTHERS = 4.
IF sy-subrc EQ 0.
ENDIF.
Convert PDF from 132 to 255.
LOOP AT i_tline.
TRANSLATE i_tline USING '~'.
CONCATENATE wa_buffer i_tline INTO wa_buffer.
ENDLOOP.
TRANSLATE wa_buffer USING '~'.
DO.
i_record = wa_buffer.
APPEND i_record.
SHIFT wa_buffer LEFT BY 255 PLACES.
IF wa_buffer IS INITIAL.
EXIT.
ENDIF.
ENDDO.
SEND MAIL
REFRESH: i_reclist,
i_objtxt,
i_objbin,
i_objpack.
CLEAR wa_objhead.
Object with PDF.
i_objbin[] = i_record[].
Object with main text of the mail.
i_objtxt = 'Fichas de Valorização e Esquemas Tipo'.
APPEND i_objtxt.
Document information.
wa_doc_chng-obj_name = 'SMART'.
wa_doc_chng-expiry_dat = sy-datum + 10.
wa_doc_chng-obj_descr = 'Ficha de Valorização'.
wa_doc_chng-sensitivty = 'F'. "Functional object
wa_doc_chng-doc_size = ( v_lines_txt - 1 ) * 255 + STRLEN( i_objtxt ).
Pack to main body as RAW.
Obj. to be transported not in binary form
DESCRIBE TABLE i_objtxt LINES v_lines_txt.
READ TABLE i_objtxt INDEX v_lines_txt.
CLEAR i_objpack-transf_bin.
i_objpack-head_start = 1.
i_objpack-head_num = 0.
i_objpack-body_start = 1.
i_objpack-body_num = v_lines_txt.
i_objpack-doc_type = 'RAW'.
APPEND i_objpack.
Packing as PDF.
Obj. to be transported in binary form
DESCRIBE TABLE i_objbin LINES v_lines_bin.
READ TABLE i_objbin INDEX v_lines_bin.
i_objpack-transf_bin = 'X'.
i_objpack-head_start = 1.
i_objpack-head_num = 0.
i_objpack-body_start = 1.
i_objpack-body_num = v_lines_bin.
i_objpack-doc_type = 'PDF'.
i_objpack-obj_name = 'SMART'.
CONCATENATE 'Ficha_Valorizacao' '.pdf' INTO i_objpack-obj_descr.
i_objpack-doc_size = ( v_lines_bin - 1 ) * 255 + STRLEN( i_objbin ).
APPEND i_objpack.
e-mail receivers.
CLEAR i_reclist.
i_reclist-receiver = sy-uname.
i_reclist-rec_type = 'B'.
i_reclist-express = 'X'.
APPEND i_reclist.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = wa_doc_chng
put_in_outbox = 'X'
commit_work = ' '
TABLES
packing_list = i_objpack
object_header = wa_objhead
contents_bin = i_objbin
contents_txt = i_objtxt
receivers = i_reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
IF sy-subrc EQ 0.
ENDIF.
End *************************************************
Thanks very much to all and Happy New year...
NelsonPlease check this link...
[http://help.sap.com/saphelp_nw04/helpdata/en/27/67443cc0063415e10000000a11405a/content.htm|http://help.sap.com/saphelp_nw04/helpdata/en/27/67443cc0063415e10000000a11405a/content.htm]
-Muktar -
How to send output of smartform in pdf format as an attachment to email
how to send output of smartform in pdf format as an attachment to email
search before posting further and follow Forum rules
Edited by: Vijay Babu Dudla on Jan 15, 2009 4:50 AMDid u check on sdn?
i dont think so or else there are many posts on this topic and good wikis too.
look at one of these code tutorial wiki
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/mail%2bsend%2bthrough%2boutput%2bcontrols
So next time do use the search functionality.
кu03B1ятu03B9к
Edited by: kartik tarla on Jan 15, 2009 12:33 PM -
Hi All,
Can anyone send me the sample code for attaching a SmartForm in PDF Format.
Thanks in advance.
Ulhashi,
check this
http://www.****************/Tutorials/Smartforms/OTF2PDF.htm -
VF01- invoice smartform in PDF format to be sent thro' mail
Hello Gurus,
We have a requirement from our client that we need to trigger a mail of invoice smartform in PDF format on saving in VF01.
Can any body suggest the steps in NACE and also output..
RegardsAs per your post, I understood that,
After saving Invoice , automatically Invoice has to send in PDF format to the respective email id maintained in CMR-Payer master
if yes, this involves ABAP & BASIS ,
ABAP- Program & FOrm routine has to created & assigned in respective output type & type-PDF (Check in NACE- Output type)
for this, you need to maintain the Condition record- VV31 - with medium as "Mail" -
or else,
you can do this manually also, in VF31- you can give a print & save in PDF format- you can send it - but its complete manual process. -
DOWNLOAD SMARTFORM IN TXT FORMAT
NORMALLY WE DOWNLOAD SMARTFORM IN PDF FORMAT BUT I HAVE REQUIREMENT TO DOWNLOAD IN TEXT FORMAT.
PLEASE HELP.
<MOVED BY MODERATOR TO THE CORRECT FORUM>
Edited by: Alvaro Tejada Galindo on Jul 24, 2008 6:24 PMwhen you generate the spool you can down load that in txt format
Function is used RSPO_DOWNLOAD_SPOOLJOB when you want to do that programatically.
Using the spool number, and provide the path where you want to down load that time mention the name
C:\smart.txt
it will be downloaded . -
Hi Guru's,
Please help me.
I want to display Smartforms in HTML Format.
i.e when I run my Tcode inspite of Print Preview the data should open in HTML Format.
Thanks in Advance.Chk this..
http://help.sap.com/saphelp_nw04/helpdata/EN/59/cd7da407d711d5b66f006094192fe3/content.htm
Re: FM for conversion of graphical display of spool to html
Regards,
Midhun Abraham
Edited by: Midhun Abraham on Oct 11, 2008 9:35 AM -
Hi all,
I have requirement like attach Smartform into Purchase order .
So that i want to convert Smartform to BIN format.
How to do this.
Thanks in advance.
Regards,
Arun.Hi all,
I have requirement like attach Smartform into Purchase order .
So that i want to convert Smartform to BIN format.
How to do this.
Thanks in advance.
Regards,
Arun. -
Hi, I have converted different smartforms to pdf format.How to combine pdf?
Hi All,
I have converted different smartforms to pdf format. How to combine all the pdf's into single pdf.
I need all the smartforms to be in single pdf.
Please help me in this regard.
Thanks in advance.Hi Keshu,
Individual pdf should be sent to individual user.
And at last all the pdfs of the smartform should be combined into one.
And admin have the provision to download it .
I mean the requirement is
For example.
For the month of september i will generate Pay Slip to each employee. And each pdf will be send to corresponding employee.
And finally all the pay slips of all the employees will be combined into single PDF and admin will download it and keep it for reference.
So as of now. I have generated individual pdfs and mailed it accordingly.
But how to combine it into one PDF is my question.
Please help me in this regard.
Thanks in advance. -
Displaying a smartform in pdf format using webdynpro
Hi,
I have created a smartform using t.code smartforms. I have created a function module within which i used the function mocule convert_otf which will convert the smartform into binary format. Now how do i proceed in displaying the form using web dynpro.
Plz give me your suggestions.
Thanks in advance.CALL FUNCTION LV_FUNC_MOD_NAME
EXPORTING
CONTROL_PARAMETERS = LS_SSFCTRLOP
OUTPUT_OPTIONS = LS_OUTPUT_OPTIONS
USER_SETTINGS = ' '
RRNUM = IM_RRNUM
IMPORTING
JOB_OUTPUT_INFO = LT_RETURN
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.
IF SY-SUBRC <> 0.
ENDIF.
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
FORMAT = 'PDF'
MAX_LINEWIDTH = 132
IMPORTING
BIN_FILESIZE = LV_LENGTH
BIN_FILE = LV_XSTRING
TABLES
OTF = LT_RETURN-OTFDATA
LINES = LT_TLINE
EXCEPTIONS
ERR_MAX_LINEWIDTH = 1
ERR_FORMAT = 2
ERR_CONV_NOT_POSSIBLE = 3
ERR_BAD_OTF = 4
OTHERS = 5.
IF SY-SUBRC <> 0.
ENDIF.
LV_FUNC_MOD_NAME is your smartform function module name.
LV_XSTRING contains the stream of the pdf , send this to the browser using the following code.
LV_FILENAME = 'RebateRequest.pdf'.
LV_CTYPE = 'pdf'.
CL_WD_RUNTIME_SERVICES=>ATTACH_FILE_TO_RESPONSE(
EXPORTING I_FILENAME = LV_FILENAME
I_CONTENT = LV_XSTRING
I_MIME_TYPE = LV_CTYPE
I_INPLACE = ABAP_TRUE
I_IN_NEW_WINDOW = ABAP_TRUE ).
Abhi -
if i need the change the date format according to country how can i do it
( i.e ) I am creating a smartform, the date format i use is normally dd/mm/yyyy
if the same smartform is printed in some other country( using format yyyy/mm/dd or any format)
i want my date format to change based on where it is printed.
In SAPScripts there is a command SET COUNTRY.
Can I use this command for my requirement. If so How?hi check this referred link and do the coding accordinly...please search before you post ..
Country specific date format
and try this C14N_COUNTRY_DATE_DECF_GET too
Edited by: Venkat Appikonda on Jan 28, 2009 12:37 PM -
HI Experts,
How do I dispaly my smartforms in PDF format. How do I get Spool ID. where all the changes I have to made. plz describe properly.
Thanks. Alot.
KhanHi
You will get the Spool ID in the Fun module itself (in SE38 program)
in the output paramters <b> DOCUMENT_OUTPUT_INFO =</b> or
<b>JOB_OUTPUT_INFO =</b> take that
call function 'SSF_FUNCTION_MODULE_NAME'
exporting
formname = 'ZSMARTFORM'
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
FM_NAME = FM_NAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
if sy-subrc <> 0.
WRITE: / 'ERROR 1'.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
call function FM_NAME
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS =
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS =
USER_SETTINGS = 'X'
IMPORTING
<b>* DOCUMENT_OUTPUT_INFO =</b>
<b>JOB_OUTPUT_INFO =</b>
JOB_OUTPUT_OPTIONS =
TABLES
GS_MKPF = INT_MKPF
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.
and pass that spool ID to the fun module
call function 'CONVERT_ABAPSPOOLJOB_2_PDF'
exporting
src_spoolid = spoolid
no_dialog = 'X'
importing
pdf_bytecount = pdf_fsize
tables
pdf = pdf_table
exceptions
others = 0.
Now PDF data is in PDF_TABLE
so download it using GUI_DOWNLOAD and send it to your mail ID
<b>Reward points for useful Answers</b>
Regards
Anji -
Converting a Smartform to ZPL format
Hi,
i'm facing the following Problem: i need to convert a smartform into zpl format.
I don't need to print the smartform on a ZPL printer by using SAP standard procedure, i need the Smartform in ZPL as a "string" to send it by RFC to a specified destination (where the ZPL will be printed, finally).
Thanks for your support,
greeting HannesHello Hannes,
there is actually a Smart Forms driver for Zebra label printers built into SAP. Device types LZEB2, LZEB3, LZEB6 use it (there are also other LZEBx device types, check out SAP notes for the differences).
You should first try if you can generate suitable output for your Zebra label printer from the Smart Form, via "normal" printing from SAP (i.e. via the SAP spooler and a connected Zebra printer).
If this works, then there is a way to solve this. What you need to do is: create the spool request from your print program via SMart Forms, but not print it (i.e. immediate print = FALSE). Remember you do need a valid printer definition in SAP for this, because Smart Forms needs one to generate the spool request.
Function module RSPO_PROCESS_DIALOG_JOB allows you to have your current ABAP program process the spool request (as if it was an SPO spool process), but not send anything to the printer but instead write the print data into a file on the application server. You can then use OPEN DATASET ... READ DATASET...CLOSE DATASET to retrieve the print data (make sure you use binary mode, so as to not modify the print data) and do whatever you want with it.
Best regards,
Alexander -
Generating Smartform in PDF Format through SRM portal link
Hi All,
Please can one tell me generating Smartform in PDF format while we click on Output-format while displaying Purchase order.
Is there any configuration needed or is there any process to generate smartform in SRM portal link.
Thanks,
Sri LakshmiHi Pradeep,
Thanks for your reply.
I dont want any BADI or Method.
I want to know, when we display or create Purchase Order through SRM link- there is an option Output format where the details of PO will be generated through Smartform in PDF format.
I want to know the procedure how that PDF format is generating.
Regards,
Sri Lakshmi -
Smartform -Network printer format Issue
Hi,
I can print fine using my YPCC default printer.
But When i do through network printer FORMAT is getting Disturbed( Values are printing in next line).How can we handle this? Do we need to do some driver program modifications?
Here are the parameters in Driver program
CALL FUNCTION fm_name
EXPORTING
archive_index = toa_dara
archive_index_tab = arc_ind_tab
archive_parameters = arc_params
control_parameters = ls_control_param
mail_appl_obj = ls_recipient
mail_recipient = ls_recipient
mail_sender = ls_sender
output_options = ls_composer_param
user_settings = space
wa_itab = wa_header
IMPORTING
document_output_info = document_output_info
job_output_info = job_output_info
job_output_options = job_output_options
TABLES
wa_dep = item_itab
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4.
IF sy-subrc <> 0.
WRITE: / 'ERROR in passing vars to the smartforms '.
ENDIF.
ls_composer_param-tdnewid = space.
ls_control_param-no_dialog = 'X'.YOu need to modify the smartform not the driver program to print all lines the way you want by changing font size, reducing line length...etc..etc..
It's printing fine on the default PC printer, because, it uses windows printer driver to render the output, where as SAP network printer uses SAP printer driver to generate the printer commands, there's always difference in the output between the two drivers.
Regards
Sridhar
Maybe you are looking for
-
Experts, Could you please let me know what are the accounts impacted during OTC cycle and also the integration points of FI with SD. Points always rewarded if helpful. Thank you
-
Getting PDF filename with unicode chars
Hello, I'm trying to write a plugin that gets the file path of the current active document. The code looks like this: AVDoc avDoc = AVAppGetActiveDoc(); PDDoc pdDoc = AVDocGetPDDoc(avDoc); ASFile file = PDDocGetFile (pdDoc); ASPathName filePath = ASF
-
how to protect a jar file so that no one can de -jar the class files from it please suggest.. thanks..
-
Can I create a dynamic dictionary object in WF using SPD?
I am creating a list of task in a loop. I need to store the taskIDs in a dictionary object. How can I do this? The loop looks like: Loop N times-->Create a task-->Add Task1-TaskID to Dictionary object-->Loop Example of how the dictionary object shoul
-
Share Ovi - Images original size on the embed code
Everytimg I upload images on my Share on Ovi account ("chaplin") I upload multiple files so I can keep the original size of the images, but then when I copy the embed code it is only available in a very small size and I can't make it bigger. Isn't it