How to send converted PDF from OTF via email

Hi Experts,
Greetings! How can I send the PDF file from FM 'CONVERT_OTF' via email?
I was stuck on this code:
*--- Convert OTF data to pdf
  CLEAR: i_otf, i_pdf.
  i_otf[] = gs_ssfcrescl-otfdata.
  CALL FUNCTION 'CONVERT_OTF'
    EXPORTING
      format                = 'PDF'
      max_linewidth         = 132
    IMPORTING
      bin_filesize          = v_bin_filesize
    TABLES
      otf                   = i_otf
      lines                 = i_pdf
    EXCEPTIONS
      err_max_linewidth     = 1
      err_format            = 2
      err_conv_not_possible = 3
      err_bad_otf           = 4
      OTHERS                = 5.
  CHECK sy-subrc = 0 AND NOT i_pdf[] IS INITIAL.
Thanks in advance for the help.

Hi
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,
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.
DATA:
  W_OBJHEAD TYPE SOLI_TAB,
  W_CTRLOP TYPE SSFCTRLOP,
  W_COMPOP TYPE SSFCOMPOP,
  W_RETURN TYPE SSFCRESCL,
  W_DOC_CHNG TYPE SODOCCHGI1,
  W_DATA TYPE SODOCCHGI1,
  W_BUFFER TYPE STRING.
DATA:
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.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
  EXPORTING
    FORMNAME           = ' '---------> smartform
  IMPORTING
    FM_NAME            = V_FORM_NAME
  EXCEPTIONS
    NO_FORM            = 1
    NO_FUNCTION_MODULE = 2.
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 '/1BCDWB/SF00000482'
  EXPORTING
    CONTROL_PARAMETERS = W_CTRLOP
    OUTPUT_OPTIONS     = W_COMPOP
    USER_SETTINGS      = 'X'
  IMPORTING
    JOB_OUTPUT_INFO    = W_RETURN
  EXCEPTIONS
    FORMATTING_ERROR   = 1
    INTERNAL_ERROR     = 2
    SEND_ERROR         = 3
    USER_CANCELED      = 4.
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
  IMPORTING
    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
    ERR_BAD_OTF           = 4.
IF SY-SUBRC <> 0.
  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT I_TLINE.
  TRANSLATE I_TLINE USING '~'.
  CONCATENATE W_BUFFER I_TLINE INTO W_BUFFER.
ENDLOOP.
TRANSLATE W_BUFFER USING '~'.
DO.
  I_RECORD = W_BUFFER.
  APPEND I_RECORD.
  SHIFT W_BUFFER LEFT BY 255 PLACES.
  IF W_BUFFER IS INITIAL.
    EXIT.
  ENDIF.
ENDDO.
REFRESH :
  I_RECLIST,
  I_OBJTXT,
  I_OBJBIN,
  I_OBJPACK.
CLEAR W_OBJHEAD.
I_OBJBIN[] = I_RECORD[].
DESCRIBE TABLE I_OBJBIN LINES V_LINES_BIN.
I_OBJTXT = 'Find attached the output of the smartform.'.
APPEND I_OBJTXT.
I_OBJTXT = 'Regards,'.
APPEND I_OBJTXT.
I_OBJTXT = 'Sravanthi'.
APPEND I_OBJTXT.
DESCRIBE TABLE I_OBJTXT LINES V_LINES_TXT.
W_DOC_CHNG-OBJ_NAME = 'Smartform'.
W_DOC_CHNG-EXPIRY_DAT = SY-DATUM + 10 .
W_DOC_CHNG-OBJ_DESCR  = 'Smart form output'.
W_DOC_CHNG-SENSITIVTY = 'F'.
W_DOC_CHNG-DOC_SIZE = V_LINES_TXT * 255.
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.
I_OBJPACK-TRANSF_BIN = 'X'.
I_OBJPACK-HEAD_START = 1.
I_OBJPACK-HEAD_NUM = 1.
I_OBJPACK-BODY_START = 1.
I_OBJPACK-BODY_NUM = V_LINES_BIN.
I_OBJPACK-DOC_TYPE  = 'PDF'.
I_OBJPACK-OBJ_NAME = 'Smartform'.
CONCATENATE 'smartform output' 'pdf'
INTO I_OBJPACK-OBJ_DESCR.
I_OBJPACK-DOC_SIZE = V_LINES_BIN * 255.
APPEND I_OBJPACK.
CLEAR I_RECLIST.
I_RECLIST-RECEIVER = ' '.---------->email id
I_RECLIST-EXPRESS  = 'X'.
I_RECLIST-REC_TYPE  = 'U'.
APPEND I_RECLIST.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
  EXPORTING
    DOCUMENT_DATA              = W_DOC_CHNG
    PUT_IN_OUTBOX              = 'X'
    commit_work                = 'X'
  TABLES
    PACKING_LIST               = I_OBJPACK
   CONTENTS_BIN                = I_OBJBIN
    OBJECT_HEADER              = W_OBJHEAD
    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 NE 0.
      WRITE:/ 'Error When Sending the File', sy-subrc.
    ELSE.
      WRITE:/ 'Mail sent'.
    ENDIF.
After excuting this program check the status of the email in the SOST  transaction
Regards,
sravanthi

Similar Messages

  • How can I convert Pdf from RGB to CMYK, keeping font color 100% K while working in Illustrator?

    How can I convert Pdf from RGB to CMYK, keeping font color 100% K while working in Illustrator?
    When I try to open the document in Illustrator and I convert to CMYK the black font converts to rich black, but to set up for Offset printintg I need the text to be only in Black (100%K).
    The original source of the document is a Microsoft Word file, I have converted the Word file to Pdf in order to setup for OFfset Printing.
    Thanks

    I have tried that way, but the downside is that the fonts are set in gray not in a 100%K, also I have to deal with other fonts that are composites and meant to stay Full Color. I could select text by text and convert to gray but, its a 64 page document and I wouldn't want to make a expensive mistake.

  • Problem with converted PDF from OTF

    Hello,
    im having a problem with character interpretation in PDF document when i convert it from OTF.
    At the moment im using Arial true type font in my smartform, im using function module CONVERT_OTF to convert OTF to PDF.
    When i open PDF document with Adobe reader it looks fine, but the problem is when im trying to convert PDF file to other format for example PNG, or trying to copy and paste text from PDF document.
    im getting Klaipìda instead of Klaipėda, it seems that baltic symbol "ė" is interpreted like "ì", other baltic symbols are interpreted as they should, there is problem only with character "ė".
    have anyone faced that kindof problem? or maybe anyone know the solution for this problem? if so please tell me.
    Best regards,
    Rimantas Sebeckis.

    Hi Rimantus,
    Did you check the fonts installed in your system,,,
    As PDF is a unchangeable format, it doesnt depend upon the installed fonts in the system,,
    but when you copy, you need some fonts in system,, if not you will get the same problem,,,
    Thanks & regards,
    Dileep.C

  • How to send a document from pages in email

    Can u send a document from pages in email that can be opened by a PC.

    Ourdream wrote:
    even if I dont have word it can be sent as word?
    Yes, try Share > Send Via Mail

  • Sending my song from iTunes via email?

    I recently made a song on garageband and put it into my iTunes library, i added album artwork and all that stuff and i want to send it to someone via email. Does anyone know of a way to do that?

    Apart from what Chris CA has told, you can even add and attachment from your 'mail' app (if you are using it), then you can go to 'Music' in the sidebar and search for what you are looking for.

  • EA4500: how to send logs to syslog or via email?

    Hello,
    I absolutely need to collect the router logs and send them to a syslog daemon or via email.
    How xan I achieve that?
    Thanks

    The router does not have the feature where you can save the logs to a notepad, why not click on Open in Browser and then copy and paste the results to a notepad or wordpad so that you can go ahead and send it thru email.
    Please check link below how to enable logs in the router:
    Title: Enabling the Logs feature of the Linksys Smart Wi-Fi Router using local access
    Article ID: 26579

  • How to send more than one doc via email from Pages on iPad

    When sending a resume and a cover letter via Pages from my iPad, how do I send a second document via the same email?

    What fruhulda said. In addition, in the Mail composition window, I recommend that you select the paperclip icon from the Toolbar, and enable Send Windows-Friendly Attachments.
    You can also select multiple files in the Finder and drag them onto the composition window. In my experience, the documents resist an iconic state, so right-click on just one, and choose View as Icon from the contextual menu. This will transform all attached documents into icons.
    If you want to send just one document from within Pages v5, use the Share icon in the Toolbar and select Send a Copy > Email. You can then choose PDF (and its image quality), or Word (.docx default, or .doc) document formats that will be attached as an icon in a new pop-up Email composition window.

  • How to send converted PDF direct to a printer

    Hi, I have a .net app that calls LiveCycle ES2 service in order to convert an EPS into a PDF. My question is does anyone know how once the PDF has been generated to have LiveCycle ES2 send it directly to a printer? Also, is there any way to set the printer settings appropriately (i.e. Simulate Overprinting) before sending it into the printer?

    If you don't have Output, the best way would possibly be to handle this in your application by receiving the pdf and then send it to the printer.

  • How do I export pdf from pages via commandline

    I have a pages document that I use as a documentation for a library that I've written.  When I release the library I hav been manually exporting the document to PDF, but I'm trying to automate the whole process.
    Is there a way to get Pages to convert a .pages package to a .pdf file via bash?

    Try Automator or an AppleScript.
    I am not sure if Yvan our resident AppleScript expert is still monitoring these forums. Apple has offended him to the point he has gone on strike.
    Peter

  • How do I send a session from logic via email?

    If I can get some help on this it would be mostly appreciated!

    Hi
    you should zip the Folder and attach it as you would any other thing you wanted to send, but...
    if there's lots of audio, forget it, use dropbox.com or yousendit.com instead.
    Good luck
    Steve

  • How can send Interactive PDF form as an Email attachment?

    Hi Experts,
    I am generating Interactive form with one SUBMIT button. User will edit form data and clicks on SUBMIT button.
    There I need to send an email notification to user with PDF attachment. How can do this? Where Can I capture binary format of the data.
    Thanks,
    Naveen Inuganti.

    Hi Aravind,
    Thanks for your input.
    I am facing following issues with that option.
    1. How can I pass email ID from my program?
    2. How about the other functionality that my original button does? Like updating tables etc., Do I need to have separate button for this?
    3. Now I am receiving email with XML format! I need it in PDF format.
    Thanks,
    Naveen.I

  • Sending PO (PDF attach.) via email: adding email body text

    Hi,
    I need to send Purchase Orders to Vendors as PDF attachments to emails; I have successfully configured all the necessary:
    For Output Type NEU
    1) Access to conditions (General Data) set to X
    2) Dispatch time 3 Send with application own transaction
    3) Transmission Medium 5 for External send
    4) Processing routines 5 includes a customer Program and Form to make use of my SAPScript
    I have set up a Communication Strategy (NET - Internet) and created a condition based on a specific document type.
    Using ME9F I can select my PO and successfully output the message - I can view the request using SOST and an email with the PO attached as PDF is sent to the correct recipient (email address of Vendor).
    I would like though to add some text to the body of the email, which is totally empty. Can anyone please advise on how to achieve this? In the Output Type config there is a section "Mail title and texts"... can anyone tell me whether this section can be used to add body text to the email and how? I have managed to customise the "Title/Subject" of the email and PO but cannot find a way to add some text in the email body.
    Thank you very much for your help.
    Gab

    Hi Danilo,
    You need to do some configuration for this.
    - Goto NACE .
    - Select EF and click on OUTPUT TYPES.
    - Then select Output Type NEU and click on processing routines .
    - In that you have to add a new entry - medium 5 .
    - Then you need to assign a program, form routine and form.
    - You can use the standard program i.e. SAPFM06P, FORM routine is always ENTRY_NEU and standard MEDRUCK.
    - Then in PARTNER FUNCTION you need to add a new entry : medium - 5 and function - VN .
    - For subject of the mail goto Mail Title and Texts. In title give PO No. &EKKO-EBELN& .
    - Under General data -> Replacement of text symbols give programm as SAPMM06E and Form Routine as
    TEXT_SYMBOL_REPLACE .
    - Now the subject will be PO No. 1800004202.
    - You need to maintain your email id in tcode SU01 and also the vendor's email id.
    - Now while creating a new purchase order , change the medium to External Send .
    - Then goto Communication Method and select CS01 . ALSO make sure that the Cover Page Text has value PO No. &EKKO-EBELN& .
    - Goto tcode ME9F .
    - Execute.
    - Select the checkbox and click on Output Message.
    - You will get a message MAII 00000000000001 generated .
    If the BASIS guys have made the necessary configuration for sending mail then the mail will go .
    You can see the status in tcode SOST.
    If you want to use a z-programm and z-form then you need add the functions used in standard programm SAPFM06P for generating mail in your z-programm.
    Hope it helps,
    Swapnil

  • Send a PDF from Reader by email - wrong program?

    Hello,
    on Vista SP2, Acrobat 9, Firefox as Standard-Browser and Thunderbird as Standard-Mail ("...has all standards...") Acrobat Readers opens a new Windows Mail when clicking on the Mail-Button in a PDF. This behaviour is new - some days before it was a new thunderbird mail - and i don't know how to  reset this...
    What to do?
    Thx!
    Peter

    Hello,
    it's not a AdobeReader-Problem - something was wrong with the thunderbird, which came by the integrated update. I downloaded it compledly and reinstalled it and adobe and all other Mailto-Links now open a new thunderbird mail.
    Goodbye
    Peter

  • TS4053 Help,  I can't send my photos from iPhoto via email? Please help. Sue

    Help please. I can't email my photos from iphoto. Please advise. Sue

    I'm having a similar issue I think - in iPhoto I select an image then hit Share then select email and it pops open an email for the address to be entered but the contents are blank, sending the email arrives blank - same thing sobersue ?
    If so I've logged a bug report with Apple Techs about it ...

  • How to send a PDF file as a FAX from Oracle Reports 6i

    Hi
    I want to know how to send a PDF file as a FAX from Oracle Reports 6i. Or please post any sample code in reports that sends PDF document as FAX
    Help need immediately.
    Thanks in advance. my email id is
    [email protected]
    Arun
    null

    hello,
    there is no native support for directly faxing a report. you could e.g. use a fax-software that has a printer-driver that supports this.
    regards,
    the oracle reports team

Maybe you are looking for

  • How to generate a report in swing

    Hi I Would like to generate a report in the following formate. Could you please help me By providing some Sample code.           BOSCO COLLEGE LIBRARY             Book Details BookID | Book Name |  Book Author| Refrence/Non Reference ----------------

  • Can't import videos to iTunes library...

    I can't get videos into my iTunes library. I've done it once before, but my computer isn't letting me drag the file from the Movie folder on my computer to the library on iTunes. Does it make a difference which format the movie is? Because it's .avi,

  • F-03 clearing g/l account error

    Dear Expert, I was getting following error message when try to clear g/l account using F-03: Ex.rate diff. accts are incomplete for account 0504XXXXX currency JPY. When search through forum, there is recommendation to do configuration as following: 1

  • Starting up in Safe Mode

    I am trying to start up in Safe Mode and I know that I have to hold shift after I hear the "on" sound after turning the computer on from shut down. But I don't hear any on sound... What do I do?

  • Forgot the Sync Key of an account

    Hi, I have set up a Firefox Sync account lately. Yesterday, I backed up my laptop but forgot to back up the sync. Now, I can't set up the Firefox Sync service anymore, as my email address has already registered but don't have a sync key to access. I