Download classical report to MS word with OLE

hi experts,
   I have a Classical HR Report that contains profile information of the employee.Now I have to Download the Report to Ms word through OLE . I tried some threads but they were just displaying the static text.I have to download the data for the following format.could some one help me on this?
WRITE : 'Salary Information '.
SKIP 1.
WRITE : 1 SY-ULINE(83).
WRITE : /1'|',2 'Period Ending On 31ST',25'|',26'Rating(If Any)',42'|',43'Basic Salary',57'|',58'Gpm',70'|',71'CTC',83'|'.
WRITE : /1 SY-ULINE(83).
CLEAR YEARSAL.CLEAR CURRENT.
CLEAR GROSS.CLEAR GROSS1.CLEAR CTC1.
LOOP AT ISAL INTO WSAL WHERE PERNR = WP01-PERNR AND ENDDA = '99991231' ."AND CURRENT BETWEEN WSAL-BEGDA AND WSAL-ENDDA.
  GROSS = WSAL-BET01 + WSAL-BET02 + WSAL-BET03 + WSAL-BET04.
  GROSS1 = GROSS.CONDENSE GROSS1.
  CTC1 = WSAL-BET10.CONDENSE CTC1.
WRITE : /1'|',2 'Current' ,25'|',26 WSAL-RTEXT,42'|',43 WSAL-BET01 ,57'|',58 GROSS1,70'|',71 CTC1,83'|'.
WRITE : /1 SY-ULINE(83).
ENDLOOP.
"need to download such information as above to ms word
"ole format
CREATE OBJECT gs_word 'WORD.APPLICATION' .
IF sy-subrc NE 0 .
MESSAGE s000(su) WITH 'Error while creating OLE object!'.
LEAVE PROGRAM .
ENDIF .
*--Setting object's visibility property
SET PROPERTY OF gs_word 'Visible' = '1' .
*--Opening a new document
GET PROPERTY OF gs_word 'Documents' = gs_documents .
CALL METHOD OF GS_DOCUMENTS 'ADD' = V_DOCUMENTS.
  CALL METHOD OF gs_selection 'TypeText'
EXPORTING
#1 = 'Overview Of The Employee'.
"the output format would be like this .
pernr    |   year   |    salary | .......
Edited by: SYED_ibbu on Feb 23, 2011 11:07 AM
Edited by: SYED_ibbu on Feb 24, 2011 5:57 AM

hi experts,
i Have to display multiple tables in the word document . i am displaying the first table but when i try to display the second table it is getting displayed inside the first table. When i debugged , i found that that the cursor is still in the first row of the first table even after the first table is displayed and the second table is displayed from that cursor position. How to get the cursor position after the end of the table ie outside the table to the main document.could some one help me on this. Below is the code i have used.
GET PROPERTY OF GS_WORD 'ActiveDocument' = gs_actdoc.
GET PROPERTY OF gs_actdoc 'Tables' = gs_tables .
GET PROPERTY OF gs_selection 'Range' = gs_range .
CALL METHOD OF gs_tables 'Add' = gs_table
EXPORTING
#1 = gs_range
#2 = LINES
#3 = '7'.
GET PROPERTY OF gs_table 'Borders' = gs_table_border .
SET PROPERTY OF gs_table_border 'Enable' = '1' .
GET PROPERTY OF gs_cell 'Range' = gs_range .
SET PROPERTY OF gs_range 'Text' = value .
CALL METHOD OF gs_table 'Cell' = gs_cell
EXPORTING
#1 = P_TABIX1
#2 = CNT.
GET PROPERTY OF GS_WORD 'ActiveDocument' = gs_actdoc1.
GET PROPERTY OF gs_actdoc1 'Tables' = gs_tables1 .
GET PROPERTY OF gs_selection 'Range' = gs_range1 .
CALL METHOD OF gs_tables1 'Add' = gs_table1
EXPORTING
#1 = gs_range1
#2 = '2'
#3 = '4'.
with thanks in advance,
syed
Edited by: SYED_ibbu on Feb 25, 2011 5:39 AM

Similar Messages

  • I want to download a report into Excel sheet with color Heading..Is it Poss

    Hi All
    I want to download error records into Excel sheet with color Heading..Is it Possible to download into excel with Color Heading?
    here i am <b>using the 3 sheets in one</b>
    t_error-bkpf -> Sheet1
    t_error-bseg-> sheet 2
    t-error-bsec -> sheet3.
    Rgds
    Raghav

    <b>The following thread has the code which will put data into multiple sheets</b>
    Download to multiple sheets in Excel
    FOR COLOR LOGIC  JUST REFER THIS PROGRAM
    *& Report  ZNEGI17                                                     *
    REPORT  ZNEGI17  NO STANDARD PAGE HEADING.
    * this report demonstrates how to send some ABAP data to an
    * EXCEL sheet using OLE automation.
    INCLUDE OLE2INCL.
    * handles for OLE objects
    DATA: H_EXCEL TYPE OLE2_OBJECT, " Excel object
    H_MAPL TYPE OLE2_OBJECT, " list of workbooks
    H_MAP TYPE OLE2_OBJECT, " workbook
    H_ZL TYPE OLE2_OBJECT, " cell
    H_F TYPE OLE2_OBJECT. " font
    TABLES: SPFLI.
    DATA H TYPE I.
    * table of flights
    DATA: IT_SPFLI LIKE SPFLI OCCURS 10 WITH HEADER LINE.
    *& Event START-OF-SELECTION
    START-OF-SELECTION.
    * read flights
    SELECT * FROM SPFLI INTO TABLE IT_SPFLI UP TO 10 ROWS.
    * display header
    ULINE (61).
    WRITE: / SY-VLINE NO-GAP,
    (3) 'Flg'(001) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
    (4) 'Nr'(002) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
    (20) 'Von'(003) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
    (20) 'Nach'(004) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
    (8) 'Zeit'(005) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP.
    ULINE /(61).
    * display flights
    LOOP AT IT_SPFLI.
    WRITE: / SY-VLINE NO-GAP,
    IT_SPFLI-CARRID COLOR COL_KEY NO-GAP, SY-VLINE NO-GAP,
    IT_SPFLI-CONNID COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
    IT_SPFLI-CITYFROM COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
    IT_SPFLI-CITYTO COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
    IT_SPFLI-DEPTIME COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP.
    ENDLOOP.
    ULINE /(61).
    * tell user what is going on
    CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
    EXPORTING
    * PERCENTAGE = 0
    TEXT = TEXT-007
    EXCEPTIONS
    OTHERS = 1.
    * start Excel
    CREATE OBJECT H_EXCEL 'EXCEL.APPLICATION'.
    * PERFORM ERR_HDL.
    SET PROPERTY OF H_EXCEL 'Visible' = 1.
    * CALL METHOD OF H_EXCEL 'FILESAVEAS' EXPORTING #1 = 'c:kis_excel.xls'
    * PERFORM ERR_HDL.
    * tell user what is going on
    CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
    EXPORTING
    * PERCENTAGE = 0
    TEXT = TEXT-008
    EXCEPTIONS
    OTHERS = 1.
    * get list of workbooks, initially empty
    CALL METHOD OF H_EXCEL 'Workbooks' = H_MAPL.
    PERFORM ERR_HDL.
    * add a new workbook
    CALL METHOD OF H_MAPL 'Add' = H_MAP.
    PERFORM ERR_HDL.
    * tell user what is going on
    * CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
    * EXPORTING
    ** PERCENTAGE = 0
    * TEXT = TEXT-009
    * EXCEPTIONS
    * OTHERS = 1.
    * output column headings to active Excel sheet
    PERFORM FILL_CELL1 USING 1 1 1 'Flug'(001).
    PERFORM FILL_CELL1 USING 1 2 0 'Nr'(002).
    PERFORM FILL_CELL1 USING 1 3 1 'Von'(003).
    PERFORM FILL_CELL1 USING 1 4 1 'Nach'(004).
    PERFORM FILL_CELL1 USING 1 5 1 'Zeit'(005).
    LOOP AT IT_SPFLI.
    * copy flights to active EXCEL sheet
    H = SY-TABIX + 1.
    PERFORM FILL_CELL USING H 1 0 IT_SPFLI-CARRID.
    PERFORM FILL_CELL USING H 2 0 IT_SPFLI-CONNID.
    PERFORM FILL_CELL USING H 3 0 IT_SPFLI-CITYFROM.
    PERFORM FILL_CELL USING H 4 0 IT_SPFLI-CITYTO.
    PERFORM FILL_CELL USING H 5 0 IT_SPFLI-DEPTIME.
    ENDLOOP.
    * changes by Kishore - start
    * CALL METHOD OF H_EXCEL 'Workbooks' = H_MAPL.
    CALL METHOD OF H_EXCEL 'Worksheets' = H_MAPL." EXPORTING #1 = 2.
    PERFORM ERR_HDL.
    * add a new workbook
    CALL METHOD OF H_MAPL 'Add' = H_MAP EXPORTING #1 = 2.
    PERFORM ERR_HDL.
    * tell user what is going on
    SET PROPERTY OF H_MAP 'NAME' = 'COPY'.
    * CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
    * EXPORTING
    ** PERCENTAGE = 0
    * TEXT = TEXT-009
    * EXCEPTIONS
    * OTHERS = 1.
    * output column headings to active Excel sheet
    PERFORM FILL_CELL1 USING 1 1 1 'Flug'(001).
    PERFORM FILL_CELL1 USING 1 2 0 'Nr'(002).
    PERFORM FILL_CELL1 USING 1 3 1 'Von'(003).
    PERFORM FILL_CELL1 USING 1 4 1 'Nach'(004).
    PERFORM FILL_CELL1 USING 1 5 1 'Zeit'(005).
    LOOP AT IT_SPFLI.
    * copy flights to active EXCEL sheet
    H = SY-TABIX + 1.
    PERFORM FILL_CELL USING H 1 0 IT_SPFLI-CARRID.
    PERFORM FILL_CELL USING H 2 0 IT_SPFLI-CONNID.
    PERFORM FILL_CELL USING H 3 0 IT_SPFLI-CITYFROM.
    PERFORM FILL_CELL USING H 4 0 IT_SPFLI-CITYTO.
    PERFORM FILL_CELL USING H 5 0 IT_SPFLI-DEPTIME.
    ENDLOOP.
    * changes by Kishore - end
    * disconnect from Excel
    * CALL METHOD OF H_EXCEL 'FILESAVEAS' EXPORTING #1 = 'C:SKV.XLS'.
    FREE OBJECT H_EXCEL.
    PERFORM ERR_HDL.
    * FORM FILL_CELL *
    * sets cell at coordinates i,j to value val boldtype bold *
    FORM FILL_CELL1 USING I J BOLD VAL.
    data : color(5) type x value 'H80000008'.
    CALL METHOD OF H_EXCEL 'Cells' = H_ZL EXPORTING #1 = I #2 = J.
    PERFORM ERR_HDL.
    SET PROPERTY OF H_ZL 'Value' = VAL .
    PERFORM ERR_HDL.
    GET PROPERTY OF H_ZL 'Font' = H_F.
    PERFORM ERR_HDL.
    SET PROPERTY OF H_F 'Bold' = BOLD .
    PERFORM ERR_HDL.
    SET PROPERTY OF H_F 'ColorIndex' = 3 .
    PERFORM ERR_HDL.
    ENDFORM.
    *& Form ERR_HDL
    * outputs OLE error if any *
    * --> p1 text
    * <-- p2 text
    FORM ERR_HDL.
    IF SY-SUBRC <> 0.
    WRITE: / 'Fehler bei OLE-Automation:'(010), SY-SUBRC.
    STOP.
    ENDIF.
    ENDFORM. " ERR_HDL
    *&      Form  FILL_CELL1
    *       text
    *      -->P_H  text
    *      -->P_1      text
    *      -->P_0      text
    *      -->P_IT_SPFLI_CARRID  text
    form FILL_CELL  using   I J BOLD VAL.
    CALL METHOD OF H_EXCEL 'Cells' = H_ZL EXPORTING #1 = I #2 = J.
    PERFORM ERR_HDL.
    SET PROPERTY OF H_ZL 'Value' = VAL .
    PERFORM ERR_HDL.
    GET PROPERTY OF H_ZL 'Font' = H_F.
    PERFORM ERR_HDL.
    endform.                    " FILL_CELL1
    kishan negi

  • Formatting problem when downloading classical report output to excel sheet.

    Dear Experts,
    My classical report o/p looks like:
    SI    Name   ID
    1      xyz     11
    2      abc     22
    3      eet      33
    4      jnc      44
    When I download the same to a excel sheet from List->Save->file->Spreadsheet and save it.
    The formatting looks like this:
    SI   Name   ID
    1     xyz               11
    2     abc               22
    3     eet                33
    4     inc                44
    That is the heading and column entries are in different columns.
    There is no GUI_Download used.
    Kindly help what may be the issue.

    Hi,
    In the report output the formatting looks fine. It is exactly below the heading. But only when I save it to excel, this alignment issue is coming. Even the columns after this column are are properly aligned and there is no issue at all. Only this column in the middle has issue.

  • Download SAP Report in Spreadsheet Format with automatic Save As selection

    Hi All,
    I'm using an Excel sheet that links up to SAP to grab some data off of QE03. Due to the nature of my data, I have to save the data into Excel/Spreadsheet format (aka this button )
    BUT, when you click that button it stops the script for a "Save As" screen, since it isn't a part of SAP. Since I have a macro immediately after the save that cuts the data, I need this to be fully automated and uninterrupted.
    Here is the script I have in excel:
    Dim SapGuiAuto
    Dim Apps
    Dim Connection
    Dim session
    Dim WScript
    Sub Master()
            With Sheets("Graphs")
            Call SAP
            Call QE03
            End With
    End Sub
    Sub SAP()
    If Not IsObject(Apps) Then
       Set SapGuiAuto = GetObject("SAPGUI")
       Set Apps = SapGuiAuto.GetScriptingEngine
    End If
    If Not IsObject(Connection) Then
       Set Connection = Apps.Children(0)
    End If
    If Not IsObject(session) Then
       Set session = Connection.Children(0)
    End If
    If IsObject(WScript) Then
       WScript.ConnectObject session, "on"
       WScript.ConnectObject Application, "on"
    End If
    End Sub
    Sub QE03()
    session.findById("wnd[0]").maximize
    session.findById("wnd[0]/tbar[0]/okcd").Text = "/nqe03"
    session.findById("wnd[0]").sendVKey 0
    session.findById("wnd[0]").sendVKey 4
    session.findById("wnd[1]/usr/tabsG_SELONETABSTRIP/tabpTAB005/ssubSUBSCR_PRESEL:SAPLSDH4:0220/sub:SAPLSDH4:0220/ctxtG_SELFLD_TAB-LOW[1,24]").Text = "123456"
    session.findById("wnd[1]/usr/tabsG_SELONETABSTRIP/tabpTAB005/ssubSUBSCR_PRESEL:SAPLSDH4:0220/sub:SAPLSDH4:0220/ctxtG_SELFLD_TAB-LOW[1,24]").SetFocus
    session.findById("wnd[1]/usr/tabsG_SELONETABSTRIP/tabpTAB005/ssubSUBSCR_PRESEL:SAPLSDH4:0220/sub:SAPLSDH4:0220/ctxtG_SELFLD_TAB-LOW[1,24]").caretPosition = 8
    session.findById("wnd[1]").sendVKey 0
    session.findById("wnd[1]/usr/lbl[1,1]").SetFocus
    session.findById("wnd[1]/usr/lbl[1,1]").caretPosition = 8
    session.findById("wnd[1]").sendVKey 2
    session.findById("wnd[1]/usr/lbl[1,3]").SetFocus
    session.findById("wnd[1]/usr/lbl[1,3]").caretPosition = 7
    session.findById("wnd[1]").sendVKey 2
    session.findById("wnd[0]/usr/ctxtQAQEE-VORNR").Text = "1234"
    session.findById("wnd[0]/usr/ctxtQAQEE-VORNR").SetFocus
    session.findById("wnd[0]/usr/ctxtQAQEE-VORNR").caretPosition = 4
    session.findById("wnd[0]").sendVKey 0
    session.findById("wnd[0]/mbar/menu[1]/menu[0]/menu[0]").Select
    session.findById("wnd[0]/tbar[1]/btn[40]").press
    session.findById("wnd[1]/tbar[0]/btn[8]").press
    session.findById("wnd[1]/tbar[0]/btn[37]").press
    End Sub
    I get stuck right at the last line, "session.findById("wnd[1]/tbar[0]/btn[37]").press" which opens the Save As dialog box. I've seen some similar topics around here, but I am honestly not too savvy at scripting and this is an Excel specific model, so does anyone have any advice?

    Hi,
    Why are you trying to use  that button?
    It's much easier to use simple its called "Local file" u can grab it by shortcut CTRL+SHIFT+f9...
    Another option is to use SAP functions:: put "%PC" to command field then enter, and you will get the window with option to save data in excel.
    Please find below some examples to download data to excel:
    'For STANDARD T-CODES like MB52
    'export to excel button
    Session.FindById("wnd[0]/tbar[1]/btn[45]").Press
    Session.FindById("wnd[1]/usr/subSUBSCREEN_STEPLOOP:SAPLSPO5:0150/sub:SAPLSPO5:0150/radSPOPLI-SELFLAG[1,0]").Select
    Session.FindById("wnd[1]/tbar[0]/btn[0]").Press
    Uname = CreateObject("WScript.Network").UserName
    Session.FindById("wnd[1]/usr/ctxtDY_PATH").Text = "C:\Users\" & uname & "\Desktop\"
    Session.FindById("wnd[1]/usr/ctxtDY_FILENAME").Text = "TEMP.xls"
    'rewrite
    Session.FindById("wnd[1]/tbar[0]/btn[11]").Press
    OPTION WITH "%PC"
    'save to TEMP
    session.findById("wnd[0]/tbar[0]/okcd").Text = "%pc"
    session.findById("wnd[0]").sendVKey 0
    session.findById("wnd[1]/usr/subSUBSCREEN_STEPLOOP:SAPLSPO5:0150/sub:SAPLSPO5:0150/radSPOPLI-SELFLAG[1,0]").Select
    session.findById("wnd[1]/tbar[0]/btn[0]").press
    session.findById("wnd[1]/usr/ctxtDY_PATH").Text = "C:\Users\" & Uname & "\Desktop\"
    session.findById("wnd[1]/usr/ctxtDY_FILENAME").Text = "TEMP.xls"
    session.findById("wnd[1]/tbar[0]/btn[11]").press
    Best,

  • 2 Classic Reports with edit fields on the same page

    Hi All, need your help.
    I am trying to have 2 classic reports on one page with edit fields like date, list values, text
    I have noticed that the element indexes are the same f01_0001 have both first elements from both reports.
    This is making my code go crazy.
    Also i have a problem with Date Picker, if i select it as a column type for a first element in second report the icon shows up in the first report.
    I think this is because of indexing, but... Classic Date Picker put the icon on second report but when i select the date, the values is populated to first column in first report
    Does anyone have a solution for this problem! (for example change the indexing for second report)
    DB is 11.2g
    Apex is 4.2.0.00.27
    Thank you,
    Andrei
    Edited by: aracila on Feb 20, 2013 9:03 AM

    Are these tabular forms, ie updteable.
    If so, you can only have one per page
    Gus

  • Classical Report on clicking button on ALV Report

    I have a requirement where I have to display a classical report based on the user-click on a "custom button" on my ALV. I am unable to display the classical report. Please help with code example..

    Hi,
    See the example.Change the code according to your requirement.
    *& Report  ZDEMO_ALVGRID                                               *
    *& Example of a simple ALV Grid Report                                 *
    *& The basic requirement for this demo is to display a number of       *
    *& fields from the EKKO table.                                         *
    REPORT  zdemo_alvgrid                 .
    TABLES:     ekko.
    type-pools: slis.                                 "ALV Declarations
    *Data Declaration
    TYPES: BEGIN OF t_ekko,
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
      statu TYPE ekpo-statu,
      aedat TYPE ekpo-aedat,
      matnr TYPE ekpo-matnr,
      menge TYPE ekpo-menge,
      meins TYPE ekpo-meins,
      netpr TYPE ekpo-netpr,
      peinh TYPE ekpo-peinh,
    END OF t_ekko.
    DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          wa_ekko TYPE t_ekko.
    *ALV data declarations
    data: fieldcatalog type slis_t_fieldcat_alv with header line,
          gd_tab_group type slis_t_sp_group_alv,
          gd_layout    type slis_layout_alv,
          gd_repid     like sy-repid,
          gt_events     type slis_t_event,
          gd_prntparams type slis_print_alv.
    *Start-of-selection.
    START-OF-SELECTION.
    perform data_retrieval.
    perform build_fieldcatalog.
    perform build_layout.
    perform build_events.
    perform build_print_params.
    perform display_alv_report.
    *&      Form  BUILD_FIELDCATALOG
          Build Fieldcatalog for ALV Report
    form build_fieldcatalog.
    There are a number of ways to create a fieldcat.
    For the purpose of this example i will build the fieldcatalog manualy
    by populating the internal table fields individually and then
    appending the rows. This method can be the most time consuming but can
    also allow you  more control of the final product.
    Beware though, you need to ensure that all fields required are
    populated. When using some of functionality available via ALV, such as
    total. You may need to provide more information than if you were
    simply displaying the result
                  I.e. Field type may be required in-order for
                       the 'TOTAL' function to work.
      fieldcatalog-fieldname   = 'EBELN'.
      fieldcatalog-seltext_m   = 'Purchase Order'.
      fieldcatalog-col_pos     = 0.
      fieldcatalog-outputlen   = 10.
      fieldcatalog-emphasize   = 'X'.
      fieldcatalog-key         = 'X'.
    fieldcatalog-do_sum      = 'X'.
    fieldcatalog-no_zero     = 'X'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'EBELP'.
      fieldcatalog-seltext_m   = 'PO Item'.
      fieldcatalog-col_pos     = 1.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'STATU'.
      fieldcatalog-seltext_m   = 'Status'.
      fieldcatalog-col_pos     = 2.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'AEDAT'.
      fieldcatalog-seltext_m   = 'Item change date'.
      fieldcatalog-col_pos     = 3.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MATNR'.
      fieldcatalog-seltext_m   = 'Material Number'.
      fieldcatalog-col_pos     = 4.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MENGE'.
      fieldcatalog-seltext_m   = 'PO quantity'.
      fieldcatalog-col_pos     = 5.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'MEINS'.
      fieldcatalog-seltext_m   = 'Order Unit'.
      fieldcatalog-col_pos     = 6.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'NETPR'.
      fieldcatalog-seltext_m   = 'Net Price'.
      fieldcatalog-col_pos     = 7.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-do_sum      = 'X'.
      fieldcatalog-datatype     = 'CURR'.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
      fieldcatalog-fieldname   = 'PEINH'.
      fieldcatalog-seltext_m   = 'Price Unit'.
      fieldcatalog-col_pos     = 8.
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
    endform.                    " BUILD_FIELDCATALOG
    *&      Form  BUILD_LAYOUT
          Build layout for ALV grid report
    form build_layout.
      gd_layout-no_input          = 'X'.
      gd_layout-colwidth_optimize = 'X'.
      gd_layout-totals_text       = 'Totals'(201).
    gd_layout-totals_only        = 'X'.
    gd_layout-f2code            = 'DISP'.  "Sets fcode for when double
                                            "click(press f2)
    gd_layout-zebra             = 'X'.
    gd_layout-group_change_edit = 'X'.
    gd_layout-header_text       = 'helllllo'.
    endform.                    " BUILD_LAYOUT
    *&      Form  DISPLAY_ALV_REPORT
          Display report using ALV grid
    form display_alv_report.
      gd_repid = sy-repid.
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = gd_repid
                i_callback_top_of_page   = 'TOP-OF-PAGE'  "see FORM
                i_callback_user_command = 'USER_COMMAND'
               i_grid_title           = outtext
                is_layout               = gd_layout
                it_fieldcat             = fieldcatalog[]
               it_special_groups       = gd_tabgroup
                it_events               = gt_events
                is_print                = gd_prntparams
                i_save                  = 'X'
               is_variant              = z_template
           tables
                t_outtab                = it_ekko
           exceptions
                program_error           = 1
                others                  = 2.
      if sy-subrc  0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    endform.                    " DISPLAY_ALV_REPORT
    *&      Form  DATA_RETRIEVAL
          Retrieve data form EKPO table and populate itab it_ekko
    form data_retrieval.
    select ebeln ebelp statu aedat matnr menge meins netpr peinh
    up to 10 rows
      from ekpo
      into table it_ekko.
    endform.                    " DATA_RETRIEVAL
    Form  TOP-OF-PAGE                                                 *
    ALV Report Header                                                 *
    Form top-of-page.
    *ALV Header declarations
    data: t_header type slis_t_listheader,
          wa_header type slis_listheader,
          t_line like wa_header-info,
          ld_lines type i,
          ld_linesc(10) type c.
    Title
      wa_header-typ  = 'H'.
      wa_header-info = 'EKKO Table Report'.
      append wa_header to t_header.
      clear wa_header.
    Date
      wa_header-typ  = 'S'.
      wa_header-key = 'Date: '.
      CONCATENATE  sy-datum+6(2) '.'
                   sy-datum+4(2) '.'
                   sy-datum(4) INTO wa_header-info.   "todays date
      append wa_header to t_header.
      clear: wa_header.
    Total No. of Records Selected
      describe table it_ekko lines ld_lines.
      ld_linesc = ld_lines.
      concatenate 'Total No. of Records Selected: ' ld_linesc
                        into t_line separated by space.
      wa_header-typ  = 'A'.
      wa_header-info = t_line.
      append wa_header to t_header.
      clear: wa_header, t_line.
      call function 'REUSE_ALV_COMMENTARY_WRITE'
           exporting
                it_list_commentary = t_header.
               i_logo             = 'Z_LOGO'.
    endform.
          FORM USER_COMMAND                                          *
          --> R_UCOMM                                                *
          --> RS_SELFIELD                                            *
    FORM user_command USING r_ucomm LIKE sy-ucomm
                      rs_selfield TYPE slis_selfield.
    Check function code
      CASE r_ucomm.
        WHEN '&IC1'.
      Check field clicked on within ALVgrid report
        IF rs_selfield-fieldname = 'EBELN'.
        Read data table, using index of row user clicked on
          READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
        Set parameter ID for transaction screen field
          SET PARAMETER ID 'BES' FIELD wa_ekko-ebeln.
        Sxecute transaction ME23N, and skip initial data entry screen
          CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
        ENDIF.
      ENDCASE.
    ENDFORM.
    *&      Form  BUILD_EVENTS
          Build events table
    form build_events.
      data: ls_event type slis_alv_event.
      call function 'REUSE_ALV_EVENTS_GET'
           exporting
                i_list_type = 0
           importing
                et_events   = gt_events[].
      read table gt_events with key name =  slis_ev_end_of_page
                               into ls_event.
      if sy-subrc = 0.
        move 'END_OF_PAGE' to ls_event-form.
        append ls_event to gt_events.
      endif.
        read table gt_events with key name =  slis_ev_end_of_list
                               into ls_event.
      if sy-subrc = 0.
        move 'END_OF_LIST' to ls_event-form.
        append ls_event to gt_events.
      endif.
    endform.                    " BUILD_EVENTS
    *&      Form  BUILD_PRINT_PARAMS
          Setup print parameters
    form build_print_params.
      gd_prntparams-reserve_lines = '3'.   "Lines reserved for footer
      gd_prntparams-no_coverpage = 'X'.
    endform.                    " BUILD_PRINT_PARAMS
    *&      Form  END_OF_PAGE
    form END_OF_PAGE.
      data: listwidth type i,
            ld_pagepos(10) type c,
            ld_page(10)    type c.
      write: sy-uline(50).
      skip.
      write:/40 'Page:', sy-pagno .
    endform.
    *&      Form  END_OF_LIST
    form END_OF_LIST.
      data: listwidth type i,
            ld_pagepos(10) type c,
            ld_page(10)    type c.
      skip.
      write:/40 'Page:', sy-pagno .
    endform.
    Pls. reward if useful...

  • POP LOV in classic Report not in a interactive Report

    My oracle version Oracle Express Aplication 11g
    Dear Forum
    We need a CLASSIC report where i can define what information my report will show.
    For example:
    My Report contain
    ID NAME DATE
    In Drag and Drop layout I create two data pickers cause I need to choose information between Date_picker_1 and Datepicker_2. both of them correspond to DATE
    In my region source in classic report I write something like this:
    Select id, name where DATE between :Date_picker_1 and :Datepicker_2 then Ichoose the months but nothing happen.
    I know that in the report interactive you can do that, but my boss doesnt' like interactive report (I dont know why) so my problem is in the Classic report.
    Danny Lima
    Ecuador
    PD: I'm not speak english very well

    >
    Please update your forum profile with a real handle instead of "897381".
    Also the subject of this thread&mdash;POP LOV in classic Report not in a interactive Report&mdash;doesn't appear to be relevant the question asked. There's no mention of a Pop-up LOV here?
    My oracle version Oracle Express Aplication 11gAlways state full version numbers, and include
    <li>Full APEX version
    <li>Full DB/version/edition/host OS
    <li>Web server architecture (EPG, OHS or APEX listener/host OS)
    <li>Browser(s) and version(s) used
    as well.
    We need a CLASSIC report where i can define what information my report will show.
    For example:
    My Report contain
    ID NAME DATE
    In Drag and Drop layout I create two data pickers cause I need to choose information between Date_picker_1 and Datepicker_2. both of them correspond to DATE
    In my region source in classic report I write something like this:
    Select id, name where DATE between :Date_picker_1 and :Datepicker_2then Ichoose the months but nothing happen.Always post code wrapped in <tt>\...\</tt> tags. And always post the actual code or a realistic reduced test case: that query is not valid SQL.
    I know that in the report interactive you can do that, but my boss doesnt' like interactive report (I dont know why) so my problem is in the Classic report.Nothing to do with the report type. It's because all APEX items are actually VARCHAR2s. For proper comparison semantics with NUMBERs or DATEs in SQL explicit conversion is required:
    select id, name
    from foo
    where bar between to_date(:date_picker_1, 'DD/MM/YYYY') and to_date(:date_picker_1, 'DD/MM/YYYY')Where 'DD/MM/YYYY' is the format mask used in the datepicker items.

  • Regarding allignment in classical report, need it urgently

    Iam strucking in dispalying the data in classical report.
    Iam working with hr module. My output should be in such a way that all the countries which iam taking in one internal table shuld be displayed in row.
    with regarding these countries I was fetching groups(designations) i.e like manager, submanager.And iam taking a count if Designation repeats for that particular country.iam getting the output, but in dispalying the problem is.
      i wil show  how the output shuld be
                                           india    MAlaysia  japan
    manager                                            1           
    deputymanager                                  2            1
    hr                                       1              2
    but my output is coming like this
                                   india    MAlaysia  japan
    manager                  1          
    deputymanager        2            1
    hr                           1              2
    count is displaying under first country.
    can anyone tell me how to move forward.

    Hi,
    Use the code as follows:
    *************LIST OUTPUT*****************
        FORMAT COLOR 1.
        WRITE:SY-VLINE, TEXT-003 ,
              19 SY-VLINE,21 TEXT-004,
              27 SY-VLINE,29 TEXT-001,
              39 SY-VLINE,41 TEXT-002,
              52 SY-VLINE,54 TEXT-005,
              61 SY-VLINE,63 TEXT-006,
              77 SY-VLINE,79 TEXT-007,
              91 SY-VLINE,93 TEXT-008,
              105 SY-VLINE,107 TEXT-009,
              123 SY-VLINE.
        ULINE AT (123).
        LOOP AT ITAB ."WHERE MBLNR = IMBLNR OR BUDAT1 IN S_BUDAT.
           uline at (137).
          FORMAT COLOR OFF.
          WRITE:/ SY-VLINE,ITAB-MBLNR UNDER TEXT-003,
                19 SY-VLINE,ITAB-MJAHR UNDER TEXT-004,
                27 SY-VLINE,ITAB-BUDAT1 UNDER TEXT-001,
                39 SY-VLINE,ITAB-ETIME UNDER TEXT-002,
                52 SY-VLINE,ITAB-WERKS UNDER TEXT-005,
                61 SY-VLINE,ITAB-LGORT UNDER TEXT-006,
                77 SY-VLINE,ITAB-BUDAT UNDER TEXT-007,
                91 SY-VLINE,ITAB-OIB_BLTIME UNDER TEXT-008,
                105 SY-VLINE,ITAB-VARIANCE UNDER TEXT-009,
                 123 SY-VLINE.
          ULINE AT (123).
        ENDLOOP.
    I used it in my report.Make changes in fields according to your requirement.
    hope it helps.
    Reward if helpful.
    Regards,
    Sipra

  • Problem with download link for a BLOB Column in a "Classic report"

    I am having a problem where I cannot make a download link for a blob column function in a "classic" (non-interactive) report. I went through the tutorial on this topic and it was great help it working out the minor bugs, but I get a 404 error (apex_util.get_BLOB not found). For testing purposes I went ahead and created a an identical report on the same page that is an "Interactive report" and it works like a charm. Same query, same BLOB formatting Mask, pulling data from the same table. So, it really doesn't seem like an issue with the grants, since both reports should be executing as the same user.
    I know it sounds like the obvious answer is to just go with the interactive report and my problem is solved, but the rest of this site uses classic reports, and I don't need the sort features of an interactive report, and the slightly different style of the the report really stands out even if I turn off all the bells and whistles. I don't want to change the css to make them look identical, I just want a regular report to work.

    I eventually found another post: APEX_UTIL.GET_BLOB was not found on this server
    In this post there is the suggestion of putting "dbms_lob.getlength("var")" after the date field in your select. So I changed my query to have it at the end, and now my format mask (DOWNLOAD:table_name:ATTACHED_FILE:FILE_ID::FILE_MIME_TYPE:FILE_NAME:::attachment:Download) works like a charm, in a classic report.

  • Hidden Classic Report - With Download Links

    Hi All,
    I have a requirement.
    I am displaying certain user information through a form i.e with all the fields in the form as READ ONLY / DISLAY ONLY.
    I need a XLS/PDF download button allowing users to click and download the particular details on the page.
    I tried creating a CLASSIC REPORT.
    Made the template as "NO TEMPLATE"
    Gave "&nbsp" values to the headers
    and hide the columns.
    Although it is understood that if i hide/do not show the fields in the report, then the XLS report will be blank.
    Is there any other way of doing it ?
    Thank you,
    Srikumar S

    Hi,
    I tried the way you did it there.
    I am getting the following type of report:
    PAGE_ID     REGION_NAME     REGION_CSV_EXPORT_LINK
    16     Session Participants     f?p=103:16:11124720394425:FLOW_EXCEL_OUTPUT_R66413769667879139003_en
    16     Session Trainers     f?p=103:16:11124720394425:FLOW_EXCEL_OUTPUT_R66413836384202172172_en
    80     sfdsf     f?p=103:80:11124720394425:FLOW_EXCEL_OUTPUT_R3094310823067880_en
    The REGION_CSV_EXPORT_LINK is not enabled:
    I tried making it as a "Standard Report Column", but that didnt work.
    Can you tell me what am i missing.
    Thank you once again.
    Srikumar S

  • Report with OLE Object Problem (Crystal Report 11)

    Post Author: ibertola
    CA Forum: General
    Hi all,I'm a new user, and I've got a problem with OLE object. I would like to have a report that show me ONLY one of many OLE (word document) in Crystal structure.I've created 3 section detail, and in each one I've insert OLE object (creating from a file, and LINK).So, if I change one document stored locally, and then refresh the report, the content doesn't change like the linked file! Actually I've got all locally  Please help me.

    CR XI r2 is not supported on WIN 2008. See the [supported platforms|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/7081b21c-911e-2b10-678e-fe062159b453]
    documentation  and [this|https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=56787567] wiki.
    Ludek

  • Download a classical Report output to excel

    Hi All,
    We have a requirement to download the output of a classical report into a Excel sheet and it should be in the same format as the report output.We don't  just want to dump the internal table data into excel but need to display the classical report outputas it is in the excel sheet.
    Regards,
    Ashish

    Hi there,
    I am not sure on your requirement, but if you want to write a program that manipulates Excel, you can choose to use OLE objects. Below is some sample code.
    REPORT  ZTEST_EXCEL.
    INCLUDE ole2incl.
    DATA: application TYPE ole2_object,
    workbook TYPE ole2_object,
    sheet TYPE ole2_object,
    cells TYPE ole2_object.
    CONSTANTS: row_max TYPE i VALUE 256.
    DATA index TYPE i.
    DATA: BEGIN OF itab1 OCCURS 0, first_name(10), END OF itab1.
    DATA: BEGIN OF itab2 OCCURS 0, last_name(10), END OF itab2.
    DATA: BEGIN OF itab3 OCCURS 0, formula(50), END OF itab3.
    *START-OF-SELECTION
    START-OF-SELECTION.
    APPEND: 'Peter' TO itab1, 'Ivanov' TO itab2,
    '=Sheet1!A1 & " " & Sheet2!A1' TO itab3,
    'John' TO itab1, 'Smith' TO itab2,
    '=Sheet1!A2 & " " & Sheet2!A2' TO itab3.
    CREATE OBJECT application 'excel.application'.
    SET PROPERTY OF application 'visible' = 1.
    CALL METHOD OF application 'Workbooks' = workbook.
    CALL METHOD OF workbook 'Add'.
    * Create first Excel Sheet
    CALL METHOD OF application 'Worksheets' = sheet
    EXPORTING #1 = 1.
    CALL METHOD OF sheet 'Activate'.
    SET PROPERTY OF sheet 'Name' = 'Sheet1'.
    LOOP AT itab1.
    index = row_max * ( sy-tabix - 1 ) + 1. " 1 - column name
    CALL METHOD OF sheet 'Cells' = cells EXPORTING #1 = index.
    SET PROPERTY OF cells 'Value' = itab1-first_name.
    ENDLOOP.
    * Create second Excel sheet
    CALL METHOD OF application 'Worksheets' = sheet
    EXPORTING #1 = 2.
    SET PROPERTY OF sheet 'Name' = 'Sheet2'.
    CALL METHOD OF sheet 'Activate'.
    LOOP AT itab2.
    index = row_max * ( sy-tabix - 1 ) + 1. " 1 - column name
    CALL METHOD OF sheet 'Cells' = cells EXPORTING #1 = index.
    SET PROPERTY OF cells 'Value' = itab2-last_name.
    ENDLOOP.
    * Create third Excel sheet
    CALL METHOD OF application 'Worksheets' = sheet
    EXPORTING #1 = 3.
    SET PROPERTY OF sheet 'Name' = 'Sheet3'.
    CALL METHOD OF sheet 'Activate'.
    LOOP AT itab3.
    index = row_max * ( sy-tabix - 1 ) + 1. " 1 - column name
    CALL METHOD OF sheet 'Cells' = cells EXPORTING #1 = index.
    SET PROPERTY OF cells 'Formula' = itab3-formula.
    SET PROPERTY OF cells 'Value' = itab3-formula.
    ENDLOOP.
    * Save excel speadsheet to particular filename
    CALL METHOD OF sheet 'SaveAs'
    EXPORTING #1 = 'c:\temp\exceldoc1.xls' "filename
    #2 = 1. "fileFormat
    * Closes excel window, data is lost if not saved
    * SET PROPERTY OF application 'visible' = 0.
    Edited by: Thung Yuen Yap on Aug 10, 2010 1:52 PM

  • OLE-Word with table

    Hi,
    i use OLE-Word to create a table in a word document and fill them.
    That's work OK, but i will position the table on a specific Positon on the page.
    Position shell be horizontal 7 and vertical 8.
    I have tried it with recording in word, bot i don't know the statements in ABAP.
    Has anyone an idea to solve it or an example?
    thanks.
    Regards, Dieter.
    Edited by: Dieter Gröhn on Jun 16, 2008 10:34 AM

    Here my code:
    REPORT ZGRO_MS_WORD_OLE_FORMLETTER_T0.
    *--Include for OLE-enabling definitions
    INCLUDE OLE2INCL .
    *--Global variables
    *--Variables to hold OLE object and entity handles
    DATA GS_WORD        TYPE OLE2_OBJECT . "OLE object handle
    DATA GS_DOCUMENT    TYPE OLE2_OBJECT . "Documents
    DATA GS_ACTIV_DOC   TYPE OLE2_OBJECT . "Active document
    DATA GS_APPLICATION TYPE OLE2_OBJECT . "Application
    DATA GS_OPTIONS     TYPE OLE2_OBJECT . "Application options
    DATA GS_ACTWIN      TYPE OLE2_OBJECT . "Active window
    DATA GS_ACTPAN      TYPE OLE2_OBJECT . "Active pane
    DATA GS_VIEW        TYPE OLE2_OBJECT . "View
    DATA GS_SELECTION   TYPE OLE2_OBJECT . "Selection
    DATA GS_FONT        TYPE OLE2_OBJECT . "Font
    DATA GS_PARFORMAT   TYPE OLE2_OBJECT . "Paragraph format
    DATA GS_TABLES      TYPE OLE2_OBJECT . "Tables
    DATA GS_RANGE       TYPE OLE2_OBJECT . "Range handle for various ranges
    DATA GS_TABLE       TYPE OLE2_OBJECT . "One table
    DATA GS_BORDER      TYPE OLE2_OBJECT . "Table border
    DATA GS_CELL        TYPE OLE2_OBJECT . "One cell of a table
    DATA GS_PARAGRAPH   TYPE OLE2_OBJECT . "Paragraph
    START-OF-SELECTION .
      PERFORM WORD_APPLIKATION.
      PERFORM TABELLE_ERSTELLEN.
      PERFORM TABELLE_ZELLE.
      FREE OBJECT GS_WORD .
    FORM WORD_APPLIKATION.
    *--Creating OLE object handle variable
      CREATE OBJECT GS_WORD 'WORD.APPLICATION' .
      IF SY-SUBRC NE 0 .
        MESSAGE S000(SU) WITH 'Error while creating OLE object!'.
        LEAVE PROGRAM .
      ENDIF .
    *--Setting object's visibility property
      SET PROPERTY OF GS_WORD 'Visible' = '1' .
    *--Opening a new document
      GET PROPERTY OF GS_WORD 'Documents' = GS_DOCUMENT.
      CALL METHOD OF GS_DOCUMENT 'Add' .
    *--Getting active document handle
      GET PROPERTY OF GS_WORD 'ActiveDocument' = GS_ACTIV_DOC .
    *--Getting applications handle
      GET PROPERTY OF GS_ACTIV_DOC 'Application' = GS_APPLICATION .
    *--Setting the measurement unit
      GET PROPERTY OF GS_APPLICATION 'Options' = GS_OPTIONS .
      SET PROPERTY OF GS_OPTIONS 'MeasurementUnit' = '1' . "CM
    *--Getting handle for the selection which is here the character at the
    *--cursor position
      GET PROPERTY OF GS_APPLICATION 'Selection' = GS_SELECTION .
      GET PROPERTY OF GS_SELECTION 'Font' = GS_FONT .
      GET PROPERTY OF GS_SELECTION 'ParagraphFormat' = GS_PARFORMAT .
    ENDFORM.                    "word_applikation
    FORM TABELLE_ERSTELLEN.
    *--Getting entity handles for the entities on the way
      GET PROPERTY OF GS_ACTIV_DOC 'Tables' = GS_TABLES .
      GET PROPERTY OF GS_SELECTION 'Range' = GS_RANGE .
    *--Adding a table
      CALL METHOD OF GS_TABLES 'Add' = GS_TABLE
           EXPORTING #1 = GS_RANGE
                     #2 = '1' "Number of rows
                     #3 = '1'. "Number of columns
    *--Setting border attribute
      GET PROPERTY OF GS_TABLE 'Borders' = GS_BORDER .
      SET PROPERTY OF GS_BORDER 'Enable' = '0' .                "0 o. 1
    DATA GS_ROWS   TYPE OLE2_OBJECT.
      GET PROPERTY OF GS_TABLE 'Rows' = GS_ROWS.
      SET PROPERTY OF GS_ROWS  'WrapAroundText' = '1'.
      SET PROPERTY OF GS_ROWS  'HorizontalPosition' = '3'.
      SET PROPERTY OF GS_ROWS  'RelativeHorizontalPosition' = '1'.
      SET PROPERTY OF GS_ROWS  'VerticalPosition' = '8'.
      SET PROPERTY OF GS_ROWS  'RelativeVerticalPosition' = '1'.
      set property of GS_ROWS  'AllowOverlap'     = '0'.
    ENDFORM.                    "Tabelle_erstellen
    FORM TABELLE_ZELLE.
    *--Getting cell coordinates
      CALL METHOD OF GS_TABLE 'Cell' = GS_CELL
        EXPORTING #1 = '1'
        #2 = '1'.
    *--Getting the range handle to write the text
      GET PROPERTY OF GS_CELL 'Range' = GS_RANGE .
    *--Filling the cell
      SET PROPERTY OF GS_RANGE 'Text' = 'Test' .
    ENDFORM.                    "TABELLE_Zelle
    in Word i record and get this:
    Sub Makro1()
    ' Makro1 Makro
    ' Makro aufgezeichnet am 16.06.2008
        ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=1, NumColumns:= _
            1, DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:= _
            wdAutoFitFixed
        With Selection.Tables(1)
            If .Style <> "Tabellengitternetz" Then
                .Style = "Tabellengitternetz"
            End If
            .ApplyStyleHeadingRows = True
            .ApplyStyleLastRow = True
            .ApplyStyleFirstColumn = True
            .ApplyStyleLastColumn = True
        End With
        With Selection.Tables(1).Rows
            .WrapAroundText = True
            .HorizontalPosition = CentimetersToPoints(2)
            .RelativeHorizontalPosition = wdRelativeHorizontalPositionPage
            .DistanceLeft = CentimetersToPoints(0.25)
            .DistanceRight = CentimetersToPoints(0.25)
            .VerticalPosition = CentimetersToPoints(8)
            .RelativeVerticalPosition = wdRelativeVerticalPositionPage
            .DistanceTop = CentimetersToPoints(0)
            .DistanceBottom = CentimetersToPoints(0)
            .AllowOverlap = False
        End With
    End Sub
    i will translate it in abap. how can i do it.
    i tried something in FORM TABELLE_ERSTELLEN but i can see the table, but i don't get the right position.
    Any idea?
    thanks.
    Regards, Dieter

  • Downloading problem in classical report

    Hello Experts,
    I had made one Z classical report. The output of the report is absolutely perfect.
    The problem is when I am downloading this file as spreadsheet or HTML formatt, then the Item level data is coming one column forward.
    Like, suppose these are four columns of my report,then in excel sheet data is appearing as:
    S.no          Ref no.                    date                  name
                       1                        900556               22/11/2011          ABC
                       2                        900567               22/11/2011          XYZ
    But the data in output of the report is showing correctly.
    How should I correct this.
    Please help.
    Edited by: shubh_ag on Nov 22, 2011 1:18 PM

    Hi shubh,
    Use concatenate and pass all the header data into one string. Use cl_abap_char_utilities=>horizontal_tab
    In your case
    Concatenate
    u2018S.Nou2019  cl_abap_char_utilities=>horizontal_tab
    u2018Ref NOu2019 cl_abap_char_utilities=>horizontal_tab
    Into w_string
    cl_abap_char_utilities=>newline
          into text.
    For item data also use same procedure.
    Structure-s.no  cl_abap_char_utilities=>horizontal_tab
    Into text.
    And use the below function
    call function 'SCMS_STRING_TO_XSTRING'
        exporting
          text   = text
        importing
          buffer = xtext.  wdr_task=>client_window->client->attach_file_to_response(
    **path to the word file
        i_filename = 'WDP.xls'
    String Variable
        i_content =  xtext
    File Type
        i_mime_type = 'EXCEL' ).
    Thanks are Regards.
    sivaram Patruni.

  • I am trying to download words with friends app and it says it is no longer available from itunes.  I had already downloaded it and did a update in my I phone 4 and it is still not letting me download it?

    I am trying to download words with friends and itunes is saying it is no longer available for purchase.  What is going on??I

    First you need to research all the problems people are having with the higher OSX versions, & make sure you have a bootable clone of what you have just in case.
    then you must get 10.6 if they still have it, install it & update to 10.6.8 so you have the App Store to buy & download the huge 10.8 Installer.
    Snow Leopard/10.6.x Requirements...
    General requirements
       * Mac computer with an Intel processor
        * 1GB of memory (I say 4GB at least, more if you can afford it)
        * 5GB of available disk space (I say 30GB at least)
        * DVD drive for installation
        * Some features require a compatible Internet service provider; fees may apply.
        * Some features require Apple’s MobileMe service; fees and terms apply.
    Which apps work with Mac OS X 10.6?...
    http://snowleopard.wikidot.com/
    It's been pulled from the online store & Apple Stores, so you have to call Apple to buy it, last I heard.
    Call Apple Sales...in the US: 1-800-MY-APPLE. Or Support... 1-800-275-2273
    Other countries...
    http://support.apple.com/kb/HE57

Maybe you are looking for

  • How can I get the start and end of a date range?

    Post Author: RobR CA Forum: Formula Greetings! I have a report whose records are selected if a date field is within the date range returned by the LastFullWeek function.  I want the header for that report to print the first and last dates in that ran

  • Viewing in Acrobat X vs. Acrobat 9

    When viewing a document on my monitor using Acrobat 9 Pro, the colours are quite good; when doing the same with Acrobat X Pro, the colours are somewhat dull and dark, particularly the reds. WHY; how does one fix this? (I am using a hardware calibrate

  • Barcode not printing on Zebra printer

    Hi All, We are facing an issue while printing the barcode from ECC 5.0 using a smartform. The problem is that the z program creates a spool when we click the print option but does not print the barcode in the zebra printer.Also when we try to print f

  • WebLogic Portal 9.2 Gets Dojo AJAX Integration

    Hi All, There is a new project on CodeShare that provides WebLogic Portal 9.2 with Dojo AJAX integration. View the CodeShare Community Blog for more information. Take care, Jeremy Whitlock

  • I have a display issue with sliders - XP 64/CS4

    Has anyone else come across this issue using brush controls etc. sliders don't show up, but appear to be "working" in that moving the mouse where the slider should be controls the brush? Also, after a while this manifests further with a blank/white s