ABAP control - Excel spreedsheet generation

Hi,
I am programming generation of the Excel document from ABAP. I created additional popupscreen where the Excel should be shown with the generated spreedsheet and I have following questions:
- I used the example program SAPRDEMOEXCELINTEGRATION2 as a reference for my development. I created my own class and method to generate Excel spreedsheet, I use following objects/methods like in reference program:
c_oi_container_control_creator=>get_container_control
CREATE OBJECT container
         EXPORTING container_name = 'CONTAINER'.
CALL METHOD lc_control->init_control
CALL METHOD lc_control->get_link_server
CALL METHOD link_server->start_link_server
To retrieve the document form from repository:
CALL METHOD in_bds_document->get_info
  CALL METHOD in_bds_document->get_with_url
And to generate the XLS:
CALL METHOD control->get_document_proxy
    CALL METHOD proxy->open_document
    CALL METHOD proxy->get_spreadsheet_interface
It works perfect, the Excel is shown in the popup dialog window. When the window is closed, following releasing methods are executed:
CALL METHOD proxy->is_destroyed
    CALL METHOD proxy->close_document
    CALL METHOD proxy->save_document_to_table
    CALL METHOD proxy->release_document
    CALL METHOD cl_gui_cfw=>dispatch.
    IF NOT lc_bds_instance IS INITIAL.
      FREE lc_bds_instance.
    ENDIF.
    IF NOT link_server IS INITIAL.
      CALL METHOD link_server->stop_link_server.
      FREE link_server.
    ENDIF.
    IF NOT lc_control IS INITIAL.
      CALL METHOD lc_control->destroy_control.
      FREE lc_control.
    ENDIF.
    LEAVE TO SCREEN 0.
So it looks like all the objects are released after the Excel generation. The problem is that when the user immediately run the
program again, the Excel is not shown - just an empty popup dialog screen. Anybody has any idea what is wrong?
- Second question. This method requires to have Excel installed on the presentation frontend. So it can be used in normal dialog programming, but how to generate .XLS file in BSP? The code upper can't be used because SAP GUi is not available in this schema. Is the generating .HTML file with CONTENT-TYPE: .xls the only method to generate .XLS?
Thank you!
Edited by: Wojciech Walczak ITMAXI.COM on Aug 12, 2009 11:57 AM

/people/alvaro.tejadagalindo/blog/2009/02/05/excel-ole-and-abap--create-fancy-reports
https://wiki.sdn.sap.com/wiki/display/Snippets/ALV%2bGrid%2bDisplay%2bwith%2bcheckbox%2bto%2bprocess%2bselected%2brecords%2bat%2bruntime

Similar Messages

  • How can I access Excel spreedSheet from JSP under Unix

    I have Jrun webserver running on Unix. I want to write a JSP application that will open Excel spreedsheet. Please let me know if anyone has done this kind of thing. Thanks.

    Well there can be various solutions if u really wanna try. The best one is as below.
    Ms-Excel has the facility to save an spreadsheet as an HTML page. That solves all ur problems.

  • Fine grained control of page generation

    I'm using UIX generated pages. In the tableGroup.jut template am I correct in assuming that $TABLE_ITEMS$ and $TABLE_SELECTION$ are replaced by the JAG and therefore any changes to the actual table rows and <tableSelection> element would have to be done post generation ?
    Are there plans to allow for a more detailed level of control over page generation in future ?
    Thanks

    Yes we do have plans for more finegrained control. The next major release (so not the maintainance release due next month but the one where we will align with JDeveloper 10.1.3 and ADF Faces) we will try to have as much generation logic reside in (customizable) templates as possible. Item-level templates are first on our list, but we plan to take it much further. Ultimately, we would like to have no implementation code (meaning xml/jsf/html, not Java code as we don't generate Java code to begin with) 'black-box generated' out of our generator any more (especially for the UI).
    This is the ultimate goal and I can't promise we'll reach it in one go, but we really like the template/token-driven generator idea and will create our entire generator architecture around it in the next major release (which we have not started coding but have been brainstorming a lot about).
    Kind regards,
    Peter Ebell
    JHeadstart Team

  • Interface between ABAP and Excel-report

    Hi anyone!
    I need to implement a BAdI (CRM_MKTTG_SEG_MEM_EX) for displaying an aggregated BW field in the CRM Segment Builder. However my programmer knows little about the interface between ABAP an Excel. He therefore struggles with the programming. Have anyone of you any suggestions for how he can call a field in a query. Has anyone used this BAdI for the same purpose?
    Thanks, Camilla

    Hello Camilla,
    i think you should ask your question in a generic form in the BW forum. Ask them for access to a Query via RFC.
    Regards
    Gregor

  • Is it possible to show the comments from Excel spreedsheets in Numbers?

    Is it possible to show the comments from Excel spreedsheets in Numbers? And can I create comments in new Numbers spreedsheets like Excel?

    Yes.  You can open excel files with comments and add comments using the menu item "Insert > Comment":
    Numbers will export a file as excel using the menu item "File > Export > Excel...":
    But will not natively save excel files.  So if you will be regularly working with a file in both Numbers and Excel you should consider using only one of the programs as the only way to save a document in Numbers is as a Numbers document.  Said another way Number can only import and export Excel.

  • Control Excel with Access (Complicated Export)

    I would like to have MS Access:
    Open this Excel Sheet: 
    \\Cable\West-Groups\TCR\Construction\Reports\Data.xlsx
    Save it as: 
    \\Cable\West-Groups\TCR\Construction\Dashboard\Data.xlsx
    Close: 
    \\Cable\West-Groups\TCR\Construction\Dashboard\Data.xlsx
    Export the table [05-Job] to the tab [Data] of
    \\Cable\West-Groups\TCR\Construction\Dashboard\Data.xlsx
    Open the Excel Sheet: 
    \\Cable\West-Groups\TCR\Construction\Dashboard\Data.xlsx
    Make the Excel Sheet Visible (this might be required from my past experience with Excel)
    I know this is possible, but I don’t know where to start with the code.
    Note:  Our department is using Office 2013 (if this matters)

    I don't know if this helps, but I do something similar in Excel (to create and control both excel and pdf), but I can't seem to make "what I call simular commands" work in Access to control Excel.
    Note:  On using just the code you gave above, I get a VB Compile Error Expected =
    Sub Button31_Click()
    On Error GoTo ErrorMessage:
    Sheet3.Unprotect
    Sheet3.Range("AE21") = Environ("USERNAME")
    If UCase(Sheet3.Range("AE21")) <> UCase(Sheet3.Range("AE22")) Then
    Sheet3.Range("AE21") = "Do Not Change/Move This Cell"
    MsgBox "At this time, this function works for the serviceability group only"
    Sheet1.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
    Sheet3.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
    Exit Sub
    End If
    If Len(Range("a6")) <> 4 Or Len(Range("a6")) = 0 Then
    MsgBox "Error - City Agent"
    Sheet3.Range("AE21") = "Do Not Change/Move This Cell"
    Sheet1.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
    Sheet3.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
    Exit Sub
    End If
    If Len(Range("e6")) > 18 Or Len(Range("e6")) = 0 Then
    MsgBox "Error - City Name"
    Sheet3.Range("AE21") = "Do Not Change/Move This Cell"
    Sheet1.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
    Sheet3.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
    Sheet3.Range("AE21") = "Do Not Change/Move This Cell"
    Sheet1.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
    Sheet3.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
    Exit Sub
    End If
    If Len(Range("l6")) > 9 Or Len(Range("l6")) = 0 Then
    MsgBox "Error = City Abbreviation"
    Sheet3.Range("AE21") = "Do Not Change/Move This Cell"
    Sheet1.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
    Sheet3.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
    Exit Sub
    End If
    If Len(Range("q6")) > 2 Or Len(Range("q6")) = 0 Then
    MsgBox "Error - Head End"
    Sheet3.Range("AE21") = "Do Not Change/Move This Cell"
    Sheet1.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
    Sheet3.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
    Exit Sub
    End If
    If Len(Range("u6")) <> 2 Or Len(Range("u6")) = 0 Then
    MsgBox "Error - Management Area"
    Sheet3.Range("AE21") = "Do Not Change/Move This Cell"
    Sheet1.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
    Sheet3.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
    Exit Sub
    End If
    If Len(Range("y6")) <> 2 Or Len(Range("y6")) = 0 Then
    MsgBox "Error - Service Area"
    Sheet3.Range("AE21") = "Do Not Change/Move This Cell"
    Sheet1.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
    Sheet3.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
    Exit Sub
    End If
    'If Len(Range("ac6")) > 5 Or Len(Range("ac6")) = 0 Then
    'MsgBox "Error - Hub"
    'Sheet3.Range("AE21") = "Do Not Change/Move This Cell"
    'Sheet1.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
    'Sheet3.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
    'Exit Sub
    'End If
    If Len(Range("ak6")) <> 2 Or Len(Range("ak6")) = 0 Then
    Sheet3.Range("AE21") = "Do Not Change/Move This Cell"
    Sheet1.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
    Sheet3.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
    MsgBox "Error - State"
    Exit Sub
    End If
    If Len(Range("AN6")) <> 5 Or Len(Range("AN6")) = 0 Then
    Sheet3.Range("AE21") = "Do Not Change/Move This Cell"
    Sheet1.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
    Sheet3.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
    MsgBox "Error - Zip Code"
    Exit Sub
    End If
    If Len(Range("aq6")) = 0 Then
    MsgBox "Notice - Complex Code Is Missing. This is a warning only, continueing with operation"
    End If
    If Len(Range("aq6")) < 4 And Len(Range("aq6")) > 0 Then
    MsgBox "Error - Complex Code"
    Sheet3.Range("AE21") = "Do Not Change/Move This Cell"
    Sheet1.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
    Sheet3.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
    Exit Sub
    End If
    If Len(Range("aq6")) > 5 Then
    MsgBox "Error - Complex Code"
    Sheet3.Range("AE21") = "Do Not Change/Move This Cell"
    Sheet1.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
    Sheet3.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
    Exit Sub
    End If
    If Len(Range("f15")) = 0 Then
    MsgBox "Error - Project Name"
    Exit Sub
    End If
    If Len(Range("as15")) = 0 Then
    MsgBox "Error - Date"
    Sheet3.Range("AE21") = "Do Not Change/Move This Cell"
    Sheet1.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
    Sheet3.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
    Exit Sub
    End If
    Dim Z As String
    Sheet1.Unprotect
    Z = Right("1000" & Sheet1.Range("K1"), 4)
    Sheet1.Range("K1") = Z + 1
    ActiveSheet.Unprotect
    Range("a1").Value = Environ("USERNAME") & " " & Date
    ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
    Dim X As String
    Dim fnm1 As String
    Dim flnm As String
    Dim fnm2 As String
    Dim strFilePath As String
    X = Sheet3.Range("BA3")
    Sheets("Export").Visible = True
    Sheets("eSlam").Visible = True
    Sheets("Export").Select
    Range("A1:BF1101").Clear
    Sheets("eSlam").Select
    Range("A1:BF" & X).Select
    Selection.Copy
    Sheets("Export").Select
    Range("A1").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
    flnm = Right("0000" & Year(Sheet1.Range("AS15")), 4) & Right("00" & Month(Sheet1.Range("AS15")), 2) & Right("00" & Day(Sheet1.Range("AS15")), 2) & " CSV" & Z & " " & Sheet1.Range("F15")
    fnm1 = Mid(ActiveWorkbook.Name, 1, InStr(ActiveWorkbook.Name, ".") - 1) 'XLS Name
    Sheet4.Copy
    fnm2 = ActiveWorkbook.Name
    Windows(fnm1).Activate
    Sheets("Template").Select
    Cells(13, 6).Select
    Sheets("Export").Visible = False
    Sheets("eSlam").Visible = False
    Windows(fnm2).Activate
    strFilePath = "G:\Construction\Common\Serviceability\eSlam\" & flnm
    ActiveWorkbook.SaveAs strFilePath, xlCSV
    ActiveWorkbook.Close (False)
    Windows(fnm1).Activate
    flnm = Right("0000" & Year(Sheet1.Range("AS15")), 4) & Right("00" & Month(Sheet1.Range("AS15")), 2) & Right("00" & Day(Sheet1.Range("AS15")), 2) & " SRC" & Z & " " & Sheet1.Range("F15")
    strFilePath = "G:\Construction\Common\Serviceability\eSlam\" & flnm
    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=strFilePath & ".pdf", Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
    Windows(fnm1).Activate
    MsgBox "Your CSV and PDF documents are now available in the 'G:\Construction\Common\Serviceability\Eslam\' folder."
    Sheet3.Range("AE21") = "Do Not Change/Move This Cell"
    Sheet1.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
    Sheet3.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
    Exit Sub
    Sheet3.Range("AE21") = "Do Not Change/Move This Cell"
    Sheet1.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
    Sheet3.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
    ErrorMessage:
    MsgBox "An error occured, please save and close your file, and try again. If error continues, please contact support staff"
    End Sub

  • Add multiple graphs in one chart(ex.scatter chart) using labview excel report generation toolkit

    How to add multiple graphs in one chart(ex.scatter chart) using labview excel report generation toolkit. Assume like my test data is like below:
    X-Axis
    Data1
    Data2
    1
    1
    2
    13
    2
    3
    14
    3
    4
    15
    5
    5
    16
    3
    6
    7
    7
    The above graph generated manually in excel. I want to generate the same using excel report generation toolkit. when I use Excel Insert Graph.vi where the input data is 2D array with numeric data but here labview converts the empty cells (eg.x -axis 1,data1- is empty) as zero and while plotting i am getting zero for empty cell values.
    Can anyone please help me on how to plot the graph without adding zero for empty cells?
    Thanks&Regards,
    Bharathi T
    TE
    X-Axis
    Data1
    Data2
    1
    1
    2
    13
    2
    3
    14
    3
    4
    15
    5
    5
    16
    3
    6
    7
    7

    Hi Bharathi,
    The Excel Insert graph function takes in only 2d arrays as inputs. Since arrays can only have numeric values, any table with a null string is read as 0. Now to get a plot like you mentioned, you could read the table and replace blank Strings as NaN. NaN values in an array when plotted do not appear in the excel sheet. For reference I have attached a sample vi to help you understand.
    Regards
    Vijetha Nuthakki,
    Applications Engineer
    NI Systems India
    Attachments:
    Excel_graph_multiplot.vi ‏21 KB

  • Export recordset to an Excel Spreedsheet

    Ok here is my problem. I have a dynamic recodset table that
    pulls the information from an access database and I'm getting an
    error message when the recordset has more than 1,000 records. I'm
    able to export the databa to an excel spreedsheet if the recordset
    is about 500 or less than 1,000.
    These is for the local intranet we have inhouse. Is there
    some kind of settings that I need to change on IIS? I'm using
    ASP/VBSCRIPT.

    Every 1000 rows or so, issue a Response.Flush() command to
    write the output
    generated so far.
    "FLEQUE" <[email protected]> wrote in
    message
    news:ed70i7$6b8$[email protected]..
    >I did what you sugested. I'm getting the following error
    message which is
    >the
    > buffer time out. How do I fix this problem?
    >
    > Response object error 'ASP 0251 : 80004005'
    >
    > Response Buffer Limit Exceeded
    >
    > /bprw_database_listing_media_print.asp, line 0
    >
    > Execution of the ASP page caused the Response Buffer to
    exceed its
    > configured
    > limit.
    >
    >
    >
    >
    quote:
    Originally posted by:
    Newsgroup User
    > You've probably got a script timeout. Comment out the
    Excel headers and
    > switch back to HTML output; you'll be able to see the
    error displayed on
    > the
    > HTML page.
    >
    >
    > "FLEQUE" <[email protected]> wrote in
    message
    > news:ecvl3f$bi6$[email protected]..
    > > The error message is the following:
    > >
    > > **************************
    > > Internet Explorer cannot download.. "file name"
    from 192.IP.NUMBER.
    > >
    > > Internet Explorer was not able to open this
    Internet site. The requested
    > > site
    > > is either unavailable or cannot be found. Please
    try again later.
    > >
    > > **************************
    > >
    > > I only get the message when I have about 6,000
    records on the table.
    > >
    >
    >
    >
    >
    >
    >

  • How do I control a first generation airport express with 10.8.2?

    How do I control a first generation airport express with 10.8.2?
    I have an old airport express that one of my machines running mountain lion will not support.  If I upgrade all of my systems to mountain lion, is there any way I can still control and configure the airport express?

    You may need Airport Utility v. 5.6
    http://support.apple.com/kb/DL1482
    It does work with Mountain Lion.

  • Control Excel properties in ABAP report - Background mode

    Hi,
    We have a requirement to send a excel sheet attachment through mail.This report should have the option to
    to run in background.We should be able to control the properties of the excel sheet.(Eg column width ,cell format)
    I could control the excel properties through OLE object,.But i came to know that OLE objects can not be used in background.
    Is there any other way to acheive this?
    Regards,
    Charumathi

    Hi Charumathi,
    Check the below link. It may help u a little bit.
    [Function module to download to Excel worksheet.;

  • Error while exporting data from ABAP to Excel

    Hello All,
    iam trying to download data from ABAP scrn to Excel using I_OI_SPREADSHEET METHODS. I get an error in method 'SET_RANGES_DATA' - 'Memory protection fault occurred in document interface'.
    I have pasted my code below. Kindly help me to solve this issue.
    Create container ??
      CALL METHOD c_oi_container_control_creator=>get_container_control
        IMPORTING
          control = g_control
          error   = g_error.
    Initialize
      CALL METHOD g_control->init_control
        EXPORTING
          r3_application_name      = 'Basis'
          parent                   = g_container
         register_on_close_event  = c_reg_on_close_event
         register_on_custom_event = c_reg_on_custom_event
         no_flush                 = c_no_flush
        IMPORTING
          error                    = g_error.
    Set Doc type
      g_document_type = 'Excel.Sheet'.
    Create Proxy
      CALL METHOD g_control->get_document_proxy
        EXPORTING
          document_type  = g_document_type
        IMPORTING
          document_proxy = g_document
          error          = g_error.
      CALL METHOD g_document->create_document
        EXPORTING
          document_title = 'Excel'.                             "#EC NOTEXT
      CALL METHOD g_document->get_spreadsheet_interface
        IMPORTING
          sheet_interface = g_handle.
      CHECK g_document IS NOT INITIAL.
    read selected line data from gtab
      READ TABLE g_tab_data INDEX 1  INTO l_wa_pos_trans.
    Get Field Descriptions
      CALL FUNCTION 'DDIF_FIELDINFO_GET'
        EXPORTING
          tabname        = 'TRIGS_EXPORT_EXCEL'
          langu          = sy-langu
        TABLES
          dfies_tab      = lt_dfies
        EXCEPTIONS
          not_found      = 1
          internal_error = 2
          OTHERS         = 3.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    Header for User Data
      l_h_cnt  = 1.
      LOOP AT lt_dfies INTO lwa_dfies.
        IF lwa_dfies-fieldname EQ 'USER_ID'          OR
           lwa_dfies-fieldname EQ 'EXCEL_DATE'       OR
           lwa_dfies-fieldname EQ 'EXCEL_TIME'       OR
           lwa_dfies-fieldname EQ 'SECURITY_ACCOUNT' OR
           lwa_dfies-fieldname EQ 'SECURITY_ID'      OR
           lwa_dfies-fieldname EQ 'COMPANY_CODE'.
          PERFORM fill_cell USING l_h_cnt 1 1 lwa_dfies-scrtext_m.
          l_h_cnt  =  l_h_cnt  + 1.
        ENDIF.
      ENDLOOP.
    Fill Header Values
      PERFORM fill_cell USING 1 2 1 sy-uname.
      PERFORM fill_cell USING 2 2 1 sy-datum.
      PERFORM fill_cell USING 3 2 1 sy-uzeit.
      PERFORM fill_cell USING 4 2 1 l_wa_pos_trans-company_code .
      PERFORM fill_cell USING 5 2 1 l_wa_pos_trans-security_account.
      PERFORM fill_cell USING 6 2 1 l_wa_pos_trans-security_id.
    Texts
    l_h_cnt = l_h_cnt + 1.
      PERFORM fill_cell USING l_h_cnt 1 1 text-011.
      PERFORM fill_cell USING l_h_cnt 3 1 text-012.
    Range for header
      range_item-name = 'RANGE1'.
      range_item-rows = '7'.
      range_item-columns = '3'.
      range_item-code = g_handle->spreadsheet_insertall.
      APPEND range_item TO range_list.
      CALL METHOD g_handle->set_selection
        EXPORTING
          left    = 1
          top     = 1
          rows    = 7
          columns = 3
        IMPORTING
          retcode = retcode.
      CALL METHOD g_handle->insert_range
        EXPORTING
          columns = 3
          rows    = 7
          name    = 'RANGE1'
        IMPORTING
          retcode = retcode.
      CALL METHOD g_handle->set_ranges_data
        EXPORTING
          ranges   = range_list
          contents = gt_cell_data
        IMPORTING
          retcode  = retcode.
    Columns for PC
      CLEAR: gt_cell_data[].
      l_pc_cnt  = l_h_cnt + 1.
      LOOP AT lt_dfies INTO lwa_dfies.
        IF lwa_dfies-fieldname EQ 'SBWHR' OR
           lwa_dfies-fieldname CP '_PC'.
          PERFORM fill_cell USING l_pc_cnt 1 0 lwa_dfies-scrtext_m.
          l_pc_cnt =  l_pc_cnt + 1.
        ENDIF.
      ENDLOOP.
    Pos Curr - Values
      PERFORM fill_cell USING 9 2 0  trls_position_value-sbwhr.
      PERFORM fill_cell USING 10 2 0 trls_position_value-purch_pc.
      PERFORM fill_cell USING 11 2 0 trls_position_value-charge_pc.
      PERFORM fill_cell USING 12 2 0 trls_position_value-impmnt_pc.
      PERFORM fill_cell USING 13 2 0 trls_position_value-amort_pc.
      PERFORM fill_cell USING 14 2 0 trls_position_value-val_ti_pc.
      PERFORM fill_cell USING 15 2 0 trls_position_value-val_idx_pc.
      PERFORM fill_cell USING 16 2 0 trls_position_value-val_ch_ti_pc.
      PERFORM fill_cell USING 17 2 0 trls_position_value-val_ti_npl_pc.
      PERFORM fill_cell USING 18 2 0 trls_position_value-val_idx_npl_pc.
      PERFORM fill_cell USING 19 2 0 trls_position_value-val_ch_ti_npl_pc.
      PERFORM fill_cell USING 20 2 0 trls_position_value-book_val_pc.
    Columns for VC
      l_vc_cnt = l_h_cnt + 1.
      LOOP AT lt_dfies INTO lwa_dfies.
        IF lwa_dfies-fieldname EQ 'SBWHR' OR
             lwa_dfies-fieldname CP '_VC'.
          PERFORM fill_cell USING l_vc_cnt 3 0 lwa_dfies-scrtext_m.
          l_vc_cnt =  l_vc_cnt + 1.
        ENDIF.
      ENDLOOP.
    Val Curr
      PERFORM fill_cell USING 9 4 0  trls_position_value-svwhr.
      PERFORM fill_cell USING 10 4 0 trls_position_value-purch_vc.
      PERFORM fill_cell USING 11 4 0 trls_position_value-charge_vc.
      PERFORM fill_cell USING 12 4 0 trls_position_value-impmnt_vc.
      PERFORM fill_cell USING 13 4 0 trls_position_value-amort_vc.
      PERFORM fill_cell USING 14 4 0 trls_position_value-val_ti_vc.
      PERFORM fill_cell USING 15 4 0 trls_position_value-val_fx_vc.
      PERFORM fill_cell USING 16 4 0 trls_position_value-val_idx_vc.
      PERFORM fill_cell USING 17 4 0 trls_position_value-val_ch_ti_vc.
      PERFORM fill_cell USING 18 4 0 trls_position_value-val_ch_fx_vc.
      PERFORM fill_cell USING 19 4 0 trls_position_value-val_fx_npl_vc.
      PERFORM fill_cell USING 20 4 0 trls_position_value-val_ti_npl_vc.
      PERFORM fill_cell USING 21 4 0 trls_position_value-val_idx_npl_vc.
      PERFORM fill_cell USING 22 4 0 trls_position_value-val_ch_ti_npl_vc.
      PERFORM fill_cell USING 23 4 0 trls_position_value-val_ch_fx_npl_vc.
      PERFORM fill_cell USING 24 4 0 trls_position_value-book_val_vc.
    Range for PC and VC
      CLEAR: range_list[].
      range_item-name = 'RANGE2'.
      range_item-rows = '17'.
      range_item-columns = '4'.
      range_item-code = g_handle->spreadsheet_insertall.
      APPEND range_item TO range_list.
      CALL METHOD g_handle->set_selection
        EXPORTING
          left    = 1
          top     = 9
          rows    = 17
          columns = 4
        IMPORTING
          retcode = retcode.
      CALL METHOD g_handle->insert_range
        EXPORTING
          columns = 4
          rows    = 17
          name    = 'RANGE2'
        IMPORTING
          retcode = retcode.
      CALL METHOD g_handle->set_ranges_data
        EXPORTING
          ranges   = range_list
          contents = gt_cell_data
        IMPORTING
          retcode  = retcode.
    ***********************************Form routine****************
    FORM fill_cell USING i j bold val.
      DATA:
       wa_cell_data TYPE soi_generic_item.
      wa_cell_data-row = i.
      wa_cell_data-column = j.
      wa_cell_data-value = val.
      APPEND wa_cell_data TO gt_cell_data.
    ENDFORM.                    "FILL_CELL

    Solved

  • About ABAP and EXCEL output files

    Hi experts.
    We are using an outbound interface that creates a Excel files with ABAP OO. The main problem of the issue occurs when we call the method to save and close the excel document already created but in windows task manager it stays opened.
    Is there any possibility in abap to call some method or statement to close (or kill) the excel application already opened in Windows?
    Regards!

    Am not sure but my answer is NO.
    Because, ABAP is a different server and windows is a different server.
    So you cannot control any applications and actions that are performed out of sap box.
    Thanks
    Kiran

  • Control Excel options from SAP

    Hi Experts,
    In excel I want to add the expiry date from ABAP code.
    I am generating the excel and at the time of generation I want it to restrict to some people which I am able to do
    using function ADD of excel--> permission
    In the F1 of function ADD it is mentioned that we can pass 3 variables
    --> Email
    --> permission type
    --> expiration date
    I tried various format of date but this is not working.
    When i call the bewlo mentioned code, I am able to add the user restriction
      CALL METHOD OF w_permission 'Add' = w_usrperm
        EXPORTING
        #1 = email
        #2 = 1.
    when i try to use the 3rd parameter, it fails and doesn't even add the user restriction.
      CALL METHOD OF w_permission 'Add' = w_usrperm
        EXPORTING
        #1 = email
        #2 = 1
        #3 = sy-datum.
    can you help me on this.
    Regards,
    Yadesh

    try to pass the date with the following format:
    write sy-datum to lv_datum DD/MM/YYYY.
    (change the format DD/MM/YYYY according to your regional settings)
    if it doesnt work then try
    concatentate '#' lv_datum '#' into lv_value.
    in Excel some date values must be specified with # around... but I'm not sure if it is the case for you

  • Excel report generation error

    Hi,
    Does anyone have experienced (and solved) this behaviour?
    I've been using the report generation toolkit to build word report without
    problem. I've also solved a lot of problems in the excel part of the toolkit
    (e.g. building graphs with >20000 points). It finally works in development
    environment.
    Now when I install the executable (, with the installer) the word reports
    still work, but the excel report don't. The executable does run on a
    different system, but the excel versions are the same (both Excel 2000).
    I have copied the excel library in the data directory of the executable.
    The following error is generated:
    -2147319784
    Old format or invalid type library
    Excel_Open.vi
    This is the first report generation vi that is called. I us
    e it to open a
    template.
    Any help is appreciated.
    Wiebe.

    Hi,
    Surfing the internet, I found this comment:
    *Start quote*
    Sometimes you'll find that a parameter is required that isn't mentioned
    anywhere in the application's documentation. This happens when you need to
    specify system information: the chief example of this is the lcid, which is
    a locale identifier, and which pops up all over the place in Excel. The good
    news is that there is a constant in the Windows unit which provides you with
    the correct value, LOCALE_USER_DEFAULT:
    var
    lcid: integer;
    begin
    lcid := LOCALE_USER_DEFAULT;
    Excel.Visible[lcid] := True;
    There's also a function, GetUserDefaultLCID, but using that value can cause
    an error, complaining about an 'old format or invalid type library' on some
    setups. Using LOCALE_USER_DEFAULT for the
    LCID value should fix that.
    *End quote*
    Could this be the problem?
    Regards,
    Wiebe.
    "Wiebe@AIR" wrote in message
    news:3e79a3aa$0$140$[email protected]..
    > Hi,
    >
    > Does anyone have experienced (and solved) this behaviour?
    >
    > I've been using the report generation toolkit to build word report without
    > problem. I've also solved a lot of problems in the excel part of the
    toolkit
    > (e.g. building graphs with >20000 points). It finally works in development
    > environment.
    >
    > Now when I install the executable (, with the installer) the word reports
    > still work, but the excel report don't. The executable does run on a
    > different system, but the excel versions are the same (both Excel 2000).
    >
    > I have copied the excel library in the data directory of the executable.
    >
    > The following error is generated:
    >
    > -2147319784
    > Old format or invalid type library
    > Excel_Open.vi
    >
    > This is the first report generation vi that is called. I use it to open a
    > temp
    late.
    >
    > Any help is appreciated.
    >
    > Wiebe.
    >
    >

  • Excel report generation

    Hello,
    I am looking for a simple solution to this simple problem:
    I have generated an excel data file using LabVIEW Report Generation Toolkit for Microsoft Office ( see diagram below ).
    Now I would like to add data to this worksheet every time I run this VI ( data must expand in column format instead of
    row)  but i have no Idea how to do it .
    I would appreciate any help.
    Thanks 
    Attachments:
    Excel Report.jpg ‏59 KB

    That's what the start input is for. You tell it where to insert the cells.
    Asides:
    Why aren't you wiring the error out from the new report function to the next function?
    Do not autoindex an array and wire a value to N. Do one or the other, not both. If you do both the loop will run for whichever value (N, or the array size) is smaller.
    Your loop with the function node can be simplified by replacing it with a single Divide function and feeding the Divide function the arrays directly. The numeric functions (as well as many other functions) are polymorphic.
    To learn more about LabVIEW it is recommended that you go through the introduction material, tutorial(s), and other material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. You can also take the online courses for free.

Maybe you are looking for

  • HT1369 IPod Nano 6th generation sync not working

    I've run all the diagnostics, troubleshooting, reset the device.  Device shows as being connected to computer and network.  But, fails sync test.  Help!!...Thanx...Michael

  • Want to become SJCP, suggestions/directions plz

    Hello, this is srinivas gourishetty from india, iam doing my final year B.tech in IT, i want to get SJCP certification, but i dont know any information about it. can anyone suggest me, how can i start reading for it, i mean, list of books i should re

  • Changing color management options for printing not possible

    I got a problem with Leopard and a Canon i9950 printer. When I choose "Color Matching" from the "print options" pop-up menu, I cannot select "Color Sync" or "In Printer". "Color Sync" is selected, but both options are greyed out and not changeable. S

  • Regarding custom context created for CR_B2B application(Complaints&Returns)

    Hi, We have created a custom context for cr_b2b application. We are able to login to the application, but we are getting some compilation errors on the left hand side page (genericsearch.jsp) The errors are: ISA Framework: com.sap.engine.services.ser

  • FDM logon issue

    I have congured the fdm 11.1.1.3 after installation for the first time. My FDM and HSS are in two different machines. When I am loggin in to workbench it's asking for username, pwd, domain. But I have a problem there. I am getting the following error