Excel from abap using OLE, trying to make an excel cell-property currency

Hello everyone,
I have build an abap application which generates a price list as a MS Excel file using OLE techniques (ole2incl).
One small thing in the excel file is lacking and I hope some one can help me out:
I want to give certain cells in excel the "cell property - currency", so that excel shows the amounts as currency values. 
Has anyone done or seen that before?
Thanks a lot in advance.
Kind regard, Archie Oomen

Hi,
I am having a similiar problem trying to fix the CELL format as TEXT.
No matter how I try, it often ends up as 'GENERAL.
Have you resolved your issue?
Prehaps, you could share it if you had already rectify your problem.
Thanks a lot

Similar Messages

  • Unable to launch a new document in winword 2007 from abap using OLE

    Dear Developers,
    We have a customized abap report which use OLE to launch a new document and display SAP data in that document. It is working on winword 2003.
    When we upgrade our version to office 2007 (winword 2007), the abap report will only launch a blank screen with no new document , no data is displayed.
    After reading OSS note 1286768, I tried with sap gui version 7.10 patch 17, but it still did not work.
    Some part of the codes below :
    CREATE OBJECT wordobj 'Word.Basic' .
    CALL METHOD OF wordobj 'AppInfo' = version EXPORTING #1 = 2.
    CALL METHOD OF wordobj 'FileNew' EXPORTING #1 = 'normal.dot'.
    CALL METHOD OF wordobj 'AppShow'.
    Do we need to install any files in SAP server to enable winword 2007?
    Do you have any tips to share?
    Thanks & regards
    Bee Khuan

    HI,
       use the following
    create object wordobj 'WORD.APPLICATION' .
      if sy-subrc ne 0 .
        message s000(su) with 'Error while creating OLE object!'.
        leave program .
      endif .
      set property of gs_word 'Visible' = '1' .
    SET PROPERTY OF gs_word 'Save' = '1' .
      get property of gs_word 'documents' = gs_documents.
      call method of gs_documents 'Add' = newdoc.
    Thanks & Regards,
    Vallamuthu. M

  • Calling Java API from ABAP using JCo (Part 2)

    Hello,
    This is an additional question to thread Calling Java API from ABAP using JCo
    Has anyone managed to get the input parameter value
    input.getString("REQUTEXT")
    that is being passed from ABAP?
    If yes, what kind of setting you need to do? Because when I execute, it has no value.
    Thus, the below ECHOTEXT parameter returns blank value:
    output.setValue(input.getString("REQUTEXT"),"ECHOTEXT");
    When I debug by printing the below line, the input XML is indeed without value:
    System.out.println(input.toXML());
    Anybody knows how to pass input variable from ABAP to JAVA using JCo?
    rgs,
    hiroshi

    Hallo Hiroshi,
    as far as I can see, you are doing it the right way. The problem might be that the ABAP program does not fill in this parameter because something went wrong in the SAP System.
    Have you tried setting a breakpoint (an HTTP session - remote breakpoint) and tried checking step by step if the value is being processed and put into the REQUTEXT field?
    Bye,
    Sameer

  • Opening .pdf files from forms using OLE

    Hi,
    I want to open, print , save and save as pdf files from forms using OLE . Please help me with the same.
    Thanks
    Vidya

    If you are in client/server mode, you can put an OLE container component on your form. However, be warned that this method does not work when you convert to the forms server web enabled mode. If you anticipate moving your application to the web anytime soon, my advice would be to web-enable first and then add in the feature to view .pdf (or other) files. In our client/server app, I went to a lot of trouble to add in OLE features such as you describe, and now I have to completely re-write those features for the web.

  • Sending XML from ABAP using  WEB Service 6.20 to an external server

    Hi,
    Can anyone help me to send XML file from WAS 6.20 using ABAP withouut XI?
    I am trying to send an XML file to an external server from ABAP.  I have created the RFC destination in SM59 with address.  I am able to make connection to the host but the whole XML file is not delivered to the receiving.
    Thanks,
    Wilson

    if you want to push, then the other system should have some mechanism to receive it, they can be ftp location, http point, or a webservice. check with external system what do they support.
    based on what the external system can support , we can come up with further suggestions.

  • Calling Java API from ABAP using JCo

    I need to call Java API from ABAP & BSP also. For this I have got useful information related to JCo from following blog:
    /people/gregor.wolf3/blog/2004/08/26/setup-and-test-sap-java-connector-outbound-connection
    But, I am facing one problem. On executing Java program myExample5.java (recommended by Gregor Wolf) from command line I get following error message:
    Server JCOSERVER01 changed state from [ STOPPED ] to [ STARTED ]
    Exception in server JCOSERVER01:
    com.sap.mw.jco.JCO$Exception: (129) JCO_ERROR_SERVER_STARTUP: Server startup failed at Thu Apr 26 13:46:32 IST 2007.
    This is caused by either a) erroneous server settings, b) the backend system has
    been shutdown, c) network problems. Will try next startup in 1 seconds.
    Connect to SAP gateway failed
    Connect_PM  TPNAME=JCOSERVER01, GWHOST=gateway, GWSERV=3300
    LOCATION    CPIC (TCP/IP) on local host
    ERROR       hostname 'gateway' unknown
    TIME        Thu Apr 26 13:46:32 2007
    RELEASE     640
    COMPONENT   NI (network interface)
    VERSION     37
    RC          -2
    MODULE      ninti.c
    LINE        336
    DETAIL      NiPGetHostByName2: hostname 'gateway' not found
    SYSTEM CALL gethostbyname_r
    COUNTER     1.
    Can anyone please help me out. Do I need to do any setting?
    I'll surely reward points.
    Thanks & Regards,
    Nilesh Kumar

    Hi Nilesh,
    From the error i think that the error is with the hostname.
    Please enter the the Application Server IP/Hostname.
    If you are loggin to SAP System "XX1" from SAP GUI. Then click the change Item tab and see Application server name/IP let say "XX2" for hostname or "xx.xx.xx.xx" for IP.
    Replace <i>srv[0] = new Server("gateway","sapgw00","JCOSERVER01",repository);</i>
    with <i>srv[0] = new Server("XX2","sapgw00","JCOSERVER01",repository);</i>
    If App Server is IP then replace with
    <i>srv[0] = new Server("xx.xx.xx.xx","sapgw00","JCOSERVER01",repository);</i>
    Let me know if it is throwing any error.
    Thanks,
    Prashil

  • HTTP post from ABAP using Object Oriented method

    Hi ,
    I want to call HTTP from ABAP. I came to know that using classes & objects is the best way to fulfill it.
    Interface:
    xml_document type ref to cl_xml_document
    method post_xml_document.
    data: client type ref to if_http_client,
    xml_response type ref to cl_xml_document.
    data: xml_string type string,
    xml_xstring type xstring.
    data: zsubrc type sy-subrc.
    cl_http_client=>create_by_url( exporting url = 'http://www.example.com/post-url.xml' importing client = client exceptions others = 1 ).
    client->request->set_header_field( exporting name = '~request_method' value = 'POST' ).
    client->request->set_header_field( exporting name = '~server_protocol' value = 'HTTP/1.1' ).
    client->request->set_header_field( exporting name = 'Content-Type' value = 'text/xml' ).
    xml_document->render_2_string( exporting pretty_print = 'X' importing stream = xml_string ).
    client->request->set_cdata( exporting data = xml_string offset = 0 ).
    client->authenticate( exporting proxy_authentication = space username = 'username' password = 'password' ).
    client->send( exceptions http_communication_failure = 1 http_invalid_state = 2 ).
    client->receive( exceptions http_communication_failure = 1 http_invalid_state = 2 http_processing_failed = 3 ).
    xml_xstring = client->response->get_data( ).
    zsubrc = xml_response->parse_xstring( stream = xml_xstring ).
    endmethod.
    Above code can be used to do my work.
    Apart from the code in ABAP, what are the configurational setting that we need to do ?
    Thanks,
    Shivaa..

    >
    mohammad afzal wrote:
    > apart from usin the code u should have configured the RFC destination
    Thats nonsense, create_by_url does not need an rfc connection. TA SICF is correct.

  • Calling external Java from ABAP using JCo?

    Does anyone know if one can use JCo to write a server application that can be called from ABAP.
    We are presently using JCo to communicate from Java to SAP.
    But we need to call an external Java program from within ABAP.
    Is this possible?
    Thanks for any input.
    Fred

    Hi Gregor,
    I was hoping you would reply to this -- these posted messages had been here for quite sometime now.
    Anyway, here's the case. Our Basis team is installing the JCo in our SAP development server. This is our first time to implement this technology, so no one has a clue at all.
    Got a couple of questions for you...
    1. What do we need the JDK for? Is it mainly for editing, running, and compiling java files (e.g. Example5.java)?
    2. Does the JDK need to be installed at the SAP server as well? Or it doesn't matter, as long as the java files will be accessible from where it was installed at?
    Thanks for any response!

  • Tour 9630 says phone in use when trying to make a call.

    We have 10 new BB Tour 9630. We have already returned one due to garbled voice. Another has developed a new condition that such that when trying to make a call it says "phone in use" when there is no call in progress. Only solution so far is to take battery out and reboot. It has happened 2 times in the past week. Taking the battery out and rebooting is not an acceptable solution. Anyone have any better ideas?
    Thanks
    Mike G

    Other than exchanging it, I would suggest upgrading the OS to the latest released and see if that helps any.
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Read SQL database by ABAP using OLE

    Is somebody using abap to get a sql recordset?
    I can connect to SQL and get a recordset but I can not retrieve data from the recordset.
    I think this syntax is not correct:
    <
    data: records type P.
    get property of field 'Value' = records.
    >
    is someone can help me?
    thanks.
    report chap2801.
    include ole2incl.
    data: con type ole2_object,
          rs type ole2_object,
          field type ole2_object.
    * creating an object
    create object con 'adodb.connection'.
    check sy-subrc = 0.
    * setting properties
    set property of con 'connectionstring' = 'dsn=Northwind'.
    * calling methods
    call method of con 'open'.
    check sy-subrc = 0.
    create object rs 'adodb.recordset'.
    check sy-subrc = 0.
    set property of rs 'activeconnection' = con.
    call method of rs 'open'
      exporting #1 = 'select count(*) as a from Products'.
    check sy-subrc = 0.
    get property of rs 'fields' = field exporting #1 = 0.
    data: records type P.
    *Get number of records
    get property of field 'Value' = records.
    free object con.
    free object rs.
    free object field.

    I think this is what you need.
    http://sqlage.blogspot.com/2013/11/ssis-read-excel-file-after-skipping-few.html
    http://www.mssqltips.com/sqlservertip/2176/dynamically-find-where-table-data-starts-in-excel-using-ssis/
    http://beyondrelational.com/modules/24/syndicated/398/Posts/9953/ssis-read-and-export-excel-data-from-nth-row.aspx
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

  • Using OLE for download MS-Word

    Hello,
    can I use a MS-Word Template while creating an word obejct to write on the template
    I mean here-->
    CREATE OBJECT gs_word 'WORD.APPLICATION'.             "Create word object
    Thank you

    Hi,
    Chek out this wiki page:
    [Sample program to create a Word document from ABAP (using OLE) |http://wiki.sdn.sap.com/wiki/display/Snippets/SampleprogramtocreateaWorddocumentfromABAP%28usingOLE%29]
    Regards

  • Using Crystal Report to create reports from ABAP

    Hello,
    We are currently using Jetform as the designer for our outputs like Invoice, Order confirmation, etc.....
    We would like to switch to Crystal instead, but don't really know where to start from.
    - We already have crystal on our B/W instance
    - The additional need for Crystal is in R/3, and would be triggered trough ABAPs.
    What I am looking for. I guess, is the equivalent to when:
    we call up smartforms from ABAP using the generated function modules
    we call up sapscript from ABAP using the predefine function call (write_form open_form close_form, etc)
    we call up Jetform using special control code along with the data, sent to a jetform configured printer
    => What kind of call would we then make to send data to Crystal Reports place holder and print them?
    => What kind basis set-up is needed to have to comunication between Crystal and SAP established?
    Thank you in advance for yours hints

    Hi,
    You will likely be able to access the tables directly using the Opensql driver using Crystal Reports.  I don't understand why you are assuming that an Infoset is necessary.  Can you point me to the documentation that states that an Infoset is necessary?
    In any case, if you want to create an Infoset, this is done in SQ02.  You need to make sure that you belong to a user group in order for Crystal Report to see the infoset.

  • Regading Excel Creation using OLE

    hi friends,
    i got a new requirement where i have to create the Excel document using OLE. one more thing is some cells has to be filled with some colour and in some cells the text has to come in Vertical manner, this text is used for Header purpose.
    please help me urgently...
    Suitable Answers will get more points..........

    Hello,
    Also take a look at this code
    *& Report  ZKRIS_OLE3_PALETTE
    *& Displays the full OLE color range in excel
    REPORT  ZKRIS_OLE3_PALETTE.
    TYPE-POOLS ole2 .
    DATA:  count TYPE i,
           count_real TYPE i,
           application TYPE ole2_object,
           workbook TYPE ole2_object,
           excel     TYPE ole2_object,
           sheet TYPE ole2_object,
           cells TYPE ole2_object.
    CONSTANTS: row_max TYPE i VALUE 256. " change to 16384 for excel 2007
    DATA index TYPE i.
    DATA:
          h_cell        TYPE ole2_object,        " cell
          h_f           TYPE ole2_object,        " font
          h_int         TYPE ole2_object,
          h_width       TYPE ole2_object,
          h_columns     TYPE ole2_object,
          h_rows        TYPE ole2_object,
          h_font        TYPE ole2_object,
          h_entirecol   TYPE ole2_object.
    DATA: h_range       TYPE ole2_object.
    DATA: h_merge       TYPE ole2_object.
    CREATE OBJECT excel 'EXCEL.APPLICATION'.
    IF sy-subrc NE 0.
      WRITE: / 'No EXCEL creation possible'.
      STOP.
    ENDIF.
    SET PROPERTY OF excel 'DisplayAlerts' = 0.
    CALL METHOD OF excel 'WORKBOOKS' = workbook .
    SET PROPERTY OF excel 'VISIBLE' = 1.
    * creating workbook
    SET PROPERTY OF excel 'SheetsInNewWorkbook' = 1.
    CALL METHOD OF workbook 'ADD'.
    CALL METHOD OF excel 'WORKSHEETS' = sheet
      EXPORTING
        #1 = 1.
    SET PROPERTY OF sheet 'NAME' = 'Color Palette'.
    CALL METHOD OF sheet 'ACTIVATE'.
    DATA: col TYPE i VALUE 1,
    row TYPE i VALUE 2,
    col1 TYPE i VALUE 2,
    col_real TYPE i VALUE 1.
    row = 1.
    col = 3.
    CALL METHOD OF excel 'Cells' = h_cell
      EXPORTING
        #1 = row
        #2 = col.
    SET PROPERTY OF h_cell 'Value' = 'No.'.
    col = col + 1.
    CALL METHOD OF excel 'Cells' = h_cell
      EXPORTING
        #1 = row
        #2 = col.
    SET PROPERTY OF h_cell 'Value' = 'Background'.
    col = col + 1.
    CALL METHOD OF excel 'Cells' = h_cell
      EXPORTING
        #1 = row
        #2 = col.
    SET PROPERTY OF h_cell 'Value' = 'Foreground with white background'.
    col = col + 1.
    CALL METHOD OF excel 'Cells' = h_cell
      EXPORTING
        #1 = row
        #2 = col.
    SET PROPERTY OF h_cell 'Value' = 'Foreground with black background'.
    CALL METHOD OF excel 'Rows' = h_rows
      EXPORTING
        #1 = '2:2'.
    SET PROPERTY OF h_rows 'WrapText' = 1.
    col = 9.
    CALL METHOD OF excel 'Cells' = h_cell
      EXPORTING
        #1 = row
        #2 = col.
    SET PROPERTY OF h_cell 'Value' = 'No.'.
    col = col + 1.
    CALL METHOD OF excel 'Cells' = h_cell
      EXPORTING
        #1 = row
        #2 = col.
    SET PROPERTY OF h_cell 'Value' = 'Background'.
    col = col + 1.
    CALL METHOD OF excel 'Cells' = h_cell
      EXPORTING
        #1 = row
        #2 = col.
    SET PROPERTY OF h_cell 'Value' = 'Foreground with white background'.
    SET PROPERTY OF h_cell 'Bold' = 1.
    col = col + 1.
    CALL METHOD OF excel 'Cells' = h_cell
      EXPORTING
        #1 = row
        #2 = col.
    SET PROPERTY OF h_cell 'Value' = 'Foreground with black background'.
    CALL METHOD OF excel 'Rows' = h_rows
      EXPORTING
        #1 = '1:1'.
    SET PROPERTY OF h_rows 'WrapText' = 1.
    GET PROPERTY OF h_rows 'Font' = h_font.
    SET PROPERTY OF h_font 'Bold' = 1.
    count = 1.
    count_real = count.
    row = 2.
    col = 3.
    DO 56 TIMES.
      PERFORM write_num_and_color.
    ENDDO.
    * autofit
    CALL METHOD OF excel 'Columns' = h_columns
      EXPORTING
        #1 = 'C:L'.
    GET PROPERTY OF h_columns 'EntireColumn' = h_entirecol.
    SET PROPERTY OF h_entirecol 'Autofit' = 1.
    * write palette on lhs
    *range
    CALL METHOD OF excel 'Range' = h_range
      EXPORTING
        #1 = 'A2'
        #2 = 'A20'.
    CALL METHOD OF h_range 'Merge' = h_merge .
    CALL METHOD OF excel 'Cells' = h_cell
      EXPORTING
        #1 = 2
        #2 = 1.
    SET PROPERTY OF h_cell 'Value' = 'Palette'.
    SET PROPERTY OF h_cell 'Orientation' = 90.         "angled.
    SET PROPERTY OF h_cell 'HorizontalAlignment' = 3.  "center align
    GET PROPERTY OF h_cell 'Font'    = h_f.
    SET PROPERTY OF h_f 'Bold' = 1.                    "bold
    SET PROPERTY OF h_f 'Name' = 'Comic Sans MS'.
    SET PROPERTY OF h_f 'Size' = '14'.
    SET PROPERTY OF h_cell 'VerticalAlignment' = 2.  "center align
    * autofit
    CALL METHOD OF excel 'Columns' = h_columns
      EXPORTING
        #1 = 'A:A'.
    GET PROPERTY OF h_columns 'EntireColumn' = h_entirecol.
    SET PROPERTY OF h_columns 'ColumnWidth' = 4.
    *&      Form  write_num_and_color
    *       text
    FORM write_num_and_color.
      index = row_max * ( row - 1 ) + col.
      CALL METHOD OF sheet 'Cells' = cells
        EXPORTING
          #1 = index.
      SET PROPERTY OF cells 'Value' = count_real.
      col = col + 1.
      CALL METHOD OF excel 'Cells' = h_cell
        EXPORTING
          #1 = row
          #2 = col.
      GET PROPERTY OF h_cell 'Interior'   = h_int.
      SET PROPERTY OF h_int  'ColorIndex' = count_real.
      col = col + 1.
      CALL METHOD OF excel 'Cells' = h_cell
        EXPORTING
          #1 = row
          #2 = col.
      SET PROPERTY OF h_cell 'Value' = 'Sample Text'.
      GET PROPERTY OF h_cell 'Font'    = h_f.
      SET PROPERTY OF h_f 'ColorIndex' = count_real.
      col = col + 1.
      CALL METHOD OF excel 'Cells' = h_cell
        EXPORTING
          #1 = row
          #2 = col.
      GET PROPERTY OF h_cell 'Interior'   = h_int.
      SET PROPERTY OF h_int  'ColorIndex' = 1.
      SET PROPERTY OF h_cell 'Value' = 'Sample Text'.
      GET PROPERTY OF h_cell 'Font'    = h_f.
      SET PROPERTY OF h_f 'ColorIndex' = count_real.
      row = row + 1.
      col = col - 3.
      count = count + 1.
      IF count = 29.
        count = 1.
        row = 2.
        col = col + 6.
      ENDIF.
      count_real = count_real + 1.
    ENDFORM.                    "write_num_and_color

  • How to select a bookmark in Word from abap?

    Hi,
    We are looking for a way to select a specific bookmark from a Word document (opened before from abap, using methods of class I_OI_DOCUMENT_PROXY). The bookmark needs to be replaced by a specific value.
    We tried call method 'execute macro' .... with par1 = '-1' and parm4 = 'GoTo'. The retcode is OK, but nothing happens. Any ideas what we are missing here?
    Regards,
    Hans van der Kooij

    Thanks Jayanthi,
    We had already read the article, but did not interpret it correctly. We found the solution in an SAP OSS note.
    We had to use method get_document_handle to get an OLE link and continue from there with OLE. The article however is very brief on that part and has no example.
    So for anyone who would like to do the same or simular:
    - call method do_document->get_document_handle:
        EXPORTING
           no_flush = ''
        IMPORTING
           error = do_error
           handle = do_handle
           retcode = do_retcode.
    - GET PROPERTY OF do_handle-obj 'Application' = do_ole_application.

  • Create an SAP Web Service Consumer (calling External Sharepoint Web Service from ABAP)

    hi all,
    i am trying to
    Create an SAP Web Service Consumer (calling sharepoint Web Service from ABAP) using blog given on following link
    Create an SAP Web Service Consumer (calling External Web Service from ABAP) 
    but when i am using my url at the end of step 3, i am getting error as follows:
    i dont want to use local file option. Can anyone help me in this??
    thanks in advance
    regards,
    SDS

    Hi SDS,
    you recieved a http 404 error when trying to access the Sharepoint Web service. Http 404 indicates that the resource is not reachable (cf. HTTP 404 - Wikipedia, the free encyclopedia). There could be different reasons for that. I'd suggest rubble checking the URL of the Web service first. Try to access it from a browser on you desktop. If the URL is correc. Most likely the SAP system is not able to connect to the URL. This could, for example, be due to some firewall restrictions. You should ask a SAP Basis colleague if they are able to access the URL of the Web service from the server on which the SAP system is running.
    Christian

Maybe you are looking for

  • IPod touch is no longer aware of the music...

    I recently updated my iPod touch to the most up-to-date firmware/software available (1.1.2 I believe, I'll fix this if I posted in error) and upon restarting my iPod and attempting to browse my music I noticed that it said I had no music. So, I simpl

  • How can you know if there is a change made to your mac?

    I'm not even sure how to ask this and I didn't know how to phrase the question.  I was using Firefox 10.0.2 and had been to a variety of my usual websites.  Nothing any different at all.  Signed into my credit union and when I had finished what I nee

  • Addition of number to a timestamp

    Hi, I have a variable v_time_stamp timestamp(6); v_number number; I derive the number dynamically. I derive v_time_stamp from a table. when i add v_time_stamp and v_number i face a strange problem. the millisecond part of the result is lost. can some

  • Exporting MiniDV video to MacMini

    I have a Sony GV-D1000 MiniDV Video Walkman that must be six plus years old?  I haven't used it for two years. Today I attempted to plug it into my new MacMini running Lion 10.7.3 -- and quickly discovered I did not have the correct Firewire cable. T

  • Solaris 8/9 Containers on SXCE?

    Do containers work on SXCE snv_130? I've added the pkgs, from the Solaris 10 DVD, along with 1.0.1 release in downloads, but although I can do a 'create -t SUNWsolaris9' and set up the zone, when I verify it I get 'Unknown Brand'. Have I done this th