Saving Excel sheet information from webpage !

Hi,
I have one requirement in Dialog programming. When user clicks a button it open the excel sheet thru webpage link. Can I save that excel sheet information into internal table thru weblink automatically?
I would greatly appreciate your inputs.
Thanks
Somi Reddy

Hi Sonal,
The below might not be the actual answer to your question,but it might help in giving some information .excelsheet to internal table.
there are some more alternative other than the below coding,
u2018KCD_EXCEL_OLE_TO_INT_CONVERTu2019
and u2018ALSM_EXCEL_TO_INTERNAL_TABLEu2019 but the method below is by far the simplest method to use.
This is a simple example program to get data from an excel :
*: file and store it in an internal table. :
*:u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026:
REPORT zupload_excel_to_itab.
TYPE-POOLS: truxs.
PARAMETERS: p_file TYPE rlgrap-filename.
TYPES: BEGIN OF t_datatab,
col1(30) TYPE c,
col2(30) TYPE c,
col3(30) TYPE c,
END OF t_datatab.
DATA: it_datatab type standard table of t_datatab,
wa_datatab type t_datatab.
DATA: it_raw TYPE truxs_t_text_data.
At selection screen
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION u2018F4_FILENAMEu2019
EXPORTING
field_name = u2018P_FILEu2019
IMPORTING
file_name = p_file.
*START-OF-SELECTION.
START-OF-SELECTION.
CALL FUNCTION u2018TEXT_CONVERT_XLS_TO_SAPu2019
EXPORTING
I_FIELD_SEPERATOR =
i_line_header = u2018Xu2019
i_tab_raw_data = it_raw u201D WORK TABLE
i_filename = p_file
TABLES
i_tab_converted_data = it_datatab[] u201CACTUAL DATA
EXCEPTIONS
conversion_failed = 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.
END-OF-SELECTION.
END-OF-SELECTION.
LOOP AT it_datatab INTO wa_datatab.
WRITE:/ wa_datatab-col1,
wa_datatab-col2,
wa_datatab-col3.
ENDLOOP.

Similar Messages

  • Read and write excel sheet data from uploded file in sharepoint site programmatically 2013

    hi team,
    I am working on sharepoint 2013.I want to read and write data in excel sheet (micrsoft excel) from stored file in shrepoint docoumnt library .please suggest me
    vijay

    Hi
    Vijay,
    check those links
    http://www.sharepointwithattitude.com/archives/61
    https://social.technet.microsoft.com/Forums/en-US/e760051b-a92f-473c-9ec9-0f0c36c99e40/read-and-write-excel-sheet-data-from-uploded-file-in-sharepoint-site-programmatically-2013?forum=sharepointdevelopment
    Kind Regards, John Naguib Technical Consultant/Architect MCITP, MCPD, MCTS, MCT, TOGAF 9 Foundation. Please remember to mark the reply as answer if it helps.

  • Send information from webpage to an email

    i am new to Java & Programming , i am creating a webpage & i Need to send information from webpage to an email without using the database,
    please help me out

    ??? You don't use a database to send emails, you use the JavaMail api.
    http://java.sun.com/products/javamail/

  • How to Get the excel sheet formula from the server side into the j2me app?

    How to Get the excel sheet formula from the server side into the j2me application?
    Here the excel sheet is in server side.i want to do get the excel sheet values (only some part of the excel sheet based on some conditions) from server side into j2me.In j2me I want to done some client side validation based on the formula of excel sheet.Then i resend the new updated data to the server.
    But here deosn't know any mehtod to get the excel sheet formula from server side.So kindly help me to get the excel sheet formula from the server.
    So how to get the excel sheet formula frome the server side into j2me Application...
    Plz guide me to solve this issue...
    thanks & regards, Sivakumar.J

    You should not post a thread more than once. You've crossposted this question to another forum. I have deleted that one.

  • Excel sheet upload from alv report.

    hi friends,
            we created one report which will display about sales from vender,.  we created it as hirarical alv report.  
    we all know when we downloaded the data which is shown on report to excel sheet  standard report will run. but when i saw my excel file most of rows are exported finly but some of rows are clubed into another row colum.  how it is happening. the data is passed to excel sheet  by standard report how this prablem is happening.
    plz guide me
    thanq,
    rajesh.k

    hi
    use code below to upload excel.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD
    EXPORTING
       FILENAME                = 'exccel Worksheet.txt'
       FILETYPE                = '.XLS'
       HAS_FIELD_SEPARATOR     = '#'
       HEADER_LENGTH           = 0
       READ_BY_LINE            = 'X'
       DAT_MODE                = SPACE
       CODEPAGE                = SPACE
       IGNORE_CERR             = ABAP_TRUE
        REPLACEMENT             = '#'
       VIRUS_SCAN_PROFILE      =
    IMPORTING
       FILELENGTH              =
       HEADER                  =
    CHANGING
       DATA_TAB                = <fs_dict>
    EXCEPTIONS
       FILE_OPEN_ERROR         = 1
       FILE_READ_ERROR         = 2
       NO_BATCH                = 3
       GUI_REFUSE_FILETRANSFER = 4
       INVALID_TYPE            = 5
       NO_AUTHORITY            = 6
       UNKNOWN_ERROR           = 7
       BAD_DATA_FORMAT         = 8
       HEADER_NOT_ALLOWED      = 9
       SEPARATOR_NOT_ALLOWED   = 10
       HEADER_TOO_LONG         = 11
       UNKNOWN_DP_ERROR        = 12
       ACCESS_DENIED           = 13
       DP_OUT_OF_MEMORY        = 14
       DISK_FULL               = 15
       DP_TIMEOUT              = 16
       NOT_SUPPORTED_BY_GUI    = 17
       ERROR_NO_GUI            = 18
       others                  = 19
    *IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *ENDIF.

  • Excel pulling information from another SpreadSheet (source) when (source) is closed

    Hi,
    I have been struggling with changing some fields in a SpreadSheet from COUNTIFS and SUMIFS to SUMPRODUCT as below:
    =COUNTIFS('S:\Data\HQ\2014\Report.xlsx'!Table2[RFI Date],">="&B1,'S:\Data\HQ\2014\Report.xlsx'!Table2[RFI
    Date],"<="&B2)
    to
    =SUMPRODUCT(('S:\Data\HQ\2014\Report.xlsx'!Table2[RFI Date]>=B1)*('S:\Data\HQ\2014\Report.xlsx'!Table2[RFI
    Date]<=B2))
    It still seems to require the source spreadsheet to be open.
    Can somebody please advise is it possible to pull cell data from a closed source SpreadSheet without first opening it or using VBA?
    Thanks,
    Charles 

    Hi,
    If a formula that contains the SUMIF, SUMIFS, COUNTIF, COUNTIFS or COUNTBLANK functions may return the "#VALUE!" error when it contains the function refers to cells in a closed workbook and the cells are calculated.
    To work around this behavior, use a combination of the SUM and IF functions together in an array formula.
    Example:
    SUMIF:
    Instead of using a formula that is similar to the following:
    =SUMIF([Source]Sheet1!$A$1:$A$8,"a",[Source]Sheet1!$B$1:$B$8)
    use the following formula:
    =SUM(IF([Source]Sheet1!$A$1:$A$8="a",[Source]Sheet1!$B$1:$B$8,0))
    COUNTIF:
    Instead of using a formula that is similar to the following:
    =COUNTIF([Source]Sheet1!$A$1:$A$8,"a")
    use the following formula:
    =SUM(IF([Source]Sheet1!$A$1:$A$8="a",1,0))
    Quote From:
    http://support.microsoft.com/kb/260415/en-us
    Regards,
    George Zhao
    TechNet Community Support

  • Universe created from a Ms Excel sheet --

    Hi Good Morning,
    I created One webi report in BO .Now i want to create a universe from MS Excel File .Please tell me step by step Process .
    Thanks In Advance
    Praveen Kumar Yagnamurthy.

    Please try the following steps to create a universe on excel file
    1. Open the Excel spreadsheet
    2. Select all the data values, make sure the remaining blank cells donu2019t get selected
    3. Click on Insert>>Name>>Define to give a name to the table
    4. Save the Excel
    5. Go to Start>>Control Panel>>Administrative tools>Data Sources(ODBC)
    6. Select System DSN>>Add>>Microsoft excel Driver(*.xls)
    7. Give a new data source name and click on Select workbook and point the saved excel sheet and click on OK
    8. Create a new connection in Universe designer by using the Generic ODBC connection
    9. Create a new universe and insert the table which we have defined in the Excel sheet
    Note:
    1. Make sure the parameter <Parameter Name="Transactional Available">No</Parameter> is set to Yes under the Generic ODBC data source in below location
    C:\Program Files\Business Objects\Business Objects Enterprise 11.5\win32_x86\dataAccess\connectionServer\odbc\odbc.sbo
    2. If you would like to export the excel universe to CMC try these steps on your BO server machine
    3. This workaround only works for windows server machine
    Regards
    Manoj Kumar

  • How to dispaly information from the webpage into the gadget???

    hi ,
    i have successfully executed few widgets given in the blogs..now am developing a widget for getting the information from webpage..
    ex: am trying to display the contributors list/page in a widget..
    thankx
    jaideep

    Thank You Jaideep,
    I tried creating the "RSS Reader Widget" as described in the SAP Enterprise Widget Development Guide pdf.
    But when I launch the widget, I am getting the below mentioned error
    Data Received! Text Length 11318
    out of memory (SkinCell.js: Line 222)
    /* SkinInput */ this.input = null;  // valid if the cell contains an input [code in line 222 of SkinCell.js]
    But I am getting the data received text length.
    I went through the net and they asked me to download latest service pack....
    Could you kindly let me know as to what might be the problem?
    Regards,
    Shilpa B.V

  • Webi and Excel sheet universe

    Hi gurus,
    I created an universe based on Ms Excel sheet.
    I have created a webi report , but when iI run the report, it does not work ==> DataBase eroor : [Microsoft][ODBC driver manager] Data source name does not found and no default driver specified. (WIW 10901)
    However, this data source name exist , I cretaed it via odbc.
    So i don't understand the matter. Am I missing some settings ?
    Thanks for your help

    Hi Firmin
    Are you able to browse the data from Universe Designer?
    Suggest you to try the below:
    1. Open the Excel spreadsheet
    2. Select all the data values, make sure the remaining blank cells donu2019t get selected
    3. Click on Insert>>Name>>Define to give a name to the table
    4. Save the Excel
    5. Go to Start>>Control Panel>>Administrative tools>Data Sources(ODBC)
    6. Select System DSN>>Add>>Microsoft excel Driver(*.xls)
    7. Give a new data source name and click on Select workbook and point the saved excel sheet and 8. click on OK
    Note: Make sure the parameter <Parameter Name="Transactional Available">No</Parameter> is set to Yes under the Generic ODBC datasource in below location
    C:\Program Files\Business Objects\BusinessObjects Enterprise 11.5\win32_x86\dataAccess\connectionServer\odbc\odbc.sbo
    1. Create a new connection in Universe designer by using the Generic ODBC connection
    2. Create a new universe and insert the table which we have defined in the Excel sheet.
    3. Save and export this universe to the repository.
    4.Now create a webi report based on this Universe.
    Hope this helps!!
    Regards
    Sourashree

  • To Mak the headings Bold in Excel sheet.

    Hi All,
         I am sending a mail to SAP inbox with an excel Sheet as an attachment.
         I am creating the Excel sheet Dynamically from the internal table,
         Now the Problem is the Headings i am putting in each colum are mixed with the data of the colums,
         So I have to make the headings<b> BOLD</b> or atleast I have to Differentiate them with the rest of the Data,
         Please Help me out in this,
    Thanx,   Girish.

    Hi Girish,
                 Check out the example.gs_font is marked in bold
    Code Part B.1 Data declarations
    REPORT zole_tutor_example_ms_word .
    *--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_documents TYPE ole2_object . "Documents
    DATA gs_actdoc 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
    <b>DATA gs_font TYPE ole2_object . "Font</b>
    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_table_border TYPE ole2_object . "Table border
    DATA gs_cell TYPE ole2_object . "One cell of a table
    DATA gs_paragraph TYPE ole2_object . "Paragraph
    DATA gv_pos(5) TYPE n . "Position information for table
    Step 2   Creating the OLE object and get main entities to handle variables.
    START-OF-SELECTION .
    *--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_documents .
    CALL METHOD OF gs_documents 'Add' .
    *--Getting active document handle
    GET PROPERTY OF gs_word 'ActiveDocument' = gs_actdoc .
    *--Getting applications handle
    GET PROPERTY OF gs_actdoc 'Application' = gs_application .
    Code Part B.2 Creating the OLE object
    Step 3   Setting the measurement unit to ‘CM.’
    Code Part B.3 Setting measurement unit
    *--Setting the measurement unit
    GET PROPERTY OF gs_application 'Options' = gs_options .
    SET PROPERTY OF gs_options 'MeasurementUnit' = '1' . "CM
    Step 4   Some header text.
    Code Part B.4 Setting header content
    *--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 .
    *--Setting font attributes
    SET PROPERTY OF gs_font 'Name' = 'Arial' .
    SET PROPERTY OF gs_font 'Size' = '10' .
    SET PROPERTY OF gs_font 'Bold' = '0' . "Not bold
    SET PROPERTY OF gs_font 'Italic' = '1' . "Italic
    SET PROPERTY OF gs_font 'Underline' = '0' . "Not underlined
    *--Setting paragraph format attribute
    SET PROPERTY OF gs_parformat 'Alignment' = '2' . "Right-justified
    CALL METHOD OF gs_selection 'TypeText'
    EXPORTING
    #1 = 'This is an OLE example!'.
    *--Setting the view to the main document again
    SET PROPERTY OF gs_view 'SeekView' = '0' . "Main document view
    Step 5   Writing the title.
    Code Part B.5 Writing the title
    *--Reseting font attributes for the title
    SET PROPERTY OF gs_font 'Name' = 'Times New Roman' .
    SET PROPERTY OF gs_font 'Size' = '16' .
    SET PROPERTY OF gs_font 'Bold' = '1' . "Bold
    SET PROPERTY OF gs_font 'Italic' = '0' . "Not Italic
    SET PROPERTY OF gs_font 'Underline' = '0' . "Not underlined
    *--Setting paragraph format attribute
    SET PROPERTY OF gs_parformat 'Alignment' = '1' . "Centered
    CALL METHOD OF gs_selection 'TypeText'
    EXPORTING
    #1 = text-000.
    *--Advancing cursor to the new line
    CALL METHOD OF gs_selection 'TypeParagraph' .
    Step 6   Writing some text.
    Code Part B.6 Writing some text
    *--Reseting font attributes for ordinary text
    SET PROPERTY OF gs_font 'Name' = 'Times New Roman' .
    SET PROPERTY OF gs_font 'Size' = '12' .
    SET PROPERTY OF gs_font 'Bold' = '0' . "Not bold
    SET PROPERTY OF gs_font 'Italic' = '0' . "Not Italic
    SET PROPERTY OF gs_font 'Underline' = '0' . "Not underlined
    Please reward if useful.

  • Excel sheet with tabs

    Hi all,
    I have an excel sheet with 2 spread sheets. 1 hidden and other visible.
    1) How to read the excel so that the hidden fields dont come into the internal table in which the data is read?
    2) when the data is read from the visible tab of the excel sheet, data from hidden tab is also getting added in the internal table.
    How to avoid it?
    Useful answers will be rewarded with points.
    please help!!!

    Hi,
    If you have 2 tabs in your excel sheet. Open one tab which you want to process save it. Now it should be process active tab only.
    thanks,
    Sriram.

  • Formula in Excel Sheet shows #VALUE!.

    Hi,
    I have 11gr2 Forms/Reports with Windows Server 2008 64-bit.
    I have Excel sheet imported from Oracle Reports with destype=enhancedspreadsheet.
    Problem is in my Excel sheet, that when I add formula to multiply two columns, it shows #VALUE! error, which is actually occurs
    when we multiply a text column with number column.
    Although values in columns in number format (like 8600.000,45.000), it assumes these as text column and when
    I re-enter same values in columns manually, formula column shows result without any error.
    Is there any settings in REPORTS to avoid this error ?
    Thanks with Regards.
    Bhatt.

    Tom,
    This may seem like a stupid comment but have you checked to see if the excel formulas were put into the layout in the layout definitions screen and not in the layout while executing the layout?  Also does the layout have dynamic columns? 
    For example, if I have 12 Dynamic columns for the periods of the year based on a variable it would only show up in the layout definition screen as 1 data column but would be 12 columns on executing the layout and thus the Excel Formula need to be in the 13th column rather than the 2nd column
    Hope this helps,
    Mary

  • How to run a excel sheet macro using RH_START_EXCEL_WITH_DATA

    Hi All,
    I have found out one FM, RH_START_EXCEL_WITH_DATA,
    To run the excel sheet marco from the ABAP editor.
    DATA_FILENAME
    DATA_PATH_FLAG
    DATA_ENVIRONMENT
    DATA_TABLE
    MACRO_FILENAME
    MACRO_PATH_FLAG
    MACRO_ENVIRONMENT
    WAIT
    DELETE_FILE
    I found these parameters in the FM,
    which I need to pass,
    Any code sample...
    Any hint...
    Thanks,
    Kalyan Chandramouli

    hi
    good
    check with this report.
    REPORT Z_DISPLAY_IDOC_AND_DATA line-size 275.
    This tool reads an existing Idoc and dispays the contents in a       *
    spreadsheet format. The spreadsheet (MS-EXCEL) will be automatically *
    created if D_EXCEL = 'X'.                                            *
    data: idoc_control like EDIDC,
          NUMBER_OF_DATA_RECORDS like sy-dbcnt,
          NUMBER_OF_STATUS_RECORDS like sy-dbcnt,
          INT_EDIDS like edids occurs 0 with header line,
          INT_EDIDD like edidd occurs 0 with header line.
    TYPE-POOLS :  LEDID.
    data: STRUCT_TYPE TYPE  LEDID_STRUCT_TYPE ,
          IDOC_STRUCT TYPE  LEDID_T_IDOC_STRUCT,
          SEGMENTS TYPE  LEDID_T_SEGMENT,
          SEGMENT_STRUCT TYPE  LEDID_T_SEGMENT_STRUCT,
          excel_tab(2000) occurs 0 with header line.
    parameter: DOCNUM like edidc-docnum obligatory, ""Idoc Number
               sap_rel like SY-SAPRL default SY-SAPRL obligatory,
               pi_ver like EDI_VERREC-VERSION default '3' obligatory,
               d_excel as checkbox default 'X'. ""Download ?
    start-of-selection.
      perform read_idoc.
      perform process_idoc.
      if d_excel = 'X'.
        perform download_to_excel.
      endif.
    end-of-selection.
    FORM read_idoc.
      CALL FUNCTION 'IDOC_READ_COMPLETELY'
           EXPORTING
                DOCUMENT_NUMBER          = docnum
           IMPORTING
                IDOC_CONTROL             = idoc_control
                NUMBER_OF_DATA_RECORDS   = NUMBER_OF_DATA_RECORDS
                NUMBER_OF_STATUS_RECORDS = NUMBER_OF_STATUS_RECORDS
           TABLES
                INT_EDIDS                = INT_EDIDS
                INT_EDIDD                = INT_EDIDD
           EXCEPTIONS
                DOCUMENT_NOT_EXIST       = 1
                DOCUMENT_NUMBER_INVALID  = 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.
    ENDFORM.                    "" read_idoc
    FORM process_idoc.
      perform read_idoc_structure.
      perform display_data_records.
    ENDFORM.                    "" process_idoc
    FORM display_data_records.
      data: PE_seg_HEADER like EDI_SAPI01,
            segname like EDI_IAPI12-SEGMENTTYP,
            prev_segname like EDI_IAPI12-SEGMENTTYP value ' ',
            pt_fields2 like EDI_IAPI12 occurs 0 with header line,
            PT_FVALUES2 like EDI_IAPI14 occurs 0 with header line,
            byte_first type i,
            byte_last type i,
            field_val(50),
            tmp_str(15),
            tmp_str3(15),
            seg_repeats type i value 0,
            tmp_str2(15),
            tab_cr(1) type x value '09',
            tot_ctr type i value 0,
            ctr type i value 0,
            msg(40) type c.
      data: IDOC_STRUCT_wa TYPE  LEDID_IDOC_STRUCT.
      sort int_edidd by segnum.
      describe table int_edidd lines tot_ctr.
      loop at int_edidd.
        move int_edidd-segnam to segname.
        clear msg.
        concatenate 'Reading segment ' segname
                    into msg separated by space.
        if tot_ctr <> 0.
          ctr = ( 100 * sy-tabix ) / tot_ctr.
        endif.
        CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
             EXPORTING
                  PERCENTAGE = ctr
                  TEXT       = msg.
        add 1 to seg_repeats.
        clear tmp_str2.
        if int_edidd-segnam <> prev_segname.
          seg_repeats = 1.
          clear: pe_seg_header, pt_fields2, pt_fvalues2.
          refresh: pt_fields2, pt_fvalues2.
          CALL FUNCTION 'SEGMENT_READ_COMPLETE'
               EXPORTING
                    PI_SEGTYP                 = segname
                    PI_RELEASE                = sap_rel
                    PI_VERSION                = pi_ver
               IMPORTING
                    PE_HEADER                 = pe_seg_header
               TABLES
                    PT_FIELDS                 = pt_fields2
                    PT_FVALUES                = pt_fvalues2
               EXCEPTIONS
                    SEGMENT_UNKNOWN           = 1
                    SEGMENT_STRUCTURE_UNKNOWN = 2
                    OTHERS                    = 3.
          IF SY-SUBRC <> 0.
            MESSAGE ID SY-MSGID TYPE 'I' NUMBER SY-MSGNO
                    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
          prev_segname = int_edidd-segnam.
        endif.
        read table idoc_struct into idoc_struct_wa with key
                               segment_type = int_edidd-segnam.
        if sy-subrc = 0.
          IF IDOC_STRUCT_WA-SYNTAX_ATTRIB-MUSTFL = 'X'.
            TMP_STR = 'Mandatory'.                  ""Mandatory
          ELSE.
            TMP_STR = 'Optional'.                  ""Optional
          ENDIF.
          if IDOC_STRUCT_wa-SEGMENT_TYPE_ATTRIB-QUALIFIER = 'X'.
            tmp_str3 = 'Qualified'.
          else.
            tmp_str3 = 'Non-Qualified'.
          endif.
          shift IDOC_STRUCT_wa-SYNTAX_ATTRIB-OCCMAX
                                     left deleting leading '0'.
          move seg_repeats to tmp_str2.
          condense: IDOC_STRUCT_wa-SYNTAX_ATTRIB-OCCMAX, tmp_str2.
          concatenate tmp_str2 'of'  IDOC_STRUCT_wa-SYNTAX_ATTRIB-OCCMAX
              into tmp_str2 separated by space.
          write :/ IDOC_STRUCT_wa-SEGMENT_TYPE,
               tmp_str,
               TMP_STR3,
               tmp_str2,
               IDOC_STRUCT_wa-SYNTAX_ATTRIB-HLEVEL,
               IDOC_STRUCT_wa-SEGMENT_TYPE_ATTRIB-plast,
               IDOC_STRUCT_wa-SEGMENT_TYPE_ATTRIB-DESCRP.
          if d_excel = 'X'.
            concatenate 'Segment Name' tab_cr
                        'Mand / Opt ' tab_cr
                        'Qual / non-Qual' tab_cr
                        'Seq of Max' tab_cr
                        'Level' tab_cr
                        'Owner' tab_cr
                        'Description'
                        into excel_tab.
            append excel_tab.
            concatenate IDOC_STRUCT_wa-SEGMENT_TYPE tab_cr
                  tmp_str tab_cr
                  TMP_STR3 tab_cr
                  tmp_str2 tab_cr
                  IDOC_STRUCT_wa-SYNTAX_ATTRIB-HLEVEL tab_cr
                  IDOC_STRUCT_wa-SEGMENT_TYPE_ATTRIB-plast tab_cr
                  IDOC_STRUCT_wa-SEGMENT_TYPE_ATTRIB-DESCRP
                  into excel_tab.
            append excel_tab.
            concatenate tab_cr
                        'Field Nma' tab_cr
                        'Type' tab_cr
                        'Length' tab_cr
                        'Byte From' tab_cr
                        'Byte To' tab_cr
                        'Description' tab_cr
                        'Value' tab_cr
                        'Qualifier Meaning'
                        into excel_tab.
            append excel_tab.
          endif.
        endif.
        sort pt_fields2 by field_pos.
        byte_first = 0.
        loop at pt_fields2.
          clear: field_val.
          byte_last = pt_fields2-EXTLEN.
          write int_edidd-sdata+byte_first(byte_last) to
                field_val left-justified.
          shift pt_fields2-EXTLEN left deleting leading '0'.
          shift pt_fields2-byte_first left deleting leading '0'.
          shift pt_fields2-byte_last left deleting leading '0'.
          write:/ '   ', pt_fields2-fieldname,
                  pt_fields2-datatype,
                  pt_fields2-EXTLEN,
                  pt_fields2-byte_first ,
                  pt_fields2-byte_last,
                  pt_fields2-descrp,
                  field_val.
          read table pt_fvalues2 with key fieldname = pt_fields2-fieldname
                        fldvalue_l = field_val.
          add byte_last to byte_first.
          if sy-subrc = 0.
            write : pt_fvalues2-descrp.
          else.
            clear pt_fvalues2-descrp.
          endif.
          if d_excel = 'X'.
            concatenate tab_cr pt_fields2-fieldname tab_cr
                    pt_fields2-datatype tab_cr
                    pt_fields2-EXTLEN tab_cr
                    pt_fields2-byte_first tab_cr
                    pt_fields2-byte_last tab_cr
                    pt_fields2-descrp tab_cr
                    field_val tab_cr
                    pt_fvalues2-descrp
                    into excel_tab.
            append excel_tab.
          endif.
        endloop.
      endloop.
    ENDFORM.                    "" display_data_records
    FORM read_idoc_structure.
      data: idoctype type LEDID_IDOCTYPE.
      if not idoc_control-cimtyp is initial.
        STRUCT_TYPE = 'E'. ""Extended
        idoctype = idoc_control-cimtyp.
      else.
        STRUCT_TYPE = 'B'. ""Basic
        idoctype = idoc_control-idoctp.
      endif.
      CALL FUNCTION 'IDOC_TYPE_COMPLETE_READ'
           EXPORTING
                RELEASE              = sap_rel
                STRUCT_TYPE          = STRUCT_TYPE
                IDOCTYPE             = idoctype
                VERSION              = pi_ver
          IMPORTING
               IDOC_TYPE            = idoctype
           TABLES
                IDOC_STRUCT          = idoc_struct
                SEGMENTS             = segments
                SEGMENT_STRUCT       = segment_struct
           EXCEPTIONS
                IDOCTYPE_UNKNOWN     = 1
                IDOCSTRUCT_UNKNOWN   = 2
                SEGMENT_DATA_MISSING = 3
                ILLEGAL_STRUCT_TYPE  = 4
                OTHERS               = 5.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    "" read_idoc_structure
    FORM download_to_excel.
      data: name like RLGRAP-FILENAME.
      shift docnum left deleting leading '0'.
      concatenate docnum '-' idoc_control-idoctp '.xls'
                  into name.
      CALL FUNCTION 'RH_START_EXCEL_WITH_DATA'
       EXPORTING
         DATA_NAME                 = name
         DATA_TYPE                 = 'ASC'
         WAIT                      = ' '
       TABLES
         DATA_TAB                  = excel_tab
       EXCEPTIONS
         NO_BATCH                  = 1
         EXCEL_NOT_INSTALLED       = 2
         WRONG_VERSION             = 3
         INTERNAL_ERROR            = 4
         INVALID_TYPE              = 5
         CANCELLED                 = 6
         DOWNLOAD_ERROR            = 7
         OTHERS                    = 8
      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.                    "" download_to_excel
    reward point if helpful.
    thanks
    mrutyun^

  • Excel sheet problem

    i am using oracle forms 10.1.2.02.
    jpi 1.6.0.16
    i am uploading 8 excel sheets and from that i want to create a new excel workbook having 80 worksheets.
    i have written the followng code for that but it shows me ora 6531 error.
    declare
    application ole2.OBJ_TYPE;
    workbook1 ole2.OBJ_TYPE;
    workbooks1 ole2.OBJ_TYPE;
    worksheets1 ole2.OBJ_TYPE;
    workbook2 ole2.OBJ_TYPE;
    workbooks2 ole2.OBJ_TYPE;
    worksheets2 ole2.OBJ_TYPE;
    args1 ole2.list_type;
    type wlist is table of ole2.obj_type;
    worksheet2 wlist;
    file1 varchar2(300):='D:\Price(Discount_file_for_Helium)_Sales_Format_'||sysdate||'.xls';
    application := ole2.create_obj('excel.application');
    ole2.set_property(application,'visible','true');
    workbooks1 := ole2.get_obj_property(application,'workbooks');
    workbooks2 := ole2.get_obj_property(application,'workbooks');
    ----open required workbook------
    workbook2 := ole2.invoke_obj(workbooks2,'Add');
                             for i in 1..80
                             loop
                             args1:=ole2.create_arglist;
                                  ole2.add_arg(args1,i);
                                  worksheet2(i):=ole2.get_obj_property(workbook2,'worksheets',args1);
                                  ole2.destroy_arglist(args1);
                             end loop;     
                   ------------------------code-----------------------------          
              -- Save as worksheet     
                        save_wsheet(application,workbook2,file1);
    --Close excel sheet after reading
    ole2.invoke(application,'quit');
    --release all objects
    ole2.release_obj(worksheet1);
    ole2.release_obj(workbook1);
    ole2.release_obj(workbooks1);
    for i in 1..80
    loop
    ole2.release_obj(worksheet2(i));
    end loop;
    ole2.release_obj(workbook2);
    ole2.release_obj(workbooks2);
    ole2.release_obj(application);
    message('File successfully generated..');
    message('File successfully generated..');
    end;
    Edited by: kaminanikamini on Oct 26, 2012 6:04 AM
    Edited by: kaminanikamini on Oct 26, 2012 8:47 PM

    Hi,
    MS Excel File corruption is very difficult situation for any user because due to corruption user unable to retrieve the stored data and their properties. This corruption generally comes because of virus attack or due to some other reasons. But you can repair
    all the corruption of excel file.
    By using Excel Repair Toolbox, you can easily repair the corruption of excel file. This repair tool is very powerful as it scans the entire excel file and recover all the excel file that are inaccessible due to corruption.
    So just download this repair tool and repair your excel file with just simple steps
    http://www.excelrepairtoolbox.com/

  • Add an excel sheet

    Hello everyone,
    My question today is how do I add a excel sheet into a webpage created in dreamweaver.
    Thank you for your help.
    Regards,
    Lisa Cain

    One way is to export your Excel worksheet to HTML and save to your local site folder.
    Link your DW page to the Excel.html page.
    Or bring Excel.html into parent page with an inline frame (iframe).
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    http://alt-web.com/
    http://twitter.com/altweb

Maybe you are looking for

  • Logical error in this procedure

    Hi, I have creted this procedure when i execute it, procedure created successfully, but when i run the procedute then it gives this error *ERROR at line 1: ORA-00933: SQL command not properly ended ORA-06512: at "POI_RELEASE.SPECIAL_YPOL", line 13 OR

  • Can you set a global EntityResolver (via system property, or static method)

    I'm trying to set a customized EntityResolver (telling the xml parser where to look for XML schema files). Usually, you'd use the standard syntax - somehting like: SaxParser parser=new SaxParser(); parser.parser.setEntityResolver(myResolver); However

  • IMac mid 2010 w OSX 10.9.5: headphone with mic -- mic no longer working

    I've been using the same headset plus mic with my iMac for a couple of years. Has worked fine until yesterday. Now the mic does not work. Headset / mic still work fine with my phone and other computers so nothing wrong with the headset. Checked syste

  • PDF printer not working, does not create PDF

    I am using Mac OS X 10.6.8 with Adobe Acrobat XI. Whenever I try to print a PDF though the printer function the PDF printer opens for a few seconds and no PDF is created. Here is an example of the report when I open a file with in the Acrobat Distill

  • Problem in setting up NAS200 as web server

    Hi, I have no idea why i unable to make my NAS200 up as my web server 1st. i set up an account and domain name with tzo. 2nd, i port forward nas200 for port 80 and 21 in my router, which the 2 port is the dfault port that i use in my router setting.