Converting output of dw.findNext() to a string

I'm writing a script to search for
<span class="hyperlink">content</span>
in a document, change the <span> tag to <a>, and the content to href="http://content" target="_blank"
I'm thinking that part of accomplishing this would be converting the output of dw.findNext() to a string and storing the resulting string as a variable.Then I could use the variable in dreamweaver.setUpComplexFindReplace().
I'm just not entirely sure how to do that - particularly given that there are going to be multiple instances of <span class="hyperlink">content</span> in the documents I'm searching, and I want to accurately convert every one of them.
Suggestions?

Sorry - I'm being dense, but I'm having some trouble picturing how to convert the output of dw.findNext() or dw.findAll() to an array.  The idea makes a lot of sense though - I could see the script looking a bit like this:
(Script converting the output of dw.findAll() to an array (findAllArray))
Ctr = 0;
while (Ctr < findAllArray.length) {
findAllString = findAllArray[Ctr].toString()
if (findString.match("http://")) {
findString = findString }
else { findString = "http://" + findString }
dreamweaver.setUpComplexFindReplace('<dwquery><queryparams matchcase="false" ignorewhitespace="true" useregexp="false" wholeword="false" /><find><qtext qname="&lt;a class=&quot;hyperlink&quot;" qraw="true"></qtext></find><replace action="replaceText" param1="&lt;a href=&quot;' + findString + 'L&quot; onClick=&quot;popup = window.open(\'' + findString + '\', \'PopupPage\', \'height=500,width=575,scrollbars=yes,resizable=yes\'); return false&quot; target=&quot;_blank&quot;&gt;" /> </dwquery>');
dreamweaver.replaceAll()

Similar Messages

  • Converting output of script to pdf

    DEAR ALL,
    i am trying to convert output of zscript to pdf, the zscript is assign to standard tcode: J1IP, and uses zprogram, i am using otf_convert function module .the program  is activated, but while executing it give the error msg " OTF end command // missing
    in OTF data "  .What does this message no mean " TD030".......

    try the following code in close_form
      DATA: binfilesize TYPE i.
      DATA: pdftab TYPE TABLE OF tline WITH HEADER LINE.
      DATA: i_itcpp LIKE itcpp.
    DATA: i_zinv_spool LIKE zinv_spool OCCURS 0 WITH HEADER LINE.
    CLEAR i_zinv_spool. REFRESH i_zinv_spool.
      DATA: g_t_otfdata TYPE STANDARD TABLE OF itcoo WITH HEADER LINE.
    DATA filename TYPE string.
      CALL FUNCTION 'CLOSE_FORM'
       IMPORTING
         RESULT  = i_itcpp
          TABLES
            otfdata = g_t_otfdata[]
          EXCEPTIONS
            OTHERS  = 1.
      IF sy-subrc NE 0.
        retcode = sy-subrc.
        PERFORM protocol_update.
      ENDIF.
      CALL FUNCTION 'CONVERT_OTF'
    EXPORTING
    format = 'PDF'
    MAX_LINEWIDTH = 132
    ARCHIVE_INDEX = ' '
    COPYNUMBER = 0
    ASCII_BIDI_VIS2LOG = ' '
    PDF_DELETE_OTFTAB = ' '
    IMPORTING
    bin_filesize = binfilesize
    BIN_FILE =
    TABLES
    otf = g_t_otfdata[]
    lines = pdftab[]
    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.
    *****************TAKING THE DOWNLOAD
      SET COUNTRY space.
    CALL FUNCTION 'SSFCOMP_PDF_PREVIEW'
       EXPORTING
         i_otf                    = g_t_otfdata[]
       EXCEPTIONS
         acrobat_not_registered   = 1
         convert_otf_to_pdf_error = 2
         download_error           = 3
         acrobat_not_started      = 4
         cntl_error               = 5
         OTHERS                   = 6.
    ***************************DOWNLOADING THE PDF DATA******************
      CONCATENATE file_path vbco3-vbeln text-002 INTO filename.
      CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
      bin_filesize = binfilesize
      filename = filename
      filetype = 'BIN'
    APPEND = ' '
    WRITE_FIELD_SEPARATOR = ' '
    HEADER = '00'
    TRUNC_TRAILING_BLANKS = ' '
    WRITE_LF = 'X'
    COL_SELECT = ' '
    COL_SELECT_MASK = ' '
    DAT_MODE = ' '
    CONFIRM_OVERWRITE = ' '
    NO_AUTH_CHECK = ' '
    CODEPAGE = ' '
    IGNORE_CERR = ABAP_TRUE
    REPLACEMENT = '#'
    WRITE_BOM = ' '
    TRUNC_TRAILING_BLANKS_EOL = 'X'
    WK1_N_FORMAT = ' '
    WK1_N_SIZE = ' '
    WK1_T_FORMAT = ' '
    WK1_T_SIZE = ' '
    IMPORTING
    FILELENGTH =
      TABLES
      data_tab = pdftab[]
    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
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    lv_tabix = lv_tabix + 1.

  • Conversion failed when converting date and/or time from character string

    Hi experts,
    I'm trying running a query in Microsoft Query but it gives the following error message:
    "conversion failed when converting date and/or time from character string"
    when asks me the data I'm inserting 31-01-2014
    i've copy the query form the forum:
    SELECT T1.CardCode, T1.CardName, T1.CreditLine, T0.RefDate, T0.Ref1 'Document Number',
         CASE  WHEN T0.TransType=13 THEN 'Invoice'
              WHEN T0.TransType=14 THEN 'Credit Note'
              WHEN T0.TransType=30 THEN 'Journal'
              WHEN T0.TransType=24 THEN 'Receipt'
              END AS 'Document Type',
         T0.DueDate, (T0.Debit- T0.Credit) 'Balance'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')<=-1),0) 'Future'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')>=0 and DateDiff(day, T0.DueDate,'[%1]')<=30),0) 'Current'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')>30 and DateDiff(day, T0.DueDate,'[%1]')<=60),0) '31-60 Days'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')>60 and DateDiff(day, T0.DueDate,'[%1]')<=90),0) '61-90 Days'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')>90 and DateDiff(day, T0.DueDate,'[%1]')<=120),0) '91-120 Days'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')>=121),0) '121+ Days'
    FROM JDT1 T0 INNER JOIN OCRD T1 ON T0.ShortName = T1.CardCode
    WHERE (T0.MthDate IS NULL OR T0.MthDate > ?) AND T0.RefDate <= ? AND T1.CardType = 'C'
    ORDER BY T1.CardCode, T0.DueDate, T0.Ref1

    Hi,
    The above error appears due to date format is differnt from SAP query generator and SQL server.
    So you need convert all date in above query to SQL server required format.
    Try to convert..let me know if not possible.
    Thanks & Regards,
    Nagarajan

  • Needing to convert a local "numeric" value to a string type using the expression browser.

    I am trying to convert a "numeric" local value to a string through the expression browser in order to supply a string arguement.  I am currently looking through the expression browser options, but I can not find any type of Number "ToString()" function.
    Solved!
    Go to Solution.

    Hi,
    Str() function
    ie
    locals.tostring = Str(locals.dec_value)
    Regards
    Ray Farmer

  • Error "Conversion failed when converting date and/or time from character string" to execute one query in sql 2008 r2, run ok in 2005.

    I have  a table-valued function that run in sql 2005 and when try to execute in sql 2008 r2, return the next "Conversion failed when converting date and/or time from character string".
    USE [Runtime]
    GO
    /****** Object:  UserDefinedFunction [dbo].[f_Pinto_Graf_P_Opt]    Script Date: 06/11/2013 08:47:47 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE   FUNCTION [dbo].[f_Pinto_Graf_P_Opt] (@fechaInicio datetime, @fechaFin datetime)  
    -- Declaramos la tabla "@Produc_Opt" que será devuelta por la funcion
    RETURNS @Produc_Opt table ( Hora datetime,NSACOS int, NSACOS_opt int)
    AS  
    BEGIN 
    -- Crea el Cursor
    DECLARE cursorHora CURSOR
    READ_ONLY
    FOR SELECT DateTime, Value FROM f_PP_Graficas ('Pinto_CON_SACOS',@fechaInicio, @fechaFin,'Pinto_PRODUCTO')
    -- Declaracion de variables locales
    DECLARE @produc_opt_hora int
    DECLARE @produc_opt_parc int
    DECLARE @nsacos int
    DECLARE @time_parc datetime
    -- Inicializamos VARIABLES
    SET @produc_opt_hora = (SELECT * FROM f_Valor (@fechaFin,'Pinto_PRODUC_OPT'))
    -- Abre y se crea el conjunto del cursor
    OPEN cursorHora
    -- Comenzamos los calculos 
    FETCH NEXT FROM cursorHora INTO @time_parc,@nsacos
    /************  BUCLE WHILE QUE SE VA A MOVER A TRAVES DEL CURSOR  ************/
    WHILE (@@fetch_status <> -1)
    BEGIN
    IF (@@fetch_status = -2)
    BEGIN
    -- Terminamos la ejecucion 
    BREAK
    END
    -- REALIZAMOS CÁLCULOS
    SET @produc_opt_parc = (SELECT dbo.f_P_Opt_Parc (@fechaInicio,@time_parc,@produc_opt_hora))
    -- INSERTAMOS VALORES EN LA TABLA
    INSERT @Produc_Opt VALUES (@time_parc,@nsacos, @produc_opt_parc)
    -- Avanzamos el cursor
    FETCH NEXT FROM cursorHora INTO @time_parc,@nsacos
    END
    /************  FIN DEL BUCLE QUE SE MUEVE A TRAVES DEL CURSOR  ***************/
    -- Cerramos el cursor
    CLOSE cursorHora
    -- Liberamos  los cursores
    DEALLOCATE cursorHora
    RETURN 
    END

    You can search the forums for that error message and find previous discussions - they all boil down to the same problem.  Somewhere in your query that calls this function, the code invoked implicitly converts from string to date/datetime.  In general,
    this works in any version of sql server if the runtime settings are correct for the format of the string data.  The fact that it works in one server and not in another server suggests that the query executes with different settings - and I'll assume for
    the moment that the format of the data involved in this conversion is consistent within the database/resultset and consistent between the 2 servers. 
    I suggest you read Tibor's guide to the datetime datatype (via the link to his site below) first - then go find the actual code that performs this conversion.  It may not be in the function you posted, since that function also executes other functions. 
    You also did not post the query that calls this function, so this function may not, in fact, be the source of the problem at all. 
    Tibor's site

  • SAP query error - 1). [Microsoft][SQL Server Native Client 10.0][SQL Server]Conversion failed when converting date and/or time from character string.  'Received Alerts' (OAIB)

    SAP query error - 1). [Microsoft][SQL Server Native Client 10.0][SQL Server]Conversion failed when converting date and/or time from character string.  'Received Alerts' (OAIB)
    SELECT    
    CASE WHEN T0.DocStatus = 'O' THEN 'OPEN'
    WHEN T0.DocStatus = 'C' THEN 'CLOSED'  END  AS 'Document Status',
    T0.DocDate AS 'Posting Date',
    T0.DocNum AS 'Doc.No',
    T0.NumAtCard,
    T0.TransId AS 'Trans. No.',
    T0.Comments AS 'Remarks',
    T0.CardCode AS 'Offset Acct',
    T0.CardName AS 'Offset Acct Name',
    sum(T0.DocTotal) + (T0.WTSum) as 'DocTotal',
    T3.DueDate AS 'Cheque Date',
    T3.CheckSum AS 'Amount'
    FROM         ODPO AS T0 LEFT OUTER JOIN
                          VPM2 AS T1 ON T0.ObjType = T1.InvType AND T0.DocEntry = T1.DocEntry LEFT OUTER JOIN
         OVPM AS T2 ON T2.DocEntry = T1.DocNum LEFT OUTER JOIN
                          VPM1 AS T3 ON T2.DocEntry = T3.DocNum
    where T0.DocDate>='[%0]' and T0.DocDate<='[%1]'

    Hi,
    Try this:
    SELECT   
    CASE WHEN T0.DocStatus = 'O' THEN 'OPEN'
    WHEN T0.DocStatus = 'C' THEN 'CLOSED'  END  AS 'Document Status',
    T0.DocDate AS 'Posting Date',
    T0.DocNum AS 'Doc.No',
    T0.NumAtCard,
    T0.TransId AS 'Trans. No.',
    T0.Comments AS 'Remarks',
    T0.CardCode AS 'Offset Acct',
    T0.CardName AS 'Offset Acct Name',
    sum(T0.DocTotal) + (T0.WTSum) as 'DocTotal',
    T3.DueDate AS 'Cheque Date',
    T3.CheckSum AS 'Amount'
    FROM         ODPO  T0 LEFT OUTER JOIN
                          VPM2  T1 ON T0.ObjType = T1.InvType AND T0.DocEntry = T1.DocEntry
    LEFT OUTER JOIN
         OVPM  T2 ON T2.DocEntry = T1.DocNum LEFT OUTER JOIN
                          VPM1  T3 ON T2.DocEntry = T3.DocNum
    where T0.DocDate >= '[%0]' and T0.DocDate <='[%1]'
    group by T0.DocStatus,T0.DocDate ,
    T0.DocNum ,
    T0.NumAtCard,
    T0.TransId ,
    T0.Comments ,
    T0.CardCode,
    T0.CardName ,
    T0.WTSum ,
    T3.DueDate ,
    T3.CheckSum
    Thanks & Regards,
    Nagarajan

  • Converting Oracle XML Query Result in Java String by using XSU

    Hi,
    I have a problem by converting Oracle XML Query Result in Java
    String by using XSU. I use XSU for Java.
    For example:
    String datum=new OracleXMLQuery(conn,"Select max(ps.datum) from
    preise ps where match='"+args[0]+"'");
    String datum1=datum;
    I become the following error:
    Prototyp.java:47: Incompatible type for declaration. Can't
    convert oracle.xml.sql.query.OracleXMLQuery to java.lang.String.
    Can somebody tell me a method() for converting to solve my
    problem??????
    Thanks

    Hmmm.. Pretty basic just look at the example:
    OracleXMLQuery qry = new OracleXMLQuery(conn,"Select max(ps.datum) from preise ps where match='"+args[0]+"'");
    String xmlString = qry.getXMLString();
    Hi,
    I have a problem by converting Oracle XML Query Result in Java
    String by using XSU. I use XSU for Java.
    For example:
    String datum=new OracleXMLQuery(conn,"Select max(ps.datum) from
    preise ps where match='"+args[0]+"'");
    String datum1=datum;
    I become the following error:
    Prototyp.java:47: Incompatible type for declaration. Can't
    convert oracle.xml.sql.query.OracleXMLQuery to java.lang.String.
    Can somebody tell me a method() for converting to solve my
    problem??????
    Thanks

  • How can I convert output data (string?) from GPIB-read to an 1D array?

    Hello all,
    I am reading a displayed waveform from my Tektronix Oscilloscope (TDS3032) via the GPIB Read VI. The format of the waveform data is: positive integer data-point representation with the most significant byte transferred first (2 bytes per data point).
    The output data of GPIB-Read looks like a string(?) where the integer numbers and a sign like the euro-currency sign are seperated by spaces e.g. #5200004C3 4 4 4 4 3C3C3........ (C represents the euro-currency sign).
    How can I convert this waveform data into a 1D/2D array of real double floatingpoint numbers (DBL) so I can handle the waveform data for data-analysis?
    It would be very nice if someone know the solution for this.
    t
    hanks

    Hi,
    First of all, I'm assuming you are using LabVIEW.
    The first you need to do is parse the string returned by the instrument. In this case you need to search for the known symbols in the string (like the euro sign) and chop the string to get the numeric strings. Here are some examples on parsing from www.ni.com:
    Keyword Search: parsing
    Once you parse the numeric strings you can use the "String/number conversion VIs" in the String pallette.
    Hope this helps.
    DiegoF.Message Edited by Molly K on 02-18-2005 11:01 PM

  • Using Convert to handle NULL values for empty Strings ""

    After having had the problem with null values not being returned as nulls and reading some suggestion solution I added a converter to my application.
      <converter>
        <converter-id>NullStringConverter</converter-id>
        <converter-for-class>java.lang.String</converter-for-class>
        <converter-class>com.j2anywhere.addressbookserver.web.NullStringConverter</converter-class>
      </converter>
    ...I then implemented it as follows:
      public String getAsString(FacesContext context, UIComponent component, Object object)
        System.out.println("Converting to String : "+object);
        if (object == null)
          System.out.println("READING null");
          return "NULL";
        else
          if (((String)object).equals(""))
            System.out.println("READING null (Second Check)");
            return null;       
          else
            return object.toString();
      public Object getAsObject(FacesContext context, UIComponent component, String value)
        System.out.println("Converting to Object: "+value+"-"+value.trim().length());
        if (value.trim().length()==0 || value.equals("NULL"))
          System.out.println("WRITING null");
          return null;
        else
          return value.toUpperCase();
    ...I can see that it is converting my values, however the object to which the inputText fields are bound are still set to empty strings ""
    <h:inputText size="50" value="#{addressBookController.contactDetails.information}" converter="NullStringConverter"/>Also when reading the object values any nulls are already converted to empty strings before ariving at the converter. It seems that there is a default converter handling string values.
    How can I resolve this problem as set nulls when the input value is an empty string other then checking every string in my class individually. I would really hate to pollute my object model with empty string tests.
    Thanks in advance
    Edited by: j2anywhere.com on Oct 19, 2008 9:06 AM

    I changed my converter as suggested :
      public Object getAsObject(FacesContext context, UIComponent component, String value)
        if (value == null || value.trim().length() == 0)
          if (component instanceof EditableValueHolder)
            System.out.println("SUBMITTED VALUE SET TO NULL");
            ((EditableValueHolder) component).setSubmittedValue(null);
          else
            System.out.println("COMPONENT :"+component.getClass().getName());
          System.out.println("Converting to Object: " + value + "< to " + null);
          return null;
        System.out.println("Converting to Object: " + value + "< to " + value);
        return value;
      }which produces the following output :
    SUBMITTED VALUE SET TO NULL
    Converting to Object: < to null
    Info : The INFO line however comes from my controller object where I print out the set value :
    package com.simple;
    import java.util.ArrayList;
    import java.util.List;
    public class Controller
      private String information;
      /** Creates a new instance of Controller */
      public Controller()
        System.out.println("Createing Controller");
        information = "Constructed";
      public String process()
        System.out.println("Info : "+getInformation());
        return "processed";
      public String reset()
        setInformation("Re-Constructed");
        System.out.println("Info : "+getInformation());
        return "processed";
      public String setNull()
        setInformation(null);
        System.out.println("Info : "+getInformation());
        return "processed";
      public String getInformation()
        return information;
      public void setInformation(String information)
        this.information = information;
    }I also changes my JSP / JSF page a little. Here is the updated version
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
    <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
    <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%--
        This file is an entry point for JavaServer Faces application.
    --%>
    <html>
      <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
      </head>
      <body>
        <f:view>
          <h:form>
            <h:inputText id="value" value="#{Controller.information}"/>
            <hr/>
            <h:commandLink action="#{Controller.process}">
              <h:outputText id="clicker" value="Process"/>
            </h:commandLink>             
            <hr/>
            <h:commandLink action="#{Controller.reset}">
              <h:outputText id="reset" value="Reset"/>
            </h:commandLink>             
            <hr/>
            <h:commandLink action="#{Controller.setNull}">
              <h:outputText id="setNull" value="Set Null"/>
            </h:commandLink>             
          </h:form>
        </f:view>
      </body>
    </html>The converter is declared for the String class in the faces configuration file. From the log message is appears to be invoked, however the object is not set to null.
    I tested this with JSF 1.2_04-b20-p03 as well as 1.2_09-b02-FCS.
    any other suggestions what could be causing this.

  • Converting output list to pdf ... plz chk the code....

    hi
        can any one execute the following code n tell me y its not workin...
    actually the file is getting downloaded and it opens by excel but not with the pdf.
    REPORT  z_output_pdf.
    TYPES: BEGIN OF t_ekpo,
      ebeln TYPE ekpo-ebeln,
      matnr TYPE ekpo-matnr,
    END OF t_ekpo.
    DATA:wa_ekpo TYPE t_ekpo,
    p_repid LIKE sy-repid,
        it_ekpo TYPE STANDARD TABLE OF t_ekpo.
    DATA : lv_repid TYPE sy-repid,
            lv_uname TYPE sy-uname.
    data:
      mstr_print_parms like pri_params,
      mc_valid(1)      type c,
      mi_bytecount     type i,
      mi_length        type i.
    data:
      mtab_pdf    like tline occurs 0 with header line,
      mc_filename like rlgrap-filename.
    lv_repid = sy-repid.
    lv_uname = sy-uname.
    SELECT ebeln matnr
    FROM ekpo
    INTO TABLE it_ekpo.
    LOOP AT it_ekpo INTO wa_ekpo.
      WRITE :/ wa_ekpo-ebeln, wa_ekpo-matnr.
    ENDLOOP.
    DATA: print_parameters TYPE pri_params,
            valid_flag(1) TYPE c,
            mi_rqident    LIKE tsp01-rqident.
    DATA:  p_linsz TYPE sy-linsz VALUE 132, " Line size
      p_paart TYPE sy-paart VALUE 'X_65_132'.  " Paper Format
    CALL FUNCTION 'GET_PRINT_PARAMETERS'
      IMPORTING
        out_parameters       = print_parameters
        valid                = valid_flag
      EXCEPTIONS
        invalid_print_params = 2
        OTHERS               = 4.
    *-- Explicitly set line width, and output format so that
    *-- the PDF conversion comes out OK
    print_parameters-linsz = p_linsz.
    print_parameters-paart = p_paart.
        print_parameters-pdest = 'LOCL'.
    *SUBMIT (lv_repid) TO SAP-SPOOL WITHOUT SPOOL DYNPRO
                    SPOOL PARAMETERS print_parameters
                    VIA SELECTION-SCREEN
                    AND RETURN.
    *IF sy-subrc  <> 0.
    WRITE :' error'.
    *ENDIF.
    *-- Find out what the spool number is that was just created
    PERFORM get_spool_number USING lv_repid
               lv_uname
      CHANGING mi_rqident.
    *-- Convert Spool to PDF
      call function 'CONVERT_ABAPSPOOLJOB_2_PDF'
        exporting
          src_spoolid = mi_rqident
          no_dialog  = space
          dst_device = print_parameters-pdest
        importing
          pdf_bytecount                  = mi_bytecount
        tables
          pdf        = mtab_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.
    call function 'DOWNLOAD'
         exporting
              bin_filesize            = mi_bytecount
              filename                = mc_filename
             filetype                = 'BIN'
         importing
              act_filename            = mc_filename
         tables
              data_tab                = it_ekpo.
      write :' ============'.
          FORM get_spool_number *
          Get the most recent spool created by user/report              *
    -->  F_REPID               *
    -->  F_UNAME               *
    -->  F_RQIDENT             *
    FORM get_spool_number USING f_repid
         f_uname
                    CHANGING f_rqident.
      DATA:
        lc_rq2name LIKE tsp01-rq2name.
      CONCATENATE f_repid+0(8)
                  f_uname+0(3)
        INTO lc_rq2name SEPARATED BY '_'.
      DATA : ls_tsp01 TYPE tsp01,
            lt_tsp01 TYPE TABLE OF tsp01.
      SELECT * FROM tsp01
      INTO TABLE lt_tsp01
      WHERE  rq2name = lc_rq2name
      ORDER BY rqcretime DESCENDING.
      LOOP AT lt_tsp01 INTO ls_tsp01.
        f_rqident = ls_tsp01-rqident.
        EXIT.
      ENDLOOP.
    SELECT * FROM tsp01 WHERE  rq2name = lc_rq2name
    ORDER BY rqcretime DESCENDING.
       f_rqident = tsp01-rqident.
       EXIT.
    ENDSELECT.
      IF sy-subrc NE 0.
        CLEAR f_rqident.
      ENDIF.
    ENDFORM." get_spool_number
    plz chk n tell me where its goin wrong....
    Message was edited by:
            neha gupta

    Hi neha,
    i do it in this way:
    REPORT ZGRO_ITAB_PDF_SPOOL.
    DATA: BEGIN OF ITAB OCCURS 0,
             TEXT(72),
          END   OF ITAB.
    Länge der PDF-Datei in Byte
    DATA: PDF_FILESIZE TYPE I.
    DATA: BIN_FILESIZE TYPE I.
    Druckparameter mit Gültigkeit
    DATA: PARAMS      LIKE PRI_PARAMS,
          VALID       TYPE C.
    Spoolnummer
    DATA: SPOOL_NR     LIKE TSP01-RQIDENT,
          SPOOL_NR_DEL LIKE TSP01_SP0R-RQID_CHAR.
    PDF Ausgabetabelle
    DATA: BEGIN OF PDF_OUTPUT OCCURS 0.
            INCLUDE STRUCTURE TLINE.
    DATA: END   OF PDF_OUTPUT.
    DATA: PROGRAM(128) TYPE C.
    DATA: DATEI TYPE STRING VALUE 'D:TESTPDF.PDF'.
    DATA: APPL  TYPE STRING.
    START-OF-SELECTION.
    Druckparameter besorgen (hier für LOCA)
    Line-size sollte entsprechende der Ausgabe gesetzt werden
      CALL FUNCTION 'GET_PRINT_PARAMETERS'
        EXPORTING
          DESTINATION    = 'LOCA'
          LINE_SIZE      = 080
          IMMEDIATELY    = ' '
          NO_DIALOG      = 'X'
        IMPORTING
          OUT_PARAMETERS = PARAMS
          VALID          = VALID.
      CHECK VALID <> SPACE.
    Versorgen der internen Tabelle
      READ REPORT 'ZGRO_ITAB_PDF_SPOOL' INTO ITAB.
    Ausgabe der internen Tabelle mit den Druckparametern.
      NEW-PAGE PRINT ON PARAMETERS PARAMS NO DIALOG NO-TITLE NO-HEADING.
      LOOP AT ITAB.
        WRITE:/ ITAB.
      ENDLOOP.
      NEW-PAGE PRINT OFF.
    Spoolnummer besorgen
      SPOOL_NR = SY-SPONO.
    Konvertierung der Ausgabe nach PDF
      CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
        EXPORTING
          SRC_SPOOLID              = SPOOL_NR
        IMPORTING
          PDF_BYTECOUNT            = PDF_FILESIZE
        TABLES
          PDF                      = PDF_OUTPUT
        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.
      CHECK SY-SUBRC = 0.
      SPOOL_NR_DEL = SPOOL_NR.
    Spool wieder löschen
      CALL FUNCTION 'RSPO_R_RDELETE_SPOOLREQ'
        EXPORTING
          SPOOLID = SPOOL_NR_DEL.
      BIN_FILESIZE = PDF_FILESIZE.
    Download der Spools
      CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD
        EXPORTING
          BIN_FILESIZE = BIN_FILESIZE
          FILENAME     = DATEI
          FILETYPE     = 'BIN'
        CHANGING
          DATA_TAB     = PDF_OUTPUT[].
    Programmpfad auf PC für PDF ermitteln
      CALL FUNCTION 'SO_PROGNAME_GET_WITH_PATH'
        EXPORTING
          DOCTYPE           = 'PDF'
        IMPORTING
          PATHNAME          = PROGRAM
        EXCEPTIONS
          PATH_NOT_FOUND    = 1
          PROGRAM_NOT_FOUND = 2
          NO_BATCH          = 3
          X_ERROR           = 4
          OTHERS            = 5.
    PDF ausführen
      APPL = PROGRAM.
      CALL METHOD CL_GUI_FRONTEND_SERVICES=>EXECUTE
        EXPORTING
          PARAMETER   = DATEI
          APPLICATION = APPL.
    Programmende                                                        *
    Regards, Dieter

  • Converting SQL Server text field containing XML string to XI XML via JDBC

    Hello
    My client has a SQL Server database containing a field of type Text which contains an XML string e.g.
    <DispatchJob> <DispatchDateTime>2003-09-29T13:29:15</DispatchDateTime> <AssignedFSE>F118</AssignedFSE> <DispatchJobPurchase> <DealerID>14C5</DealerID> <DateOfPurchase>1997-10-01T00:00:00</DateOfPurchase> </DispatchJob>
    I am using JDBC to access this but could someone please recommend the best and easiest solution for converting this string to XI XML for subsequent mapping to BAPI or IDOC or ABAP Proxy and transmission to SAP. There are other fields as well in the database table so thoughts at the moment are to use a normal graphical message mapping followed by an XSL mapping. Will an XSL mapping be able to do this and if so is that the best solution?
    Also I need to do the reverse of this and take fields coming from SAP via BAPI,IDOC etc. and convert them to a single database table field as an XML string also via the JDBC adapter. What is the best way to do this. Could it be done simply with functions in the graphical mapping e.g. concatenate?
    Thank you in advance.
    Trevor

    Hi Michal
    Thanks for the prompt reply.
    I was anticipating XSLT for reading from the SQL Server database and converting the XML string.
    But how would you convert the individual fields from SAP into a single field as an XML string for storing in the SQL Server database? What approach would you use?
    Regards
    Trevor

  • How to convert tabs between the words in a String to a single space in java

    I have a string with more number of tabs in between them, the thing I need to do is that I need to convert all those tabs into a single space.
    I used replaceAll(“/t”,” “); but the problem is that it was converting the tabs into spaces but if we have a 3 tabs in between 2 words then this 3 tabs are converting into 3 spaces but I need to have only one space.

    user548049,
    How is your question related to the topic of this forum: Oracle Database-embedded JVM?
    Anyway, you need to use the greedy qualifier: +, like so:
    replaceAll("\\t+"," ")Good Luck,
    Avi.

  • Converting XML as table to XML as string

    All,
    I am successfully able to convert XML table from Internal Table. Now, I would like to convert this XML Table into XML string.
    Any help on this will be appreciated.
    Regards,
    Salil
    Moderator message: please search for available information/documentation before asking.
    Edited by: Thomas Zloch on Dec 7, 2010 11:57 AM

    Howdy,
    CONCATENATE LINES OF lt_table into l_string SEPARATED BY cl_abap_char_utilities=>cr_lf.
    This will create a string of the lines of the internal table with a carriage return after each line.
    Cheers
    Alex

  • To store the output of the OutputStream in the String

    I can get the output of the transformer.transform("","") to be printed on the screen, but the aim is to store the output in the String.
    I checked out the API, one way to get the data would be to store the output in the file using.....
    new StreamResult(new File("x.html")) and then get the data. But I am not suppose to use a temporary storage in the form of a file. Is there any other way I can get the data in the form of a String.
    The code is :
    File file = new File("table.xsl");
    StreamSource xslSource = new StreamSource(file);
    File file1 = new File("test.xml");
    StreamSource xmlSource = new StreamSource(file1);
    TransformerFactory tFactory = TransformerFactory.newInstance();
    Transformer transformer = tFactory.newTransformer(xslSource);
    target = new StreamResult(System.out);
    transformer.transform(xmlSource,target);
    Thanks in advance.
    manibhat

    Hi ecbouma,
    Thanks for the solution.
    I came across another approach..
    StringWriter sw = new StringWriter();
    PrintStream ps = new PrintStream(sw);
    sw.toString();
    It works fine...
    I have a question over here...
    PrintStream takes an argument that extends OutputStream, but looks like StringWriter does not extend OutputStream...
    I am not sure why does the above code works.
    manibhat

  • How to convert a number in to a time string?

    I have calculated a time in minutes: 3.75. But I will show it as a time string: 3:45 or 00:03:45 or anything like this.
    Yes, I can convert it manually, but then I can not use it in a diagram. I have a formula that calculates times for a given diameter and I will show the values in a diagram. The x axis should show the diameter, and the y axis should show the time in a typical time format eg: mm:ss.
    How can I solve this?

    Hello
    I just wish to add that I am unable to say:
    Engineers made a good or a wrong choice.
    They made one choice.
    I don't know if they imagine the odd consequences of this choice.
    But what they did with their choice is coherent.
    At least, it is as long we don't enter the area of import foreign sheets.
    When they import from XL, they forgot to take care of an important info available in .xls files which describes the date_time used starting point. It's 1/1/1904 for .xls docs created on Mac but an other one for docs created under Windows. Given this omission, imported date_time values may be wrong.
    When they import from AppleWorks it is completely foolish.
    You american users are well treated but us, european ones are in the mud.
    When we import an AW6 spreadsheet containing dates on a machine whose setting is the standard in use here: date format dd/mm/yyyy
    if the OS is 10.4.x we get odd values (I'm no longer born)
    if the OS is 10.5.x, Numbers quits.
    Apple engineers responded to Apple France that they where unable to reproduce the behavior.
    Sure, they failed to set the system's date format to the described one.
    This remind me an old bug which they can't reproduce too.
    It striked French keyboards but the tested with american ones.
    Sometimes I'm afraid that they smoke too much the carpet in Cupertino's offices
    Yvan KOENIG (from FRANCE jeudi 19 juin 2008 14:19:45)

Maybe you are looking for