<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Smartform DOC in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/smartform-doc/m-p/5845581#M1318761</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The code doesnt read a spool when is a Smartform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my system, i dont have definied printers of type XSF. I have asked it. A solution will be use Adobe Interactive Forms, but for us it is imposible, due to the license payment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another solution?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jose.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Jul 2009 09:55:34 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-07-06T09:55:34Z</dc:date>
    <item>
      <title>Smartform DOC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/smartform-doc/m-p/5845577#M1318757</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a Portal, when I selected a Purchase Order, a pop-up is shown for Open, Save or Cancel this Purchase Order. The information is showed from a Smartform in PDF format. We requisite is show the Purchase Order in DOC format. I dont know if it is possible or not, any help is welcome.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jose.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2009 06:26:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/smartform-doc/m-p/5845577#M1318757</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-06T06:26:02Z</dc:date>
    </item>
    <item>
      <title>Re: Smartform DOC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/smartform-doc/m-p/5845578#M1318758</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you look at the below links..&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="7746341"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="7753195"&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2009 06:30:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/smartform-doc/m-p/5845578#M1318758</guid>
      <dc:creator>alex_m</dc:creator>
      <dc:date>2009-07-06T06:30:42Z</dc:date>
    </item>
    <item>
      <title>Re: Smartform DOC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/smartform-doc/m-p/5845579#M1318759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jose, &lt;/P&gt;&lt;P&gt;Try to use this code, it will be helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;************************************************************************
* MÓDULO      : FI                                                     *
* TIPO        : Listado                                                *
* TITULO      : Generación fichero Word
* DESCRIPCION : Genera un fichero Word a partir de una orden de spool
*
* AUTOR: Andres Picazo                          FECHA: 24/03/2003      *
* MODIFICACIONES                                                       *
* --------------                                                       *
* FECHA        NOMBRE              DESCRIPCION                         *
* -------------------------------------------------------------------- *
************************************************************************
REPORT zspool2word
      NO STANDARD PAGE HEADING
      LINE-COUNT 065
      LINE-SIZE 080.

INCLUDE ole2incl.

*------TABLAS/ESTRUCTURAS----------------------------------------------*

*------TABLAS INTERNAS-------------------------------------------------*
DATA i_buffer(132) OCCURS 1000000 WITH HEADER LINE.

*------VARIABLES-------------------------------------------------------*

*------PARAMETER/SELECT-OPTIONS EN PANTALLA----------------------------*
SELECTION-SCREEN BEGIN OF BLOCK blk_par WITH FRAME TITLE text-sel. "Pará
PARAMETERS: p_spool LIKE tsp01-rqident OBLIGATORY.
SELECTION-SCREEN END OF BLOCK blk_par.

SELECTION-SCREEN BEGIN OF BLOCK blk_wor WITH FRAME TITLE text-wor.
PARAMETERS: p_word AS CHECKBOX DEFAULT 'X'.
PARAMETERS: p_fwor LIKE rlgrap-filename DEFAULT 'C:MAYOR.DOC'.
PARAMETERS: p_plan LIKE rlgrap-filename
            DEFAULT 'D:DATOSAPISMAYORPLANTILLA LIBRO MAYOR.DOC'.
SELECTION-SCREEN END OF BLOCK blk_wor.

SELECTION-SCREEN BEGIN OF BLOCK blk_fic WITH FRAME TITLE text-fic.
PARAMETERS: p_ctxt AS CHECKBOX DEFAULT ''.
PARAMETERS: p_ftxt LIKE rlgrap-filename DEFAULT 'C:MAYOR.TXT'.
SELECTION-SCREEN END OF BLOCK blk_fic.

************************************************************************
*
*                  LOGICA DEL PROGRAMA
*
************************************************************************

*----------------------------------------------------------------------*
* INITIALIZATION
*----------------------------------------------------------------------*
INITIALIZATION.

*----------------------------------------------------------------------
* START-OF-SELECTION.
*----------------------------------------------------------------------*
START-OF-SELECTION.

  PERFORM leer_spool.

  IF NOT p_ctxt IS INITIAL.
    PERFORM graba_fichero.
  ENDIF.

  IF NOT p_word IS INITIAL.
    PERFORM lanza_word.
  ENDIF.

************************************************************************
*
*                  FORMS ADICIONALES
*
************************************************************************
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  LEER_SPOOL
*&amp;amp;---------------------------------------------------------------------*
*       Lee la orden de spool en el buffer
*----------------------------------------------------------------------*
FORM leer_spool.

  CALL FUNCTION 'RSPO_RETURN_ABAP_SPOOLJOB'
    EXPORTING
      rqident              = p_spool
      first_line           = 1
      last_line            = 9999999
    TABLES
      buffer               = i_buffer
    EXCEPTIONS
      no_such_job          = 1
      not_abap_list        = 2
      job_contains_no_data = 3
      selection_empty      = 4
      no_permission        = 5
      can_not_access       = 6
      read_error           = 7
      OTHERS               = 8.

  IF sy-subrc NE 0.
    MESSAGE e398(00) WITH 'Error' sy-subrc
                        'al leer la orden de spool' p_spool.
  ENDIF.

ENDFORM.                               " LEER_SPOOL

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  GRABA_FICHERO
*&amp;amp;---------------------------------------------------------------------*
*       Graba el contenido del spool a fichero de texto.
*----------------------------------------------------------------------*
FORM graba_fichero.

  CALL FUNCTION 'WS_DOWNLOAD'
       EXPORTING
*         BIN_FILESIZE            = ' '
*         CODEPAGE                = ' '
            filename                = p_ftxt
            filetype                = 'ASC'
*         MODE                    = ' '
*         WK1_N_FORMAT            = ' '
*         WK1_N_SIZE              = ' '
*         WK1_T_FORMAT            = ' '
*         WK1_T_SIZE              = ' '
*         COL_SELECT              = ' '
*         COL_SELECTMASK          = ' '
*         NO_AUTH_CHECK           = ' '
*    IMPORTING
*         FILELENGTH              =
       TABLES
            data_tab                = i_buffer
*         FIELDNAMES              =
       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
            gui_refuse_filetransfer = 8
            OTHERS                  = 9.

  IF sy-subrc NE 0.
    MESSAGE e398(00) WITH 'Error' sy-subrc
                        'al grabar el fichero' p_ftxt.
  ENDIF.

ENDFORM.                               " GRABA_FICHERO
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  LANZA_WORD
*&amp;amp;---------------------------------------------------------------------*
*       Abre la plantilla de Word y pega el contenido del portapapeles.
*----------------------------------------------------------------------*
FORM lanza_word.
  DATA: wordapp TYPE ole2_object,
        document TYPE ole2_object,
        selection TYPE ole2_object.

* Copia el contenido del buffer en el portapeles
  CALL FUNCTION 'CLPB_EXPORT'
    TABLES
      data_tab   = i_buffer
    EXCEPTIONS
      clpb_error = 1
      OTHERS     = 2.

* Abre Word
  CREATE OBJECT wordapp 'word.application'.
  IF sy-subrc NE 0.
    MESSAGE e398(00) WITH 'No se ha podido abrir el Word'.
  ENDIF.
* Lo pone en visible
  SET PROPERTY OF wordapp 'Visible' = 1.
* Cogemes el objeto documento
  CALL METHOD OF wordapp 'Documents' = document.
* Abrimos el fichero plantilla
  IF p_plan IS INITIAL.
    CALL METHOD OF document 'Add'.
  ELSE.
    CALL METHOD OF document 'Open' EXPORTING #1 = p_plan.
    IF sy-subrc NE 0.
      MESSAGE e398(00) WITH 'Error al leer el fichero plantilla'.
    ENDIF.
  ENDIF.
* Coge el objeto selección
  CALL METHOD OF wordapp 'Selection' = selection.
* Pega el contenido del portapapeles
  CALL METHOD OF selection 'Paste'.
  IF sy-subrc NE 0.
    MESSAGE e398(00) WITH 'Error al pegar contenido del portapapeles'.
  ENDIF.
* Graba el fichero
  CALL METHOD OF wordapp 'ActiveDocument' = document.
  CALL METHOD OF document 'SaveAs' EXPORTING #1 = p_fwor.
  IF sy-subrc NE 0.
    MESSAGE e398(00) WITH 'Error al grabar el nuevo documento'.
  ENDIF.
* Cierra Word
  CALL METHOD OF wordapp 'Quit'.
  IF sy-subrc NE 0.
    MESSAGE e398(00) WITH 'Error al cerrar Word'.
  ENDIF.

ENDFORM.                               " LANZA_WORD&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2009 07:06:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/smartform-doc/m-p/5845579#M1318759</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-06T07:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: Smartform DOC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/smartform-doc/m-p/5845580#M1318760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am going to study your proposals and I will tell you if ok&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2009 08:30:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/smartform-doc/m-p/5845580#M1318760</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-06T08:30:47Z</dc:date>
    </item>
    <item>
      <title>Re: Smartform DOC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/smartform-doc/m-p/5845581#M1318761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The code doesnt read a spool when is a Smartform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my system, i dont have definied printers of type XSF. I have asked it. A solution will be use Adobe Interactive Forms, but for us it is imposible, due to the license payment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another solution?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jose.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2009 09:55:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/smartform-doc/m-p/5845581#M1318761</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-06T09:55:34Z</dc:date>
    </item>
  </channel>
</rss>

