Pdf from otf table

Hi.
I have got problem with my smartform.
When i look at smartform from spool or from print preview it looks ok, but when i try to make pdf file using OTF table my smartform is without special characters (polish letters).
Any advice ?

Hi,
See below .
DATA: lv_lines       TYPE I,
          lv_filesize    TYPE STRING,
          lv_pdf_xstring TYPE xstring.
DATA: lt_otf       TYPE STANDARD TABLE OF ITCOO,
          lt_obj_bin   TYPE STANDARD TABLE OF  SOLISTI1,
          lt_lines     TYPE STANDARD TABLE OF TLINE,
Convert OTF to PDF
  CALL FUNCTION 'CONVERT_OTF'
    EXPORTING
      format                 = 'PDF'
    IMPORTING
      bin_filesize          = lv_filesize
      bin_file               = lv_pdf_xstring
    TABLES
      otf                     = lt_otf
      lines                   = lt_lines
    EXCEPTIONS
      err_max_linewidth     = 1
      err_format            = 2
      err_conv_not_possible = 3
      err_bad_otf           = 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.
Convert PDF data into Binary fomrat
  CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
    EXPORTING
      buffer     = lv_pdf_xstring
    TABLES
      binary_tab = lt_objbin.
I was getting problem when i was converting OTF to PDF then I used above function module and my problem is solved. May this help you.
Thanks,
Jayshree.

Similar Messages

  • Show a blob( pdf ) from db-table  in the clients browser/ web.show_document

    my env:
    Database R11_2 on one windows-host-machine
    AS 10 g on another windows-host-machine
    I can show files in Forms10g from inside the AS with web.show_document,
    that works fine
    but now I want to show a ( pdf or text ) File from a BLOB in a Table inside in the Database
    to the Browser running in Forms on AS,
    I do not want to create a extra Form for this reason, but want to show it in browser - windows
    ( how ) can I use web.show_document against a URL on the Database R11 ?
    what other tool , java ?
    regards

    Easiest way is probably to use mod_plsql and wpg_docload.download_file. If you retrieve the blob content from some table, than you can show it with a generic procedure like:
    procedure show_webdoc(io_blob          in out nocopy blob
                         ,i_mimetype       in varchar2
                         ,i_filename       in varchar2)
    is
    begin
       if dbms_lob.getlength(io_blob) >0 then
          owa_util.mime_header(nvl(i_mimetype,'application/octet'),false);
          htp.p('Content-length: ' || dbms_lob.getlength(io_blob));
          htp.p('Content-Disposition:  attachment; filename="'||i_filename|| '"');
          owa_util.http_header_close;
          wpg_docload.download_file(io_blob);
       end if;
    end show_webdoc;

  • 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 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

  • Creating PDFs from PowerPoint Tables that InDesign Can Handle

    Hi - I just posted the question below on the InDesign forum, but I think it may actually be a Microsoft-Adobe-pdf issue.  Any help is much appreciated. 
    Hi All, this is my first post on the Adobe Community.  I problem cropped up in the last week and i am going crazy.  Please help!!  I am running on  a MacBook Pro with OSX 10.7.5.
    I have been using a workflow to create tables in InDesign for months with no issues:
    1.  Calculate a complex table in Excel
    2.  Paste the table into PowerPoint for formatting
    3.  Copy the table in PowerPoint, then paste it back as a pdf image
    4.  Option-click on the pdf image on the slide to save it as a pdf file
    5.  Go to a frame InDesign that already has a linked image, re-link to the new pdf file.
    This workflow has been very helpful because I have a lot of complex and carfully formatted tables I need to get into InDesign.  Now, since upgrading both my Microsoft Office 2011 and my Adobe CS6 SW it not working.
    I can copy, paste-as-pdf, save the pdf file.   But when I try to link to it in InDesign it get the message "Failed to open the pdf file."
    I can still link to older pdf files with no problem, and I can use this work flow on text-only pdf files from PowerPoint.  The pdf files that contain tables are not linking into InDesign.  I have tried to do the past-as-pdf into Microsoft Word and the behavior is the same.
    All the pdf files look fine in Acrobat.
    Thank you very much for any assistance.
    -Cecelia

    It's a matter of efficiency as much as anything else. I read too many
    reports here of people having problems printing previewing or working
    with PDFs and it often comes back to preview.
    It's fine for JPGs but PDFs? No, especially those generated by InDesign.
    Why open them in preview only to find a problem when Reader or Acrobat
    are far better applications? It just seems horribly inefficient to have
    preview set as the default for PDFs only to find an problem and then
    have to quit preview and open Reader or Acrobat.
    Bob

  • Creating a pdf from Webdynpro iview using "WebDynpro Java"

    Hi everybody,
           I have a requirement like creating a pdf file from the iview content in a web dynpro project.  
           Can any one explain me the procedure as well as code how to create a pdf from the table content using the "WebDynpro Java". 
    Thanks in advance,
    Naveen

    Hi Naveen,
    To be able to use PDF forms in Web Dynproapplications:
    &#56256;&#56442;SAPNetWeaver Developer Studio(minimum SPS 11) is installed
    &#56256;&#56442;Adobe LiveCycleDesigner7.0 is installed
    &#56256;&#56442;Adobe Reader7.0.x is installed
    &#56256;&#56442;SAP NetWeaverWeb AS Java compatible with the DevStudio s installed
    &#56256;&#56442;The Adobe Document Services are deployed and configured on the SAP J2EE Engine.
    &#56256;&#56442;The Active Component Framework(ACF) of the Interactive Forms integration is installed. (not mandatory)
    &#56256;&#56442; Internet Explorer(version 6)
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/2b6db1c4-0801-0010-faa5-ff4b4df55b45
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/63f09fc2-0401-0010-1482-dbf9891e7613
    Web Report to PDF
    /thread/104121 [original link is broken]
    Dynamik PDF
    Create Adobe PDF for user to download and print
    Online PDF
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8d7b9e7d-0c01-0010-2495-947691554cb7
    Regards,
    Mithu

  • Cannot open another PDF from within a PDF RDR 9.1

    Hi, all. When I or one of our users tries to open a PDF from a "Table of Contents" PDF , i.e.
    Table of Contents for Job CD30A9
    Guide
    42ACC845.pdf
    42ACC84D.pdf
    42ACC84E.pdf
    42ACC84C.pdf
    The guide opens but not the other documents. The other documents open fine if clicked on individually. They are password protected (all but guide.pdf).
    This is what I get with Process Monitor:
    1:52:45.5500328 PM AcroRd32.exe 2372 RegOpenKey HKLM\Software\Adobe\Acrobat Reader\9.0\Installer SUCCESS Desired Access: Read
    1:52:45.5500859 PM AcroRd32.exe 2372 RegQueryValue HKLM\SOFTWARE\Adobe\Acrobat Reader\9.0\Installer\VersionMax SUCCESS Type: REG_DWORD, Length: 4, Data: 589825
    1:52:45.5501239 PM AcroRd32.exe 2372 RegQueryValue HKLM\SOFTWARE\Adobe\Acrobat Reader\9.0\Installer\VersionMin SUCCESS Type: REG_DWORD, Length: 4, Data: 1
    1:52:45.5501694 PM AcroRd32.exe 2372 RegCloseKey HKLM\SOFTWARE\Adobe\Acrobat Reader\9.0\Installer SUCCESS
    Any ideas?

    Can you insert the PDF file in the Word document in another format to make it clickable in the newly converted PDF?

  • Generating a PDF from a OTF (imported from CLOSE_FORM) and send it by mail.

    Hello!
    I have a problem.
    I'll try to explain it toy you.
    I have a SapScript that the user has the option to send it to the printer or have a Print Preview. I need to send it by mail in PDF format.
    If the user select PRINT, a spool id is created, I can get the OTF, generate the PDF and send it by mail. Everything OK with that.
    The problem is if the user select PRINT PREVIEW I don't get a spool id. So, what I did is to get the OTF from the CLOSE_FORM MF and generate de PDF from there. I tried several FM to generate the PDF but for sure I'm doing something wrong, because or the PDF is corrupted or I have a problem with the parameters in the SO_NEW_DOCUMENT_ATT_SEND_API1 FM.
    So, what I need it: Generate a PDF from a OTF imported from CLOSE_FORM FM and send it by mail.
    Examples or the FM I can use are welcome.
    I tried to do search here, but I couldn't find anything that may help me..
    So, please... Show me the light!!!
    Thanks!!!
    Bettina

    Part 3
    * Send Report
      clear:    maildata, mailtxt, mailbin, mailpack, mailhead, mailrec.
      refresh:  mailtxt, mailbin, mailpack, mailhead, mailrec.
    * Creation of the document to be sent File Name
      maildata-obj_name = 'REPORT'.
    * Mail Subject
      maildata-obj_descr = 'Your Report'.
      describe table mailtxt lines tab_lines.
      read table mailtxt index tab_lines.
      maildata-doc_size = ( tab_lines - 1 ) * 255 + strlen( mailtxt ).
    * Creation of the entry for the compressed document
      clear mailpack-transf_bin.
      mailpack-head_start = 1.
      mailpack-head_num = 0.
      mailpack-body_start = 1.
      mailpack-body_num = tab_lines.
      mailpack-doc_type = 'RAW'.
      append mailpack.
    * Creation of the document attachment
      loop at solisti1.
        move-corresponding solisti1 to mailbin.
        append mailbin.
      endloop.
      describe table mailbin lines tab_lines.
      mailhead = 'REPORT.OTF'.
      append mailhead.
    ** Creation of the entry for the compressed attachment
      mailpack-transf_bin = 'X'.
      mailpack-head_start = 1.
      mailpack-head_num = 1.
      mailpack-body_start = 1.
      mailpack-body_num = tab_lines.
      mailpack-doc_type = 'OTF'.
      mailpack-obj_name = 'ATTACHMENT'.
      mailpack-obj_descr = 'Some Report'.
      mailpack-doc_size = tab_lines * 255.
      append mailpack.
      mailrec-receiver = lv_email_address.  "<-- a valid email address
      mailrec-rec_type  = 'U'.
      append mailrec.
    * Sending the document
      call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
           exporting
                document_data              = maildata
                put_in_outbox              = 'X'
           tables
                packing_list               = mailpack
                object_header              = mailhead
                contents_bin               = mailbin
                contents_txt               = mailtxt
                receivers                  = mailrec
           exceptions
                too_many_receivers         = 1
                document_not_sent          = 2
                operation_no_authorization = 4
                others                     = 99.
    Regards,
    Rich Heilman

  • Converting the layout from OTF format into PDF

    Hi Experts,
    I am new to SMART FORMS,I don't have a clue about how to convert the layout from OTF format into PDF format and how to store it in Presentation server.
    Please send me a Model program or step by step approach of the same.
    Useful inputs will be rewarded higher points.
    Thanks in Advance,
    Dharani

    Hi,
    The steps are given below:-
    1) First get the name of your generated function module for the smartforms.
    2) Then call the generated function module.
    3) Then use the FM:CONVERT_OTF' to convert into PDF as shown below:-
    call function 'CONVERT_OTF'
        EXPORTING
          format                = 'PDF'
        IMPORTING
          bin_filesize          = w_pdf_len
          bin_file              = w_pdf_xstring
        TABLES
          OTF                   = OUTPUT_DATA-OTFDATA
          LINES                = LT_LINES
        EXCEPTIONS
          err_max_linewidth     = 1
          err_format            = 2
          err_conv_not_possible = 3
          err_bad_otf           = 4
          others                = 5.
    Hope this is clear.
    Pravat.
    <i>*Reward points if helpful.</i>

  • Sending mail after converting from otf to pdf

    Hi all,
    i have an requirement of converting script output i.e., otf to pdf converting and i want send that account statement to the mail id which is maintatined in XD03 t.code,based on different customers differnt account statement should post ,
    please suggest me ASAP.

    use the function module
    CONVERT to pdf
    SX_OBJECT_CONVERT_OTF_PDF
    - Email the PDF data using
    SO_NEW_DOCUMENT_ATT_SEND_API1
    examples
    Option 1.
    - converting OTF data returned from CLOSE_FORM (requested in OPEN_FORM) to PDF format using SX_OBJECT_CONVERT_OTF_PDF
    - Email the PDF data using SO_NEW_DOCUMENT_ATT_SEND_API1
    Result
    >> Everything works fine except that the output cannot be sent to spool and previewed (due the request of OTF table in OPEN_FORM)
    >> The PDF attachment can be downloaded and view directly.
    Option 2.
    - converting spool to PDF format using CONVERT_OTFSPOOLJOB_2_PDF
    - Email the PDF data using
    SO_NEW_DOCUMENT_ATT_SEND_API1
    Result
    >> The output can be previewed and sent to spool. No error returned from sending mail.
    >> However, the attachment of PDF file cannot be downloaded (from SBWP Business Workspace). An error message "Database error for <GET DATA FROM KPRO>" was displayed when I try to download the PDF file
    You can try something like this
    IF SY-UCOMM = 'VIEW'.
    CLEAR ITCPO-TDGETOTF.
    ENDIF.
    ***OPEN_FORM
    *etc
    ***CLOSE_FORM
    IF NOT SY-UCOMM = 'VIEW'.
    **SEND MAIL
    ENDIF.
    example code
    REPORT ZSENDPDF NO STANDARD PAGE HEADING.
    TABLES: TST05,
    TSP01,
    NAST,
    T685B,
    USR01.
    DATA: BEGIN OF TAB_PDF OCCURS 0,
    TLINE(255).
    DATA : END OF TAB_PDF.
    DATA: BEGIN OF TAB_OTF OCCURS 0,
    TLINE(255).
    DATA : END OF TAB_OTF.
    DATA: BEGIN OF TAB_DATA_SET OCCURS 0,
    DATA_LENGTH(5),
    PRECOL(1),
    DATA_LINE(1000).
    DATA : END OF TAB_DATA_SET.
    DATA: BEGIN OF TAB_OTF_PAGE OCCURS 0.
    INCLUDE STRUCTURE ITCOO.
    DATA: END OF TAB_OTF_PAGE.
    DATA : BEGIN OF TAB_OTF_PAGE_INDEX OCCURS 0,
    LINE_NUM TYPE P.
    DATA : END OF TAB_OTF_PAGE_INDEX.
    DATA: BEGIN OF TAB_DATA_SET_LINE,
    DATA_LENGTH(5),
    PRECOL(1),
    DATA_LINE(1000).
    DATA : END OF TAB_DATA_SET_LINE.
    DATA : BEGIN OF TAB_TSP01 OCCURS 0,
    RQIDENT LIKE TSP01-RQIDENT,
    RQCOPIES LIKE TSP01-RQCOPIES.
    DATA : END OF TAB_TSP01.
    DATA :
    LEN_OUT LIKE SOOD-OBJLEN,
    LEN_IN LIKE SOOD-OBJLEN,
    OTF_PAGES TYPE P,
    *otf_max_pages type p value 100,
    OTF_MAX_PAGES TYPE P VALUE 1000,
    DATA_SET_LINECOUNT TYPE P,
    *data_set_max_lines type p value 1000000,
    DATA_SET_MAX_LINES TYPE P VALUE 100000,
    DATA_SET_IS_OTF TYPE C VALUE ' ',
    DATA_SET_LENGTH(5) TYPE C,
    DSN_TYPE( TYPE C,
    RC(10) TYPE C,
    ERRMSG(100) TYPE C,
    LINE_MAX TYPE P VALUE '100000',
    STATUS LIKE SY-SUBRC,
    H_PATH(20) TYPE C,
    H_MASK(20) TYPE C VALUE ',.pdf ,.pdf. ',
    FILE_NAME(20),
    FILENAME LIKE RLGRAP-FILENAME,
    C_PAGE_BREAK TYPE I,
    K_PAGE_BREAK TYPE I.
    PARAMETER : P_RQID(5) TYPE C.
    START-OF-SELECTION.
    END-OF-SELECTION.
    PERFORM GET_TAB_OTF.
    CLEAR K_PAGE_BREAK.
    LOOP AT TAB_OTF_PAGE WHERE TDPRINTCOM = 'EP'.
    ADD 1 TO K_PAGE_BREAK.
    ENDLOOP.
    CLEAR C_PAGE_BREAK.
    LOOP AT TAB_OTF_PAGE.
    IF TAB_OTF_PAGE-TDPRINTCOM EQ 'EP'.
    ADD 1 TO C_PAGE_BREAK.
    IF C_PAGE_BREAK GE 3 AND C_PAGE_BREAK LT K_PAGE_BREAK.
    TAB_OTF-TLINE = 'EP'.
    APPEND TAB_OTF.
    ENDIF.
    ENDIF.
    TAB_OTF-TLINE = TAB_OTF_PAGE.
    APPEND TAB_OTF.
    ENDLOOP.
    CALL FUNCTION 'SX_OBJECT_CONVERT_OTF_PDF'
    EXPORTING
    FORMAT_SRC = 'OTF'
    FORMAT_DST = 'PDF'
    DEVTYPE = 'ASCIIPRI'
    LEN_IN = LEN_IN
    IMPORTING
    LEN_OUT = LEN_OUT
    TABLES
    CONTENT_IN = TAB_OTF
    CONTENT_OUT = TAB_PDF
    EXCEPTIONS
    ERR_CONV_FAILED = 1
    OTHERS = 2.
    PERFORM GET_PATH USING 'PDF_FILE'.
    CALL FUNCTION 'WS_DOWNLOAD'
    EXPORTING
    FILENAME = FILENAME
    FILETYPE = 'BIN'
    BIN_FILESIZE = LEN_OUT
    TABLES
    DATA_TAB = TAB_PDF
    EXCEPTIONS
    FILE_OPEN_ERROR = 1
    FILE_WRITE_ERROR = 2
    INVALID_FILESIZE = 3
    INVALID_TABLE_WIDTH = 4
    INVALID_TYPE = 5
    NO_BATCH = 6
    UNKNOWN_ERROR = 7
    OTHERS = 8.
    *& Form GET_tab_otf
    FORM GET_TAB_OTF.
    DATA: PART(4) VALUE '0001',
    BEGIN OF MSG,
    A(40),
    B(40),
    C(40),
    END OF MSG.
    REFRESH TAB_DATA_SET.
    DATA_SET_LINECOUNT = 0.
    DATA_SET_IS_OTF = ' '.
    OTF_PAGES = 0.
    REFRESH TAB_OTF_PAGE_INDEX.
    CALL 'RSPOACSD'.
    SELECT * FROM TST05 WHERE DTHREAD = 'X'.
    CALL 'RSPOAOSD'
    ID 'ID' FIELD P_RQID
    ID 'TYPE' FIELD TST05-DTYPE
    ID 'RECTYP' FIELD 'VYL----'
    ID 'RC' FIELD RC
    ID 'ERRMSG' FIELD ERRMSG.
    STATUS = SY-SUBRC.
    IF STATUS = 0.
    DSN_TYPE = TST05-DTYPE.
    IF DSN_TYPE(3) = 'OTF'.
    DATA_SET_IS_OTF = 'X'.
    ENDIF.
    ENDIF.
    IF STATUS <> 24. EXIT. ENDIF.
    ENDSELECT.
    DATA_SET_MAX_LINES = ( LINE_MAX * '1.1' ) + 100.
    DO.
    CLEAR: TAB_DATA_SET_LINE, DATA_SET_LENGTH.
    CALL 'RSPOARSD'
    ID 'BUFF' FIELD TAB_DATA_SET_LINE+5
    ID 'DATALEN' FIELD DATA_SET_LENGTH
    ID 'RC' FIELD RC
    ID 'ERRMSG' FIELD ERRMSG.
    STATUS = SY-SUBRC.
    IF STATUS = 36.
    WHILE STATUS = 36.
    CALL 'RSPOACSD'
    ID 'RC' FIELD RC
    ID 'ERRMSG' FIELD ERRMSG.
    ADD 1 TO PART.
    IF DATA_SET_IS_OTF = ' '.
    CALL 'RSPOAOSD'
    ID 'ID' FIELD P_RQID
    ID 'TYPE' FIELD DSN_TYPE
    ID 'PART' FIELD PART
    ID 'RECTYP' FIELD 'VYL----'
    ID 'RC' FIELD RC
    ID 'ERRMSG' FIELD ERRMSG.
    ELSE.
    CALL 'RSPOAOSD'
    ID 'ID' FIELD P_RQID
    ID 'PART' FIELD PART
    ID 'TYPE' FIELD DSN_TYPE
    ID 'RECTYP' FIELD 'VYL----'
    ID 'RC' FIELD RC
    ID 'ERRMSG' FIELD ERRMSG.
    ENDIF.
    IF SY-SUBRC NE 0. EXIT. ENDIF.
    CLEAR: TAB_DATA_SET_LINE, DATA_SET_LENGTH.
    CALL 'RSPOARSD'
    ID 'BUFF' FIELD TAB_DATA_SET_LINE+5
    ID 'DATALEN' FIELD DATA_SET_LENGTH
    ID 'RC' FIELD RC
    ID 'ERRMSG' FIELD ERRMSG.
    STATUS = SY-SUBRC.
    ENDWHILE.
    ENDIF.
    IF STATUS <> 0 AND STATUS <> 40. EXIT. ENDIF.
    TAB_DATA_SET = TAB_DATA_SET_LINE.
    IF NOT ( DATA_SET_LENGTH IS INITIAL ).
    TAB_DATA_SET-DATA_LENGTH = DATA_SET_LENGTH - 1.
    ENDIF.
    APPEND TAB_DATA_SET.
    ADD 1 TO DATA_SET_LINECOUNT.
    IF DATA_SET_IS_OTF = ' '.
    IF DATA_SET_LINECOUNT >= DATA_SET_MAX_LINES.
    CLEAR TAB_DATA_SET.
    APPEND TAB_DATA_SET.
    MOVE '----
    ' TO TAB_DATA_SET-DATA_LINE.
    APPEND TAB_DATA_SET.
    CLEAR TAB_DATA_SET.
    APPEND TAB_DATA_SET.
    WRITE: 'Abbruch nach'(029) TO MSG-A.
    WRITE: DATA_SET_MAX_LINES TO MSG-B.
    WRITE: 'Zeilen.'(030) TO MSG-C.
    CONDENSE MSG.
    TAB_DATA_SET-DATA_LINE = MSG.
    APPEND TAB_DATA_SET.
    EXIT.
    ENDIF.
    ELSE.
    MOVE TAB_DATA_SET_LINE-DATA_LINE TO TAB_OTF_PAGE.
    APPEND TAB_OTF_PAGE.
    IF TAB_OTF_PAGE(2) = 'EP'.
    ADD 1 TO OTF_PAGES.
    IF OTF_PAGES >= OTF_MAX_PAGES.
    MESSAGE S229(PO) WITH OTF_MAX_PAGES.
    EXIT.
    ENDIF.
    ELSEIF TAB_OTF_PAGE(2) = 'OP'.
    TAB_OTF_PAGE_INDEX-LINE_NUM = DATA_SET_LINECOUNT.
    APPEND TAB_OTF_PAGE_INDEX.
    ENDIF.
    ENDIF.
    ENDDO.
    IF STATUS <> 0 AND STATUS <> 12.
    CALL 'RSPOACSD'.
    MESSAGE E112(PO) WITH STATUS RC ERRMSG.
    ENDIF.
    CALL 'RSPOACSD'.
    STATUS = SY-SUBRC.
    IF STATUS <> 0.
    MESSAGE E112(PO) WITH STATUS RC ERRMSG.
    ENDIF.
    ENDFORM.
    *& Form GET_PATH
    FORM GET_PATH USING P_FILENAME.
    CLEAR: H_PATH, FILE_NAME.
    FILE_NAME = P_FILENAME.
    CALL FUNCTION 'WS_QUERY'
    EXPORTING
    QUERY = 'CD' "// Current Directory
    IMPORTING
    RETURN = H_PATH.
    CONCATENATE FILE_NAME '.pdf' INTO FILE_NAME.
    CALL FUNCTION 'WS_FILENAME_GET'
    EXPORTING
    DEF_FILENAME = FILE_NAME
    DEF_PATH = H_PATH
    MASK = H_MASK
    MODE = 'O'
    IMPORTING
    FILENAME = FILENAME"dbname
    EXCEPTIONS
    INV_WINSYS = 1
    NO_BATCH = 2
    SELECTION_CANCEL = 3
    SELECTION_ERROR = 4
    OTHERS = 5.
    ENDFORM. " GET_PATH
    <REMOVED BY MODERATOR>
    Edited by: Alvaro Tejada Galindo on Mar 5, 2008 9:50 AM

  • Any way to stop Pages (current) from creating Table of Contents when converting to ePub. My PDF conversion is perfect  Thanks

    Any way to stop Pages (current) from creating Table of Contents (in this case Chapter 1) when
    coverting from Pages to ePub. This messes up my book.  The PDF file created is perfect!
    Thanks for any help.  Jim

    You might want to search/ask in the forum for Pages too
    https://discussions.apple.com/community/iwork/pages

  • Export data from a table (not a bi query) to pdf

    Hi experts,
    I would like to know the way to export data in VC 7.0 from a table to a pdf. This table is generated NOT from a BI query but from an SQL using connection to Oracle DBMS.
    Thank you all
    Alessandro

    Hi,
    Use this link:[https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/47fe4fef-0d01-0010-6f87-ed8ecb479123]
    and Go through he below thread.
    [Re: Export data from visual composer to excel]
    Regards,
    Govindu
    If helpful reward points

  • Create Spool from Internal table & converrt the spool to PDF

    Hi All,
    My requirement is take data from a table and find amount specific to each Vendors . So I took all the data into ITAB and do all the calculation. Later after calculation I have to create a spool from this ITAB and this spool have to convert to PDF. Later this PDF have to seend via email.
    To convert the internal table to Spool , I used
    LOOP AT t_summ INTO wa_summ.
        w-amount = wa_summ-remittanceamount.
        CONCATENATE wa_summ-vendorcode
                    wa_summ-controlnum
                    w-amount INTO wa_textdata SEPARATED BY space.
        APPEND wa_textdata TO t_textdata.
      ENDLOOP.
      DESCRIBE TABLE t_textdata .
      w-file_length = syst-tfill * 1022.
      l_doctype = 'LIST'.
      l_layout = 'X_POSTSCRIPT'.
      CONCATENATE ' Listbill Summary Report for' syst-datum INTO
                          l_title SEPARATED BY space.
      l_receiver = syst-uname.
    * Create Spool
      CALL FUNCTION 'RSPO_SR_OPEN'
       EXPORTING
          dest                   = 'LOCL'
    *   LDEST                  =
          layout                 = l_layout
          name                   = 'SUMREP'
    *   SUFFIX1                =
    *   SUFFIX2                =
       copies                 = '1'
    *   PRIO                   =
    *      immediate_print        = ' '
    *   AUTO_DELETE            =
          titleline              = l_title
          receiver               = syst-uname           "
    *      division               = l_pri_params-prabt " abteilung
    *      authority              = l_pri_params-prber           "
    *   POSNAME                =
    *   ACTTIME                =
    *   LIFETIME               = '8'
    *   APPEND                 =
    *   COVERPAGE              =
    *   CODEPAGE               =
          doctype                = l_doctype
    *   ARCHMODE               =
    *   ARCHPARAMS             =
    *   TELELAND               =
    *   TELENUM                =
    *   TELENUME               =
         IMPORTING
          handle                 = l_spool_handle
          spoolid                = w-spoolid
    EXCEPTIONS
       device_missing         = 1
       name_twice             = 2
       no_such_device         = 3
       operation_failed       = 4
       OTHERS                 = 5
                .                                            "#EC DOM_EQUAL
      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 'SLVC_C1022_TO_C255'
        EXPORTING
          i_file_length = w-file_length
        TABLES
          it_c1022      = t_textdata
          et_c255       = lt_spool.
      l_length = w-file_length.
      LOOP AT lt_spool INTO ls_spool.
        l_length = l_length - 255.
        IF ( l_length > 0 ).
          l_line_length = 255.
        ELSE.
          l_line_length = l_length + 255.
        ENDIF.
    *   Write contents to spool
        CALL FUNCTION 'RSPO_SR_WRITE'
          EXPORTING
            handle = l_spool_handle
            text   = ls_spool
            length = l_line_length.
      ENDLOOP.
    * Close Spool
      CALL FUNCTION 'RSPO_SR_CLOSE'
        EXPORTING
          handle                 = l_spool_handle
         pages                  = 1
      FINAL                  = 'X'
       EXCEPTIONS
         handle_not_valid       = 1
         operation_failed       = 2
         OTHERS                 = 3
    By this I can see the spool with data in SP02.
    Then to conver to PDF, I used
    CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
        EXPORTING
          src_spoolid                    = w-spoolid
          no_dialog                      = 'X'
          DST_DEVICE                     = 'LOCL'
    *      PDF_DESTINATION                =
        IMPORTING
    *      PDF_BYTECOUNT                  =
    *      PDF_SPOOLID                    =
          list_pagecount                 = list_pagecount
    *      BTC_JOBNAME                    =
    *      BTC_JOBCOUNT                   =
       TABLES
         pdf                            = t_pdf
       EXCEPTIONS
         err_no_abap_spooljob           = 1
         err_no_spooljob                = 2
         err_no_permission              = 3
         err_conv_not_possible          = 4
         err_bad_destdevice             = 5
         user_cancelled                 = 6
         err_spoolerror                 = 7
         err_temseerror                 = 8
         err_btcjob_open_failed         = 9
         err_btcjob_submit_failed       = 10
         err_btcjob_close_failed        = 11
         OTHERS                         = 12
      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 'GUI_DOWNLOAD'
        EXPORTING
    *   BIN_FILESIZE                    =
          filename                        = 'D:\t\t.pdf'
         filetype                        = 'BIN'
        TABLES
          data_tab                        = t_pdf
    *   FIELDNAMES                      =
       EXCEPTIONS
         file_write_error                = 1
         no_batch                        = 2
         gui_refuse_filetransfer         = 3
         invalid_type                    = 4
         no_authority                    = 5
         unknown_error                   = 6
         header_not_allowed              = 7
         separator_not_allowed           = 8
         filesize_not_allowed            = 9
         header_too_long                 = 10
         dp_error_create                 = 11
         dp_error_send                   = 12
         dp_error_write                  = 13
         unknown_dp_error                = 14
         access_denied                   = 15
         dp_out_of_memory                = 16
         disk_full                       = 17
         dp_timeout                      = 18
         file_not_found                  = 19
         dataprovider_exception          = 20
         control_flush_error             = 21
         OTHERS                          = 22
    But later when I go and open the PDF, I am getting an error saying'Page cannot be open because it dont have any pages'
    Please help me
    Regards,
    Nikhil

    Hi Nikhil,
    <li>If you are still not able to find out the problem. You can an alternative way , which is used for the same purpose.
    <li>Try this way. It creates spool and and same CONVERT_ABAPSPOOLJOB_2_PDF fm is used to convert spool to PDF. It works. Test this test program.
       REPORT ztest_notepad.
       DATA:g_val         TYPE c,
            w_pripar      TYPE pri_params,
            w_arcpar      TYPE arc_params,
            i_pdf         TYPE TABLE OF tline,
            spoolid       LIKE tsp01-rqident,
            l_no_of_bytes TYPE i,
            l_pdf_spoolid LIKE tsp01-rqident,
            l_jobname     LIKE tbtcjob-jobname,
            l_jobcount    LIKE tbtcjob-jobcount.
       DATA:it_t001 TYPE TABLE OF t001 WITH HEADER LINE.
       START-OF-SELECTION.
         SELECT * FROM t001 INTO TABLE it_t001.
         "Read, determine, change spool print parameters and archive parameters
         CALL FUNCTION 'GET_PRINT_PARAMETERS'
           EXPORTING
             in_archive_parameters  = w_arcpar
             in_parameters          = w_pripar
             layout                 = 'X_65_132'
             line_count             = 65
             line_size              = 132
             no_dialog              = 'X'
           IMPORTING
             out_archive_parameters = w_arcpar
             out_parameters         = w_pripar
             valid                  = g_val.
         IF g_val  NE space AND sy-subrc = 0.
           w_pripar-prrel = space.
           w_pripar-primm = space.
           NEW-PAGE PRINT ON  NEW-SECTION PARAMETERS w_pripar ARCHIVE PARAMETERS w_arcpar NO DIALOG.
         ENDIF.
         LOOP AT it_t001.
           WRITE:/ it_t001.
         ENDLOOP.
         NEW-PAGE PRINT OFF.
         CALL FUNCTION 'ABAP4_COMMIT_WORK'.
         spoolid = sy-spono.
         CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
           EXPORTING
             src_spoolid   = spoolid
             no_dialog     = ' '
           IMPORTING
             pdf_bytecount = l_no_of_bytes
             pdf_spoolid   = l_pdf_spoolid
             btc_jobname   = l_jobname
             btc_jobcount  = l_jobcount
           TABLES
             pdf           = i_pdf.
         CALL FUNCTION 'GUI_DOWNLOAD'
           EXPORTING
             filename = 'C:\temp\test.pdf'
             filetype = 'BIN'
           TABLES
             data_tab = i_pdf.
    Thanks
    Venkat.

  • Converting Script from OTF to PDF format

    Hi Experts,
    Using FM CONVERT_OTF in SAP Script print program I am converting data of Script from OTF to PDF format but the data in PDF document srinks and looks like slightly overlapping one leter on the other, can any ony please tell me that how can I avaoid this.
    Thanks in Advance
    Best Regards
    Venkat

    Dear Venkatesh,
    I have the same scenario. I have to convert Script to PDF and then write it to FTP Server.
    Could you please provide me the code which you have used?
    Regards,
    Chaitanya A

  • Fill pdf form from database table

    I am working on small application for my employer. We have record fo all new employee in table and want to fill PDF (I-9) from database using APEX application.
    Below PDF form, we want to fill from database table.
    http://www.uscis.gov/files/form/I-9.pdf
    I am not sure how to take from APEX. Any ideas?
    I know one way to export from database table and import to PDF form.
    Is there any other way?
    Thanks

    If I understand you correctly then I need to first export the xml file using Data-> Load sample XML data and later create template in template.rtf and upload data using APEX in template. In this case I need to create rtf template exactly similar to http://www.uscis.gov/files/form/I-9.pdf.
    I am not sure is there any way to to used existing pdf template or save pdf template to rtf template. Later that template can be used to populate data using APEX.

Maybe you are looking for

  • Windows 7-8.1 Can not change the MAC Address on wifi and cannot load login page in public HotSpot.

    Windows 7-8.1 Can not change the MAC Address on wifi and cannot load login page in public HotSpot. Adapter: Ralink RT3070 Chipset wifi adapter Tested: os Windows 8.1 Professional Hot Spot: 802.11b The first problem windows 7-8.1 got IP adress and con

  • Dynamic directory for Sender SFTP adapter

    Hi All,   Hope everybody is doing fine.   I need urgent help for below requirement for SFTP adapter ,client requirement is   We have deployed the SAP security Add ons (PGP-SFTP) for one of the requirements in our PI system (PI 7.11 SPS 11).   The SFT

  • Workbooks not opening from a Business Server Page (BSP)

    Hello Experts, I need help with opening workbooks from a Business Server Page (BSP). The problem is that the workbook is not opening, but instead a blank Excel page opens. I am using Microsoft Excel 2003 and on BI 7.0 version. Here is the code: Could

  • Can music in the cloud only be played over wifi?

    As a fitness instructor, my iphone is on airplane mode while teaching but when I do this my music disappears! How can I still play my music without downloading it onto my iPhone?

  • JNDI not found deploy bpel in cluster

    Hi I have this problem: I install BPEL CLuster in two hosts: mtier01 and mtier02 and I have a lbr (balancer) in front of this servers (mtier01 and 02). I deploy bpel using bpel console and I get a error: JNDI not found. I read log: log.xml of bpel, a