Reading WebDAV Content from ABAP

Hello,
I like to read WebDAV Content from SAP NetWeaver Portal KM with ABAP.
For writing Content with WebDAV I found this post:
A small working example of how to use the Abap webdav client to write files
With Method GET_CONTENT from CL_SWDCL_NAMESPACE_CLIENT I can read single files, but what I need is a list with files and folders for a given path.
I also tried to use the Interface IF_SWDCL_BASIC_SEARCH_CLIENT, but I only get HTML-Errorcodes 400 or 422 since I don't know which parameters I need.
Maybe there is someone here who can help me to solve this problem.
Thank you.

Hello,
I face the same problem, did you already find a solution you can share?
Thanks in advance
Stefan

Similar Messages

  • How to print PDF file content from ABAP in background?

    Hi,
    Is it possible to print PDF file content from ABAP in background?
    I have some PDF content which I need to print it, these PDF files are generated outside the SAP.
    Please have you any suggestions?
    Thank you
    Tomas

    <b><u>Solution:</u></b><br>
    <br>
    The target output device must support PDF print, this is only one limitation.<br>
    <br>
    REPORT  z_print_pdf.
    TYPE-POOLS: abap, srmgs.
    PARAMETERS: p_prnds LIKE tsp01-rqdest OBLIGATORY DEFAULT 'LOCL',
                p_fname TYPE file_table-filename OBLIGATORY LOWER CASE,
                p_ncopi TYPE rspocopies OBLIGATORY DEFAULT '1',
                p_immed AS CHECKBOX.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
      DATA: lv_rc     TYPE i,
            lv_filter TYPE string.
      DATA: lt_files TYPE filetable.
      FIELD-SYMBOLS: <fs_file> LIKE LINE OF lt_files.
      CONCATENATE 'PDF (*.pdf)|*.pdf|' cl_gui_frontend_services=>filetype_all INTO lv_filter.
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        EXPORTING
          file_filter             = lv_filter
        CHANGING
          file_table              = lt_files
          rc                      = lv_rc
        EXCEPTIONS
          OTHERS                  = 1.
      IF sy-subrc NE 0 AND lv_rc EQ 0.
        MESSAGE 'Error' TYPE 'E' DISPLAY LIKE 'S'.
      ENDIF.
      READ TABLE lt_files ASSIGNING <fs_file> INDEX 1.
      IF sy-subrc EQ 0.
        p_fname = <fs_file>-filename.
      ENDIF.
    AT SELECTION-SCREEN.
      DATA: lv_name   TYPE string,
            lv_result TYPE boolean.
      lv_name = p_fname.
      CALL METHOD cl_gui_frontend_services=>file_exist
        EXPORTING
          file                 = lv_name
        RECEIVING
          result               = lv_result
        EXCEPTIONS
          OTHERS               = 1.
      IF sy-subrc NE 0.
        MESSAGE 'Bad file!' TYPE 'E' DISPLAY LIKE 'S'.
      ENDIF.
      IF lv_result NE abap_true.
        MESSAGE 'Bad file!' TYPE 'E' DISPLAY LIKE 'S'.
      ENDIF.
    START-OF-SELECTION.
    END-OF-SELECTION.
      PERFORM process.
    FORM process.
      DATA: lv_name     TYPE string,
            lv_size     TYPE i,
            lv_data     TYPE xstring,
            lv_retcode  TYPE i.
      DATA: lt_file TYPE srmgs_bin_content.
      lv_name = p_fname.
      CALL METHOD cl_gui_frontend_services=>gui_upload
        EXPORTING
          filename                = lv_name
          filetype                = 'BIN'
        IMPORTING
          filelength              = lv_size
        CHANGING
          data_tab                = lt_file
        EXCEPTIONS
          OTHERS                  = 1.
      IF sy-subrc NE 0.
        MESSAGE 'Read file error!' TYPE 'E' DISPLAY LIKE 'S'.
      ENDIF.
      CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
        EXPORTING
          input_length = lv_size
        IMPORTING
          buffer       = lv_data
        TABLES
          binary_tab   = lt_file
        EXCEPTIONS
          failed       = 1
          OTHERS       = 2.
      IF sy-subrc NE 0.
        MESSAGE 'Binary conversion error!' TYPE 'E' DISPLAY LIKE 'S'.
      ENDIF.
      PERFORM print USING p_prnds lv_data CHANGING lv_retcode.
      IF lv_retcode EQ 0.
        WRITE: / 'Print OK' COLOR COL_POSITIVE.
      ELSE.
        WRITE: / 'Print ERROR' COLOR COL_NEGATIVE.
      ENDIF.
    ENDFORM.                    " PROCESS
    FORM print USING    iv_prndst  TYPE rspopname
                        iv_content TYPE xstring
               CHANGING ev_retcode TYPE i.
      DATA: lv_handle    TYPE sy-tabix,
            lv_spoolid   TYPE rspoid,
            lv_partname  TYPE adspart,
            lv_globaldir TYPE text1024,
            lv_dstfile   TYPE text1024,
            lv_filesize  TYPE i,
            lv_pages     TYPE i.
      CLEAR: ev_retcode.
      CALL FUNCTION 'ADS_SR_OPEN'
        EXPORTING
          dest            = iv_prndst
          doctype         = 'ADSP'
          copies          = p_ncopi
          immediate_print = p_immed
          auto_delete     = 'X'
        IMPORTING
          handle          = lv_handle
          spoolid         = lv_spoolid
          partname        = lv_partname
        EXCEPTIONS
          OTHERS          = 1.
      IF sy-subrc NE 0.
        ev_retcode = 4.
        RETURN.
      ENDIF.
      CALL FUNCTION 'ADS_GET_PATH'
        IMPORTING
          ads_path = lv_globaldir.
      CONCATENATE lv_globaldir '/' lv_partname '.pdf' INTO lv_dstfile.
      OPEN DATASET lv_dstfile FOR OUTPUT IN BINARY MODE.
      IF sy-subrc NE 0.
        ev_retcode = 4.
        RETURN.
      ENDIF.
      TRANSFER iv_content TO lv_dstfile.
      IF sy-subrc NE 0.
        ev_retcode = 4.
        RETURN.
      ENDIF.
      CLOSE DATASET lv_dstfile.
      IF sy-subrc NE 0.
        ev_retcode = 4.
        RETURN.
      ENDIF.
      CALL FUNCTION 'ZBAP_RM_PDF_GET_PAGES'
        EXPORTING
          iv_content = iv_content
        IMPORTING
          ev_pages   = lv_pages.
      lv_filesize = XSTRLEN( iv_content ).
      CALL FUNCTION 'ADS_SR_CONFIRM'
        EXPORTING
          handle   = lv_handle
          partname = lv_partname
          size     = lv_filesize
          pages    = lv_pages
          no_pdf   = ' '
        EXCEPTIONS
          OTHERS   = 1.
      IF sy-subrc NE 0.
        ev_retcode = 4.
        RETURN.
      ENDIF.
      CALL FUNCTION 'ADS_SR_CLOSE'
        EXPORTING
          handle = lv_handle
        EXCEPTIONS
          OTHERS = 1.
      IF sy-subrc NE 0.
        ev_retcode = 4.
        RETURN.
      ENDIF.
    ENDFORM.                    " PRINT

  • Reading Webservice information from ABAP Program

    Hi All,
    How to read a webservice information from a ABAP program ?
    Are there any webservices available in ABAP which can do this .
    Gopal.

    Hi,
    The following code will call the web service and fill the data into internal table which was received from the Web service. This code will send & Receive the data from ABAP to Webservice.
    Change the Header detail as per your Webservice.
    REPORT  ZWORKORDER.
    TYPES: BEGIN OF OUTTAB1 ,
      JOBCODE(20),
      COMPONENTCODE(20),
      ACCURATEHOURS(20),
      ACCURATECOST(20),
      LENGTH TYPE I,
       END OF OUTTAB1 .
    DATA: OUTTAB TYPE  TABLE OF OUTTAB1.
    DATA: TAB TYPE OUTTAB1.
    DATA: WF_O LIKE LINE OF OUTTAB .
    DATA: XSLT_ERR TYPE REF TO CX_XSLT_EXCEPTION .
    DATA: RLENGTH TYPE I,
          TXLEN TYPE STRING  .
    DATA: HTTP_CLIENT TYPE REF TO IF_HTTP_CLIENT .
    DATA: WF_STRING TYPE STRING .
    DATA: WF_STRING1 TYPE STRING .
    DATA: WF_PROXY TYPE STRING ,
          WF_PORT TYPE STRING .
    CLEAR WF_STRING .
    Form the input string to send the Input Data to Web service.
    CONCATENATE
    '<?xml version="1.0" encoding="utf-8"?>'
    '<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">'
    '  <soap:Body>'
    '    <GetWorkOrder xmlns="http://*******erica.net/webservices/">'
    '      <nWorkOrder>2</nWorkOrder>'
    '      <nDistributorCode>4871</nDistributorCode>'
    '      <model>HM400</model>'
    '     <type>1 </type>'
    '    </GetWorkOrder>'
    '  </soap:Body>'
    '</soap:Envelope>'
    INTO WF_STRING .
    CLEAR :RLENGTH , TXLEN .
    RLENGTH = STRLEN( WF_STRING ) .
    MOVE: RLENGTH TO TXLEN .
    CLEAR: WF_PROXY, WF_PORT .
    CALL METHOD CL_HTTP_CLIENT=>CREATE
      EXPORTING
        HOST    = '192.168.1.41' "'http://****merica.net/webservices'
        SERVICE = '8080'
        SCHEME  = '1'
      IMPORTING
        CLIENT  = HTTP_CLIENT.
    HTTP_CLIENT->PROPERTYTYPE_LOGON_POPUP = HTTP_CLIENT->CO_DISABLED.
    CALL METHOD HTTP_CLIENT->REQUEST->SET_HEADER_FIELD
      EXPORTING
        NAME  = '~request_method'
        VALUE = 'POST'.
    CALL METHOD HTTP_CLIENT->REQUEST->SET_HEADER_FIELD
      EXPORTING
        NAME  = '~server_protocol'
        VALUE = 'HTTP/1.1'.
    CALL METHOD HTTP_CLIENT->REQUEST->SET_HEADER_FIELD
      EXPORTING
        NAME  = '~request_uri'
        VALUE = '/service/accurate/workorder.asmx?'.
    CALL METHOD HTTP_CLIENT->REQUEST->SET_HEADER_FIELD
      EXPORTING
        NAME  = 'Content-Type'
        VALUE = 'text/xml; charset=utf-8'.
    CALL METHOD HTTP_CLIENT->REQUEST->SET_HEADER_FIELD
      EXPORTING
        NAME  = 'Content-Length'
        VALUE = TXLEN.
    CALL METHOD HTTP_CLIENT->REQUEST->SET_HEADER_FIELD
      EXPORTING
        NAME  = 'SOAPAction'
        VALUE = 'http://********merica.net/webservices/GetWorkOrder'.
    CALL METHOD HTTP_CLIENT->REQUEST->SET_CDATA
      EXPORTING
        DATA   = WF_STRING
        OFFSET = 0
        LENGTH = RLENGTH.
    Send the Input Data to Web service.
    CALL METHOD HTTP_CLIENT->SEND
      EXCEPTIONS
        HTTP_COMMUNICATION_FAILURE = 1
        HTTP_INVALID_STATE         = 2.
    Receive the Input from Web Serice.
    CALL METHOD HTTP_CLIENT->RECEIVE
      EXCEPTIONS
        HTTP_COMMUNICATION_FAILURE = 1
        HTTP_INVALID_STATE         = 2
        HTTP_PROCESSING_FAILED     = 3.
    CLEAR WF_STRING1 .
    WF_STRING1 = HTTP_CLIENT->RESPONSE->GET_CDATA( ).
    DATA: LENGTH TYPE I.
    LENGTH = STRLEN( WF_STRING1 ).
    DATA: VALUE_FIELD TYPE NAME_KOMP.
    DATA: VALUE TYPE REF TO DATA.
    FIELD-SYMBOLS: <FS_CONVERTED_DATA>.
    DATA: TAB1 TYPE TABLE OF STRING.
    DATA: FROM_LENGTH TYPE I VALUE 1.
    DATA: TO_LENGTH TYPE I.
    DATA: DIFF TYPE I.
    DATA: START TYPE I VALUE 1.
    DO.
    JOBCODE.
      SEARCH WF_STRING1 FOR 'JobCode=' . "STARTING AT START .
      IF SY-SUBRC <> 0.
        EXIT.
      ENDIF.
      FROM_LENGTH = SY-FDPOS .
      FROM_LENGTH = FROM_LENGTH  + 8.
      SEARCH WF_STRING1 FOR 'JobDescription=' ."STARTING AT START ..
      TO_LENGTH = SY-FDPOS .
      DIFF = TO_LENGTH - FROM_LENGTH .
      MOVE WF_STRING1+FROM_LENGTH(DIFF) TO TAB-JOBCODE.
      TO_LENGTH = DIFF + TO_LENGTH.
      SHIFT WF_STRING1 BY TO_LENGTH PLACES.
    COMPONENT CODE
      SEARCH WF_STRING1 FOR 'ComponentCode=' .
      IF SY-SUBRC <> 0.
        EXIT.
      ENDIF.
      FROM_LENGTH = SY-FDPOS .
      FROM_LENGTH = FROM_LENGTH  + 14.
      SEARCH WF_STRING1 FOR 'ComponentDescription=' .
      TO_LENGTH = SY-FDPOS .
      DIFF = TO_LENGTH - FROM_LENGTH .
      MOVE WF_STRING1+FROM_LENGTH(DIFF) TO TAB-COMPONENTCODE.
      TO_LENGTH = DIFF + TO_LENGTH.
      SHIFT WF_STRING1 BY TO_LENGTH PLACES.
    AccurateHours
      SEARCH WF_STRING1 FOR 'AccurateHours=' .
      IF SY-SUBRC <> 0.
        EXIT.
      ENDIF.
      FROM_LENGTH = SY-FDPOS .
      FROM_LENGTH = FROM_LENGTH  + 14.
      SEARCH WF_STRING1 FOR 'AccurateCost='.
      TO_LENGTH = SY-FDPOS .
      DIFF = TO_LENGTH - FROM_LENGTH .
      MOVE WF_STRING1+FROM_LENGTH(DIFF) TO TAB-ACCURATEHOURS.
      TO_LENGTH = DIFF + TO_LENGTH.
    AccurateCost
      SEARCH WF_STRING1 FOR 'AccurateCost='.
      FROM_LENGTH =  SY-FDPOS.
      FROM_LENGTH =  FROM_LENGTH + 13.
      SEARCH WF_STRING1 FOR '/>'.
      TO_LENGTH = SY-FDPOS.
      DIFF = TO_LENGTH - FROM_LENGTH .
      MOVE WF_STRING1+FROM_LENGTH(DIFF) TO TAB-ACCURATECOST.
      TO_LENGTH = DIFF + TO_LENGTH.
      SHIFT WF_STRING1 BY TO_LENGTH PLACES.
      APPEND TAB TO OUTTAB.
    ENDDO.
    WRITE: (10) 'JOBCODE'.
    WRITE (20) 'COMPONENTCODE'.
    WRITE (30) 'ACCURATEHOURS'.
    WRITE (40) 'ACCURATECOST'.
    LOOP AT OUTTAB INTO TAB.
      WRITE:/ TAB-JOBCODE .
      WRITE (20) TAB-COMPONENTCODE.
      WRITE (30) TAB-ACCURATEHOURS.
      WRITE (40) TAB-ACCURATECOST.
    ENDLOOP .
    It is better to create a proxy, it then puts a level of abstraction between in that coding. All you need to do is then access the proxy class.
    Besides that i think you can do it by configuring the ITS and calling the webservice by means of using BSP applications in ABAP
    <b>I believe you need to create a proxy in order to consume your web service.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/bf/d005244e9d1d4d92b2fe7935556b4c/frameset.htm
    Reward points</b>
    Regards

  • How to read the content from a External Content Type with out creating External List in Sharepoint 2013?

    Hi,
    I have a requirement to read the External Content Type and storing the Data in a Session Variable. The Reading of the content from External Content Type with out creating a External List.
    Please help I am trying to find the solution, but unable to do that.
    Thanks,
    Pradeep

    Hi,
    Firstly an external content type designed to work with SharePoint list and there is no way to read apart from this.
    If you are looking the solution out of the " Business Connectivity" then find that data source has been exposed through WCF and  Web Service ?
    So you can use REST API and CSOM to consume those data in SharePoint.
    You can also leverage the ADO.NET option if the datasources based on MS technologies.
    Murugesa Pandian| MCPD | MCTS |SharePoint 2010

  • Reading XML Data from ABAP Program?

    Hi,
    How do I read XML Data from an ABAP Program? For example if I have the below basic XML Code-
    <xml>
    <Name> Thiru </Name>
    <Age> 24 </Age>
    <City> chennai </Chennai>
    </xml>
    How do i read the data within the Name,Age, and City tags into variables in the ABAP Program?
    Regards,
    Thiru

    if you decide to do in XSLT, I have a sample list here:
    XML file like this:
    <?xml version="1.0" encoding="UTF-16"?>
    <F>
    <P1>
    <t_1>value1</t_1>
    <t_2>testvalue</t_2>
    </P1>
    <P2>
    </P2>
    </F>
    XSLT file like this:
    <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sapxsl="http://www.sap.com/sapxsl" version="1.0">
    <xsl:strip-space elements="*"/>
    <xsl:template match="F">
    <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
    <asx:values>
    <<b>DOCUMENT</b>>
    <xsl:apply-templates/>
    </<b>DOCUMENT</b>>
    </asx:values>
    </asx:abap>
    </xsl:template>
    <xsl:template match="P1">
    <ENTRY>
    <<b>T_1</b>><xsl:value-of select="t_1"/></T_1>
    <<b>T_2</b>><xsl:value-of select="t_2"/></T_2>
    </ENTRY>
    </xsl:template>
    </xsl:transform>
    ABAP program like this:
    DATA: BEGIN OF wa_upload,
    text(255) TYPE c,
    END OF wa_upload,
    itab_upload LIKE TABLE OF wa_upload,
    BEGIN OF wa_document,
    t_1 TYPE string,
    t_2 TYPE string,
    END OF wa_document,
    itab_document LIKE TABLE OF wa_document.
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    filename = 'XXXXX'
    filetype = 'ASC'
    TABLES
    data_tab = itab_upload.
    CALL TRANSFORMATION zrappel_xml_test
    SOURCE XML itab_upload
    RESULT <b>document</b> = itab_document.
    You should pay attention to the bold words.
    hope it will be helpful
    thanks

  • Reading InfoCube contents in ABAP

    Dear,
    I'm reading the contents of an InfoCube using FM RSDRI_INFOPROV_READ. This works fine, characteristics & keyfigures are coming through, only when I want the currency keys and units, the returned itab (E_T_DATA) contains additional records in stead of the currencies and units filled in the corresponding entries. Probably beacuse units are in a separate dimension. Does anyone know how I can populate the currency keys & units in the same records as where the keyfigures are stored?
    Thanx in advance for your help!
    Regards,
    Marco

    Hi Lakshman,
    1.Files in application server are called 'Sequential files'. they are also called as 'Dataset'.
    2.To handle sequential file we can follow the below said procedures.
       a.  To open sequentioal file:
              OPEN DATASET <FILENAME> FOR { OUTPUT/INPUT/APPENDING}
              IN {TEXT MODE/BINARY MODE}
       b. To process ( reading/writing):
           TRANSFER <FIELD> TO <FILE NAME>,
           READ DATASET <FILENAME> INTO <FIELD>.
      c.  To close:
            CLOSE DATASET <FILENAME>
    3. To see  the application files tcode: AL11
    4. Download the files from application server to presentation server : CG3Y
    5. Presentation server to application server : CG3Z
    Regards,
    Sakthivel.VT

  • Reading email contents from a program

    Hello,
    I need to read an email content from a program, to attach it to an CRM activity. Does anybody know if there is a function for this? I will have the email data (Object id, folder, type, etc) available.
    Thank you!
    Paola

    Hi,
    My Requirement is :
    1)I got a requirement to read Bounce back mails in the CRM System .My present scenario is that once a campaign is executed , the mails which get bounce back are returned to outlook location.
    2)The required scenario demands that, to read email IDs which get Bounce back and need to be compared with Email Ids in the Target group , which is assigned to the campaign and update the 'COunter' field which is assigned to the E-mails in the Master Data.
    3)Is there any machanism to read the BOunce-Back mails in CRM System itself (or) It should be read from outlook location where the mails are returned presently, so that COUNTER which is tied up with the E-mails in Master Data can automatically updated.
    4) Is there any possibility to read the Mails in the Outlook location with Mail IDs in the CRM system.
    I have gone through Mr Thomas article and i think it works for my requirement  but i dont know how to proceed further to read bounce back mails when a campaign is executed in CRM System.
    Can any one guide  me how to solve this problem .
    THANKS
    SURESH

  • Read MIME content from POP Server

    Hi All,
    I just want to read the mails from POP Server and redirect the mails to different folders as per the content existing in the mail.
    Now I could able to read the messages from the mails from POP server as well. I'm facing problem while reading MIME type mails from the POP server.
    Can anyone guide me or send me some examples for reading mails from POP Server...
    Thanks in Advance.
    Regds,
    Murugesh

    Reading from a POP server is easy. If it's not working for you
    then please describe in more detail what you tried and what
    happened.
    Saving the messages in other folders can't be done using
    POP, since it supports only a single folder. You can save the
    messages in IMAP folders, or you can get a third party local
    store provider and save the messages in local files.

  • Reading binary content from HTTP?

    As long as i read text (ascii) data from a HttpURLConnection, the resulting stream (written to a file) is okay (readable). but when i want to read a PDF file with the same code, the written output file is not readable with the Acrobat reader (file type not supported or file corrupted):
                    //read data from HTTP server:
                    InputStream is = null;
                    HttpURLConnection con = null;
                    try {
                        System.out.print(key+": connecting ...");
                        con = (HttpURLConnection) url.openConnection();
                        if (con instanceof HttpsURLConnection) { //HTTPS URL?
                            //avoid "java.io.IOException: HTTPS hostname wrong:  should be <217.5.135.142>"
                            ((HttpsURLConnection) con).setHostnameVerifier(new HostnameVerifier() {
                                public boolean verify(String hostname, SSLSession session) {
                                    return true;
                        System.out.print(" reading ...");
                        try {
                            is = con.getInputStream();
                            try { //in case input stream is compressed via GZIP:
                                is = new GZIPInputStream(is);
                            } catch (IOException ioe) {
                                //ignore (input stream is not GZIP compressed)
                        } catch (IOException ioe) {
                            System.err.println("Error getting input stream. HTTP return code: "+con.getResponseCode()+" ("+con.getResponseMessage()+"). "+ ioe);
                            return;
                        IOUtils.writeStream(is, os);
                    } catch (Exception e) {
                        System.err.println("\nError getting content from URL: " + e);
                        return;
                    } finally {
                        if (is != null) { try { is.close(); } catch (IOException ioe) { ioe.printStackTrace(System.err); } }
                        if (con != null) { try { con.disconnect(); } catch (Exception e) { e.printStackTrace(System.err); } }
                        if (os != null) { try { os.close(); } catch (IOException ioe) { ioe.printStackTrace(System.err); } }
                    }when i open the written pdf file with a text editor, i noticed the the first line is
    DF-1.4
    so, the first character "P" is missing. but even when i add the "P" in the text file and save it, Acrobat Reader shows the same error.
    is there another way to load binary data from a HttpUrlConnection and/or write it to a file?

    yes, it's simple and works with text/ascii content from URLS:
         public static void writeStream(InputStream inputStream, OutputStream outputStream) throws IOException {
            if (inputStream != null && outputStream != null) {
                int count;
                byte[] bytes = new byte[128];
                while ((count = inputStream.read(bytes, 0, bytes.length)) != -1) { //use full read() method for GZIPInputStream to be treated correctly
                    outputStream.write(bytes, 0, count);     
        }//writeStream()it's pdf content that doesn't work (completely). the first two characters "%P" are mssing. if i add them by hand (e.g. my writting this two characters to the outputSTream before continuing with the PDF content), the resulting file is okay (can be read by acrobat reader).
    perhaps, some inner Java class misinterpret the "%P" characters as a special code sequence?

  • Problem in reading net content from java on unix environment

    Friends,
    I was trying to write sample java program which can able to connect to web and read the content.
    But facing some proble. Kindly help me
    package com.validate.email;
    import java.net.*;
    import java.io.*;
    public class ReadWSDL {
      public static void main(String args[]){
           String nextLine;
           URL url = null;
           URLConnection urlConn = null;
           InputStreamReader  inStream = null;
           BufferedReader buff = null;
           try{
                System.setProperty("http.proxyHost","proxy.resources.company.com");
                System.setProperty("http.proxyPort", "80");
              // Create the URL obect that points
              // at the default file index.html
              url  = new URL("http://ws.cdyne.com/emailverify/Emailvernotestemail.asmx?wsdl" );
              urlConn = url.openConnection();
             inStream = new InputStreamReader(
                               urlConn.getInputStream());
               buff= new BufferedReader(inStream);
           // Read and print the lines from index.html
            while (true){
                nextLine =buff.readLine(); 
                if (nextLine !=null){
                    System.out.println(nextLine);
                else{
                   break;
         } catch(MalformedURLException e){
           System.out.println("Please check the URL:" +
                                               e.toString() );
         } catch(IOException  e1){
          System.out.println("Can't read  from the Internet: "+
                                              e1.toString() );
    Error
    Can't read from the Internet: java.net.UnknownHostException: www.tpisoft.com

    my_forum wrote:
    The same code is working in Windows, where I get the proxy from Browser.How?
    But on Unix machine it is not working. And I am using the proxy which is DNS/hostname of the unix machine.Don't you mean the DNS/hostname of the proxy?

  • Read Planning Workbook content from ABAP

    Hi guys,
    This is really a complex query that I bring to the table and might be quite hard to be solved.
    I have a table with a lot of values in the planning workbook like workbook name, user and different other stuff.
    These need to be brought to BW. Unfortunately, I understood this isn't possible via a query or something else, so I'm looking for ways in which I can:
    a) Use the ABAP variable exit coding so that I can read the cells directly from the workbook
    b) Use VBA and call sapbex.xla or BexAnalyzer.xla methods so that I can call my own ABAP functions or at least make the values from these cells available in BW.
    I require all this info when the user saves the workbook.
    Any help would be highly appreciated and don't hesitate to ask for clarifications if you find my description confusing.
    Best regards,
    George

    Hi,
    why do you need this information in the backend? What happens when you re-open the workbook? Do you need to load it again from the backend to the frontend or do just need to overwrite the information you have stored in the backend?
    There are possibililties to create z-function modules (RFC) and to call them from the BExAnalyzer. Did you already check this? Please try searching for "Excel SAP RFC site:help.sap.com" e.g. using google to find more information about this topic.
    Regards Matthias

  • Read IDOC content in abap program

    Hi all
    using IDOC number, i'd like to read informations containted in that IDOC.
    In EDI_* Function moduls i have found EDI_DOCUMENT_OPEN_FOR_EDIT
    The problem is that this FM is used to process IDOC to change its content. i supose that the IDOC is enqued when processed by this FM.
    Do you know any other way to access IDOC data content in READ mode
    Thank you in advance
    Regards

    Hi,
    You can use the following FM.
    IDOC_READ_COMPLETELY (Read IDoc Data)
    IDOC_TYPE_COMPLETE_READ (Read IDoc Structure and Segments)
    or
    read the idoc data from database table edid4 and edids (idoc status))and edidc (idoc control data).
    Regards,
    S.Velsankar

  • Read rtf contents from xml file and print them in pdf using documaker

    I am using Documaker 11.2.
    Input file is XML and for a particular tag, rtf contents is passed like
    {\rtf1\ansi\ansicpg1252\deff0\deflang1033\deflangfe1033{\fonttbl{\f0\fswiss\fprq2\fcharset0 Arial Narrow;}} \viewkind4\uc1\pard\b\f0\fs20 My\b0 name is Schoo.....
    I want to read this data excluding the RTF abstract and print the text alone in pdf along with format like paragraph,bold....
    The output file generated is PDF.
    Kindly let me know how can i achieve this in Documaker.

    There is no direct support for importing RTF from an XML extract. Perhaps feature 1514 "Mapping formatted XML data into multiline field" will be of some use. This was released in 11.0, I believe.
    Essentially you can establish paragraph and certain text formatting like bold and underline when you include the proper token information in the data. I believe this is similar to simple HTML tokens.
    Example: &lt;FIELD>&lt;P>First paragraph of data.&lt;/P>&lt;P>New paragraph with &lt;B>&lt;U>bold and underline text&lt;/U>&lt;/B>. Rest of paragraph normal.&lt;/P>&lt;/FIELD>
    The result is something like this:
    <P>First paragraph of data.</P><P>New paragraph with <B><U>bold and underline text</U></B>. Rest of paragraph normal.</P>

  • Read XML content in ABAP

    Hi Experts,
    I have a requirement, where I need to Parse the XML file after reading it from application server. Based on the data, I need to add some Tags to XML data.
    Can we achieve the solution in ABAP.
    Request your expertise.
    Thank you,
    Amit

    Hi Amit,
    Yes, you can achieve this in SAP either by creating a DOM representation of the XML document, or by the parser firing events as logical elements are encountered in a run through an XML document.
    Refer the following documents for more details.
    DOM-based method - Parsing an XML document DOM-based - Application Development on AS ABAP - SAP Library 
    Event Based - Parsing an XML document event-based - Application Development on AS ABAP - SAP Library 
    Refer this document for sample code - Parse an xml file and insert values in ABAP - ABAP Development - SCN Wiki
    Regards
    Anoop

  • Read DB2 tables from ABAP program

    Hi All,
    I have a requirement to read a DB2 table(in our landscape) from the ABAP program.  I appreciate any pointers.
    Thanks,
    Kiran.

    Connecting to an External database from SAP
    Step 1: Create an entry for the External database in DBCON table using Trxn: DBCA.
    Table: DBCON (Description of Database Connections)
    Field Name Description Value (For: E.g.:)
    CON_NAME Logical name for a database RAJ
    DBMS Database system MSS
    USER_NAME Database user <username>
    PASSWORD Password for setting up the connection to the database <pwd>/<pwd>
    CON_ENV Database-specific information for a database connection MSSQL_SERVER=depotserver MSSQL_DBNAME=HOF_INDORE
    DB_RECO Availability type for an open database connect
    Step 2: Now you can write code to connect to the external database…
    Your Sample code can be something like this……
    FUNCTION-POOL z_houston. "MESSAGE-ID ..
    DATA: BEGIN OF wa,
    c_locid(3),
    c_locname(50),
    c_locstate(5),
    END OF wa.
    FUNCTION z_houston_connect.
    ""Local interface:
    EXEC SQL.
    CONNECT TO 'RAJ' AS 'V'
    ENDEXEC.
    EXEC SQL.
    SET CONNECTION 'V'
    ENDEXEC.
    *- Get the data from MS-SQL Server
    EXEC SQL.
    open C1 for
    select
    loc_id,
    loc_name,
    loc_state
    from ho_loc_mast
    ENDEXEC.
    DO.
    EXEC SQL.
    FETCH NEXT C1 into :wa-c_locid, :wa-c_locname, :wa-c_locstate
    ENDEXEC.
    IF sy-subrc = 0.
    PERFORM loop_output.
    ELSE.
    EXIT.
    ENDIF.
    ENDDO.
    EXEC SQL.
    CLOSE C1
    ENDEXEC.
    ENDFUNCTION.
    *& Form LOOP_OUTPUT
    Output
    FORM loop_output .
    WRITE: /5 wa-c_locid, 10 wa-c_locname, 65 wa-c_locstate.
    CLEAR wa.
    ENDFORM. " LOOP_OUTPUT

Maybe you are looking for

  • Safari bounces when clicked but won't open

    I click on safari i bounces and is on for a second then closes and there's no report or anything. Can someone please help

  • MRP Type PD and VB combination

    Hi SAP Gurus,         I have one req. as below, I have one material which i want to run on both PD & VB type. Means, for simple example 1. I have one fert item in that one roh item bom. first case:- 1. Roh item has min, max level is 500, 1000 ea. i.e

  • ITunes Store does not show author and "album artwork" of my podcast

    Although all information is available - the itunes store does not mention the author and "album artwork" of my podcast - if podcast is downloaded, album artwork is shown... How can I add the informatin (especially that author is not "unknown" anymore

  • Mountain Lion isn't letting me use the App Store, Can someone help me?

    I thought that mountain lion will be a very useful software upgrade. After I downloaded Mountain Lion, I can't connect to the App Store and I can't turn dictation on. Can someone please help me?

  • Arabic is not displayed properly in Oracle Forms...

    Hi, I'm using oracle 9i database and forms 6i. mt database contains arabic data and the character set of database is "UTF8". when i display the data in arabic in forms, it is giving junk characters. i set the NLS_LANG for forms to UTF8 in the registr