Generic Repository class to download BSP into Ms-excel

Hi,
we have developed the download utility for BSP-MVC application, we have many BSP-MVC applications so i have to  develop a generic Repository class to download BSP into ms-excel, which is usable for all, the data selection will be done from model at run time by using techniques (field symbols and data references)wolud you please suggest how to achive this.
Thanks in advance !
best regards
ravi

I have written a generic download utility as a custom BSP Extension Element.  Perhaps it will give you some ideas:
<a href="/people/thomas.jung3/blog/2004/09/02/creating-a-bsp-extension-for-downloading-a-table a BSP Extension for Downloading a Table</a>
<a href="/people/thomas.jung3/blog/2005/07/18/bsp-extension-for-downloading-a-table-applying-an-iterator Extension for Downloading a Table: Applying an Iterator</a>

Similar Messages

  • Is there a generic project/class available to hook into NTdomain user

    G'Day Folxs
    Is there a class/project available to hook into the NT domain
    username/password? Any info is much appreciated.
    TIA,
    /[:-)irK
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/forte>

    Hi,
    Right now we don't have that option. Because of bulk spam registration.
    Could you send your email ID to my PM. So that, we can get back to you.

  • How to download a char(12) field into an excel file.

    Hi all,
    I have an internal table with a field defined as char 12. I pass this internal table to  FM MS_EXCEL_OLE_STAN DARD_DAT but I find in my excel file this value: 9,87654E+11.
    Any idea to obtain the correct value 987654321011?
    Thanks in advance for your kind support.
    Regards,
            Luigi

    Hi,
    this is my test.
    FM SAP_CONVERT_TO_XLS_FORMAT  and FM MS_EXCEL_OLE_STANDARD_DAT: the value in excel file is 9,87654E+11 launching both functions. If I try to resize the column, this value don't change. If I set as cell type (manually) number with zero decimals, this is ok.
    For may test I userd the field knvv-eikto.
    How it is possible to have this value downloaded correctly into the excel file?
    Thanks in advance for your kind support.
    Regards,
       Luigi

  • Downloading data into multiple work sheets in excel

    Hi All,
    Could you please tell me the way of downloading data into multiple work sheets .
    Now, we are downloading  data into  multiple excel files and after that  copying  all the excel file data in to different work sheets of the single excel manually.
    So , here I want directly download the data into different work sheets of single excel file.
    Regards,
    Siddivinesh Jogu

    Hi,
    Down load into three worksheets in one XL
    REPORT  ZKC_TEST1.
    INCLUDE ole2incl.
    DATA: w_cell1 TYPE ole2_object,
          w_cell2 TYPE ole2_object.
    *--- Ole data Declarations
    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
          gs_interior TYPE ole2_object, " Pattern
          worksheet   TYPE ole2_object,
          h_cell      TYPE ole2_object,
          h_cell1     TYPE ole2_object,
          range       TYPE ole2_object,
          h_sheet2    TYPE ole2_object,
          h_sheet3    TYPE ole2_object,
          gs_font     TYPE ole2_object,
          e_color     TYPE ole2_object,
          gs_italic   TYPE ole2_object,
          flg_stop(1) TYPE c.
    ** Internal table Declaration
    DATA: BEGIN OF t_excel OCCURS 0,
          MATNR type mara-matnr, "(18) type c,
          ERSDA type mara-ersda, " (8)  type c,
          ERNAM type mara-ernam, "(12) type c,
          LAEDA type mara-laeda, "(8)  type c,
          AENAM type mara-aenam, "(12) type c,
          VPSTA type mara-vpsta, "(15) type c,
          PSTAT type mara-pstat, "(15) type c,
          END OF t_excel.
    DATA: t_excel_bckord LIKE t_excel OCCURS 0 WITH HEADER LINE,
          t_excel_bcklog LIKE t_excel OCCURS 0 WITH HEADER LINE,
          t_excel_blkord LIKE t_excel OCCURS 0 WITH HEADER LINE.
    data: wa_excel_bckord like line of t_excel.
    TYPES: data1(1500) TYPE c,
           ty          TYPE TABLE OF data1.
    DATA: it        TYPE ty WITH HEADER LINE,
          it_2      TYPE ty WITH HEADER LINE,
          it_3      TYPE ty WITH HEADER LINE,
          rec       TYPE sy-tfill,
          deli(1)   TYPE c,
          l_amt(18) TYPE c.
    DATA: BEGIN OF hex,
           tab TYPE x,
          END OF hex.
    FIELD-SYMBOLS: <fs> .
    CONSTANTS cns_09(2) TYPE n VALUE 09.
    ASSIGN deli TO <fs> TYPE 'X'.
    hex-tab = cns_09.
    <fs> = hex-tab.
    DATA gv_sheet_name(20) TYPE c .
    *---selecting into tables
    select MATNR
           ERSDA
           ERNAM
           LAEDA
           AENAM
           VPSTA
           PSTAT
           from mara into table t_excel_bckord
           where pstat = 'KVELBCD'.
    wa_excel_bckord-matnr = 'MATNR'.
    wa_excel_bckord-ersda = 'ERSDA'.
    wa_excel_bckord-ernam = 'ERNAM'.
    wa_excel_bckord-laeda = 'LAEDA'.
    wa_excel_bckord-aenam = 'AENAM'.
    wa_excel_bckord-vpsta = 'VPSTA'.
    wa_excel_bckord-pstat = 'PSTAT'.
    INSERT wa_excel_bckord
             INTO t_excel_bckord INDEX 1 .
    select MATNR
           ERSDA
           ERNAM
           LAEDA
           AENAM
           VPSTA
           PSTAT
           from mara into table t_excel_bcklog
           where pstat = 'KVELBCDP'.
    INSERT wa_excel_bckord
             INTO t_excel_bcklog INDEX 1 .
    select MATNR
           ERSDA
           ERNAM
           LAEDA
           AENAM
           VPSTA
           PSTAT
           from mara into table t_excel_blkord
           where pstat = 'KEBC'.
    INSERT wa_excel_bckord
             INTO t_excel_blkord INDEX 1 .
    LOOP AT t_excel_bckord.
      CONCATENATE
      t_excel_bckord-MATNR
      t_excel_bckord-ERSDA
      t_excel_bckord-ERNAM
      t_excel_bckord-laeda
      t_excel_bckord-aenam
      t_excel_bckord-vpsta
      t_excel_bckord-pstat
      INTO it
      SEPARATED BY deli.
      APPEND it.
      CLEAR it.
    ENDLOOP.
    LOOP AT t_excel_bcklog.
      CONCATENATE
      t_excel_bcklog-matnr
      t_excel_bcklog-ersda
      t_excel_bcklog-ernam
      t_excel_bcklog-laeda
      t_excel_bcklog-aenam
      t_excel_bcklog-vpsta
      t_excel_bcklog-pstat
      INTO it_2
      SEPARATED BY deli.
      APPEND it_2.
      CLEAR it_2.
    ENDLOOP.
    LOOP AT t_excel_blkord.
      CONCATENATE
      t_excel_blkord-matnr
      t_excel_blkord-ersda
      t_excel_blkord-ernam
      t_excel_blkord-laeda
      t_excel_blkord-aenam
      t_excel_blkord-vpsta
      t_excel_blkord-pstat
      INTO it_3
      SEPARATED BY deli.
      APPEND it_3.
      CLEAR it_3.
    ENDLOOP.
    *--- start Excel
    IF h_excel-header = space OR h_excel-handle = -1.
      CREATE OBJECT h_excel 'EXCEL.APPLICATION'.
    ENDIF.
    *--- get list of workbooks, initially empty
    CALL METHOD OF h_excel 'Workbooks' = h_mapl.
    SET PROPERTY OF h_excel 'Visible' = 1.
    CALL METHOD OF h_mapl 'Add' = h_map.
    gv_sheet_name = 'Back Orders'.
    GET PROPERTY OF h_excel 'ACTIVESHEET' = worksheet.
    SET PROPERTY OF worksheet 'Name' = gv_sheet_name .
    *--Formatting the area of additional data 1 and doing the BOLD
    CALL METHOD OF h_excel 'Cells' = w_cell1
      EXPORTING
      #1 = 1
      #2 = 1.
    CALL METHOD OF h_excel 'Cells' = w_cell2
      EXPORTING
      #1 = 1
      #2 = 50.
    CALL METHOD OF h_excel 'Range' = h_cell
      EXPORTING
      #1 = w_cell1
      #2 = w_cell2.
    GET PROPERTY OF h_cell  'Font' = gs_font .
    SET PROPERTY OF gs_font 'Bold' = 1 .
    SET PROPERTY OF gs_font 'Name' = 'Arial' .
    GET PROPERTY OF h_cell 'Interior' = e_color.
    SET PROPERTY OF e_color 'ColorIndex' = 35.
    GET PROPERTY OF h_cell  'Font' = gs_italic .
    SET PROPERTY OF  gs_italic 'Italic' = 1 .
    DATA l_rc TYPE i.
    CALL METHOD cl_gui_frontend_services=>clipboard_export
      IMPORTING
        data                 = it[]
      CHANGING
        rc                   = l_rc
      EXCEPTIONS
        cntl_error           = 1
        error_no_gui         = 2
        not_supported_by_gui = 3
        OTHERS               = 4.
    CALL METHOD OF h_excel 'Cells' = w_cell1
      EXPORTING
      #1 = 1
      #2 = 1.
    CALL METHOD OF h_excel 'Cells' = w_cell2
      EXPORTING
      #1 = 1
      #2 = 1.
    CALL METHOD OF h_excel 'Range' = range
      EXPORTING
      #1 = w_cell1
      #2 = w_cell2.
    CALL METHOD OF range 'Select'.
    CALL METHOD OF worksheet 'Paste'.
    gv_sheet_name = 'Backlog'.
    GET PROPERTY OF h_excel 'Sheets' = h_sheet2 .
    CALL METHOD OF h_sheet2 'Add' = h_map.
    SET PROPERTY OF h_map 'Name' = gv_sheet_name .
    GET PROPERTY OF h_excel 'ACTIVESHEET' = worksheet.
    *--Formatting the area of additional data 1 and doing the BOLD
    CALL METHOD OF h_excel 'Cells' = w_cell1
      EXPORTING
      #1 = 1
      #2 = 1.
    CALL METHOD OF h_excel 'Cells' = w_cell2
      EXPORTING
      #1 = 1
      #2 = 50.
    CALL METHOD OF h_excel 'Range' = h_cell
      EXPORTING
      #1 = w_cell1
      #2 = w_cell2.
    GET PROPERTY OF h_cell 'Font' = gs_font .
    SET PROPERTY OF gs_font 'Bold' = 1 .
    GET PROPERTY OF h_cell 'Interior' = e_color.
    SET PROPERTY OF e_color 'ColorIndex' = 40.
    CALL METHOD cl_gui_frontend_services=>clipboard_export
      IMPORTING
        data                 = it_2[]
      CHANGING
        rc                   = l_rc
      EXCEPTIONS
        cntl_error           = 1
        error_no_gui         = 2
        not_supported_by_gui = 3
        OTHERS               = 4.
    CALL METHOD OF h_excel 'Cells' = w_cell1
      EXPORTING
      #1 = 1
      #2 = 1.
    CALL METHOD OF h_excel 'Cells' = w_cell2
      EXPORTING
      #1 = 1
      #2 = 1.
    CALL METHOD OF h_excel 'Range' = range
      EXPORTING
      #1 = w_cell1
      #2 = w_cell2.
    CALL METHOD OF range 'Select'.
    CALL METHOD OF worksheet 'Paste'.
    gv_sheet_name = 'Blocked Orders'.
    GET PROPERTY OF h_excel 'Sheets' = h_sheet3 .
    CALL METHOD OF h_sheet3 'Add' = h_map.
    SET PROPERTY OF h_map 'Name' = gv_sheet_name .
    GET PROPERTY OF h_excel 'ACTIVESHEET' = worksheet.
    *--Formatting the area of additional data 1 and doing the BOLD
    CALL METHOD OF h_excel 'Cells' = w_cell1
      EXPORTING
      #1 = 1
      #2 = 1.
    CALL METHOD OF h_excel 'Cells' = w_cell2
      EXPORTING
      #1 = 1
      #2 = 50.
    CALL METHOD OF h_excel 'Range' = h_cell
      EXPORTING
      #1 = w_cell1
      #2 = w_cell2.
    GET PROPERTY OF h_cell 'Font' = gs_font .
    SET PROPERTY OF gs_font 'Bold' = 1 .
    GET PROPERTY OF h_cell 'Interior' = e_color.
    SET PROPERTY OF e_color 'ColorIndex' = 45.
    CALL METHOD cl_gui_frontend_services=>clipboard_export
      IMPORTING
        data                 = it_3[]
      CHANGING
        rc                   = l_rc
      EXCEPTIONS
        cntl_error           = 1
        error_no_gui         = 2
        not_supported_by_gui = 3
        OTHERS               = 4.
    CALL METHOD OF h_excel 'Cells' = w_cell1
      EXPORTING
      #1 = 1
      #2 = 1.
    CALL METHOD OF h_excel 'Cells' = w_cell2
      EXPORTING
      #1 = 1
      #2 = 1.
    CALL METHOD OF h_excel 'Range' = range
      EXPORTING
      #1 = w_cell1
      #2 = w_cell2.
    CALL METHOD OF range 'Select'.
    CALL METHOD OF worksheet 'Paste'.
    *--- disconnect from Excel
    FREE OBJECT h_zl.
    FREE OBJECT h_mapl.
    FREE OBJECT h_map.
    FREE OBJECT h_excel.
    Thanks,
    Krishna..

  • Download  to multiple sheet excel in the background

    Hi,
    I am trying to download data into multiple excel sheets in the background. I was able to create comma delimited csv file in the server, which can be opened as excel file. This is good when it does not have more that one worksheets.
    I have three internal table and to send these internal tables in different worksheets in the same excel file.
    Is it possible to have multiple sheets excel file from the csv file?
    Thanks,
    Lokman

    Hi Lokman,
    <b>1</b>.
    Yes it is Possible.
    <b>2</b>.
    Am sending one example program .That is clear to understand .
    REPORT zvenkat_head MESSAGE-ID zvenkat .
    INCLUDE ole2incl. " Include for OLE object
    DATA: application TYPE ole2_object,
          workbook    TYPE ole2_object,
          sheet       TYPE ole2_object,
          cells       TYPE ole2_object,
          h_f         TYPE ole2_object.            " font
    *Structure for users deleted
    DATA:   BEGIN OF itab_yb001_udel OCCURS 0,
              bname     LIKE yb001-bname,
              name_text LIKE addr3_val-name_text,
            END OF itab_yb001_udel.
    DATA:   BEGIN OF itab_yb001_tadd OCCURS 0.
            INCLUDE STRUCTURE yb001.
    DATA:   name_text LIKE addr3_val-name_text,
            ttext LIKE tstct-ttext.
    DATA:   END OF itab_yb001_tadd.
    *Structure for Transactions deleted
    DATA:   BEGIN OF itab_yb001_tdel OCCURS 0.
            INCLUDE STRUCTURE yb001.
    DATA:   name_text LIKE addr3_val-name_text,
            ttext LIKE tstct-ttext.
    DATA:   END OF itab_yb001_tdel.
    DATA:   BEGIN OF itab_yb001_uadd OCCURS 0,
            bname LIKE yb001-bname,
            name_text LIKE addr3_val-name_text,
            END OF itab_yb001_uadd.
    PARAMETERS: p_fname LIKE rlgrap-filename. " File name to download
    PERFORM download_file.
    FORM - DOWNLOAD_FILE
    FORM download_file.
      DATA index TYPE i.
      CREATE OBJECT application 'excel.application'.
      SET PROPERTY OF application 'visible' = 0.
      CALL METHOD OF application 'Workbooks' = workbook.
      CALL METHOD OF workbook 'Add'.
      CALL METHOD OF application 'Worksheets' = sheet.
      CALL METHOD OF sheet 'Add'.
    Create 1 Excel sheet
      CALL METHOD OF application 'Worksheets' = sheet
        EXPORTING #1 = 1.
      SET PROPERTY OF sheet 'Name' = 'Transactions Added'.
      CALL METHOD OF sheet 'Activate'.
      PERFORM f_xl_theader.
    tell user what is going on
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
        EXPORTING
          text   = text-m03
        EXCEPTIONS
          OTHERS = 1.
      LOOP AT itab_yb001_tadd.
        index = sy-tabix + 1. " 1 - column name
        PERFORM fill_cell USING index 1 0 itab_yb001_tadd-bname.
        PERFORM fill_cell USING index 2 0 itab_yb001_tadd-tcode.
        PERFORM fill_cell USING index 3 0 itab_yb001_tadd-name_text.
        PERFORM fill_cell USING index 4 0 itab_yb001_tadd-ttext.
        PERFORM fill_cell USING index 5 0 itab_yb001_tadd-agr_name.
      ENDLOOP.
    tell user what is going on
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
        EXPORTING
          text   = text-m03
        EXCEPTIONS
          OTHERS = 1.
    Create 2 Excel sheet
      CALL METHOD OF application 'Worksheets' = sheet
        EXPORTING #1 = 2.
      SET PROPERTY OF sheet 'Name' = 'Transactions Deleted'.
      CALL METHOD OF sheet 'Activate'.
      PERFORM f_xl_theader.
      LOOP AT itab_yb001_tdel.
        index = sy-tabix + 1. " 1 - column name
        PERFORM fill_cell USING index 1 0 itab_yb001_tdel-bname.
        PERFORM fill_cell USING index 2 0 itab_yb001_tdel-tcode.
        PERFORM fill_cell USING index 3 0 itab_yb001_tdel-name_text.
        PERFORM fill_cell USING index 4 0 itab_yb001_tdel-ttext.
        PERFORM fill_cell USING index 5 0 itab_yb001_tdel-agr_name.
      ENDLOOP.
    tell user what is going on
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
        EXPORTING
          text   = text-m04
        EXCEPTIONS
          OTHERS = 1.
    Create 3 Excel Sheet
      CALL METHOD OF application 'Worksheets' = sheet
        EXPORTING #1 = 3.
      CALL METHOD OF sheet 'Activate'.
      SET PROPERTY OF sheet 'Name' = 'Users Added'.
      PERFORM f_xl_uheader.
      LOOP AT itab_yb001_uadd.
        index = sy-tabix + 1. " 1 - column name
        PERFORM fill_cell USING index 1 0 itab_yb001_uadd-bname.
        PERFORM fill_cell USING index 2 0 itab_yb001_uadd-name_text.
      ENDLOOP.
    Create 4 Excel sheet
      CALL METHOD OF application 'Worksheets' = sheet
        EXPORTING #1 = 4.
      SET PROPERTY OF sheet 'Name' = 'Users Deleted'.
      CALL METHOD OF sheet 'Activate'.
      PERFORM f_xl_uheader.
      LOOP AT itab_yb001_udel.
        index = sy-tabix + 1. " 1 - column name
        PERFORM fill_cell USING index 1 0 itab_yb001_udel-bname.
        PERFORM fill_cell USING index 2 0 itab_yb001_udel-name_text.
      ENDLOOP.
    Save excel speadsheet to particular filename
      CALL METHOD OF sheet 'SaveAs'
                      EXPORTING #1 = p_fname     "filename
                                #2 = 1.          "fileFormat
      PERFORM err_hdl.
    Closes excel window, data is lost if not saved
      SET PROPERTY OF application 'visible' = 0.
    Close the file
      CALL METHOD OF workbook 'CLOSE'.
    Quit the file
      CALL METHOD OF application 'QUIT'.
      FREE OBJECT application.
    ENDFORM.                    "DOWNLOAD_FILE
    *&      Form  F_XL_THEADER
          Header for XL sheet
    -->  p1        text
    <--  p2        text
    FORM f_xl_theader .
    output column headings to active Excel sheet
      PERFORM fill_cell USING 1 1 1 text-t01.
      PERFORM fill_cell USING 1 2 1 text-t02.
      PERFORM fill_cell USING 1 3 1 text-t03.
      PERFORM fill_cell USING 1 4 1 text-t04.
      PERFORM fill_cell USING 1 5 1 text-t05.
    ENDFORM.                    " F_XL_THEADER
          FORM FILL_CELL                                                *
          sets cell at coordinates i,j to value val boldtype bold       *
    FORM fill_cell USING i j bold val.
      CALL METHOD OF sheet 'Cells' = cells EXPORTING #1 = i #2 = j.
      PERFORM err_hdl.
      SET PROPERTY OF cells 'Value' = val .
      PERFORM err_hdl.
      GET PROPERTY OF cells 'Font' = h_f.
      PERFORM err_hdl.
      SET PROPERTY OF h_f 'Bold' = bold .
      PERFORM err_hdl.
    ENDFORM.                    "FILL_CELL
          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
          Header for XL sheet
    -->  p1        text
    <--  p2        text
    FORM f_xl_uheader .
      PERFORM fill_cell USING 1 1 1 text-t01.
      PERFORM fill_cell USING 1 2 1 text-t03.
    ENDFORM.                    " F_XL_UHEADER
    Please try to understand first and replicate to ur requirement.
    Please let me know if u have any problem.
    <b>Thanks,
    Venkat.O</b>

  • Download BSP data into Excel

    Hello all,
    I want create a BSP page, with 2 radio buttons,
    If 1st selected I want read 2 tables and display data other BSP page.
    If 2nd one selected I want download 2 tables data into excel file.
    Any one can help how to download data into excel file and display data into other bsp page.
    Thanks,
    Regards,
    Venkat

    For downloading to a spread sheet:
    Convert your fetched data to a string and convert to XSTRING format and finally download to a spread sheet.
    Sample: I selected data from vbak say vbeln and kunnr in an internal table.
    data : v_string type string, v_xstring type xstring.
    <header portion - to have the heading in the spread sheet>
    concatenate 'Order Number' 'Customer'
       cl_abap_char_utilities=>cr_lf into v_string
       separated by cl_abap_char_utilities=>horizontal_tab.
    <Line item entries from my internal table say i_vbak>
    loop at i_vbak into wa_vbak.
      concatenate v_string wa_vbak-vbeln wa_vbak-kunnr
       cl_abap_char_utilities=>cr_lf into v_string
       separated by cl_abap_char_utilities=>horizontal_tab.
    endloop.
    All the data is now in string format. Calling the FM to convert to XSTRING
      call function 'SCMS_STRING_TO_XSTRING'
        exporting
          text     = v_string
          mimetype = 'APPLICATION/MSEXCEL; charset=utf-16le' (probably create this in a variable and call here)
        importing
          buffer   = v_xstring.
    concatenate cl_abap_char_utilities=>byte_order_mark_little v_xstring into v_xstring in byte mode.
    Now we have it in XSTRING format - this can be downloaded to a spread sheet.
    v_appl = 'APPLICATION/MSEXCEL; charset=utf-16le'.
    runtime->server->response->set_header_field( name = 'content-type' value = v_appl ).
    Eliminating the cache problems when loading Excel Format
    runtime->server->response->delete_header_field( name = if_http_header_fields=>cache_control ).
    runtime->server->response->delete_header_field( name = if_http_header_fields=>expires ).
    runtime->server->response->delete_header_field( name = if_http_header_fields=>pragma ).
    Start excel in a separate window
    runtime->server->response->set_header_field( name = 'content-disposition' value = 'attachment; filename=Order_list.xls' ).
    Displaying the data in excel.
    v_len = xstrlen( v_xstring ).
    runtime->server->response->set_data( data = v_xstring length = v_len ).
    navigation->response_complete( ).
    All the above code can be written in onInputprocessing event (probably your loop/selection can be in a method of your appl class).
    I believe you are triggering the event based on a click (say radio button or a button after selecting the radiobutton).
    In the other screen you can use tableview to display your data - probably two sub screens(page fragment) to display each table.
    Regds,
    Krish

  • Some problem of download BSP data into excel using  cl_bsp_utility= download

    Hello Experts,
    I have read the blog of thomas.jung for download bsp data into excel, and it's working correct, and after some try and error, now I can download the excel with multi sheets.It's all cool except one thing.....when I add a button on the standard screen of the supplier qualification of the slc to download the excel file, after the popinp up screen, the standard screen can't do any operation at all......there are no any error message and the downloaded file is all correct .
    Does any one know what can I do?

    any ideas?
    By the way, after some research, maybe the issue was caused by the setup of the button, but I don't know how to fix it...0rz
    the standard code for buttton is
    lv_id = mv_id && '>display'.
    lo_edit_display_button = cl_thtmlb_button=>factory( id       = lv_id
                                                       text     = lv_button_text
                                                   tooltip  = lv_button_text
                                                   enabled  = 'TRUE'
                                                  onclick  = lv_button_action ).
    WHILE io_page_context->element_process( element = lo_edit_display_button ) = if_bsp_element=>co_element_continue.
    ENDWHILE.
    so I copy it and modify like this:
    lv_id = mv_id && '>download'.
        lo_download_excel_button = cl_thtmlb_button=>factory( id       = lv_id
                                                            text     = w_text
                                                        tooltip  = w_text
                                                        enabled  = 'TRUE'
        onclick  = /srmsm/if_ql_ext_ui_c=>ZC_ACTION_DOWNLOAD_EXCEL
    WHILE io_page_context->element_process( element = lo_download_excel_button ) = if_bsp_element=>co_element_continue.
    ENDWHILE.

  • Error editing task sequence: Failed to load dynamic properties for class "SMS_TaskSequence_ApplyWindowsSettingsAction" From XML into WMI

    I've started getting an intermittent error editing my Windows 7 OSD task sequence.  Sometimes I can open the TS to edit, but when I try to apply changes I get the error.  Other times I get the error when trying to open the TS.  If I try again
    right away, I still get the error, but if I wait a few minutes and try again sometimes it will open the TS. 
    The error reads:
    ConfigMgr Error Object:instance of SMS_Extended Status{Description = "Failed to load dynamic properties for class \"SMS_TaskSequence_ApplyWindowsSettingsAction\" from XML into WMI";Error Code = 2147943746;File = "e:\\qfe\\nts\\sms\\siteserver\\sdk_provider\\smsprov\\ssptspackage.cpp";Line = 3454;Operation = "ExecMethod";ParameterInfo = "SMS_TaskSequencePackage";ProviderName = "WinMgmt";StatusCode = 2147749889;}
    Coinciding with this error, I show the following entries in the TaskSequenceProvider.log file: 
    [PID: 7608] Invoking method SMS_TaskSequence.LoadFromXml
    TaskSequenceProvider
    Failed to protect memory buffer, hr=0x80070542
    TaskSequenceProvider
    Failed to load dynamic properties for class "SMS_TaskSequence_ApplyWindowsSettingsAction" from XML into WMI 0x80070542 (2147943746)
    TaskSequenceProvider
    Failed to load node Apply Windows Settings from XML into WMI 0x80070542 (2147943746)
    TaskSequenceProvider
    Failed to load children steps for node "PostInstall" from XML 0x80070542 (2147943746)
    TaskSequenceProvider
    Failed to load children steps for node "Execute Task Sequence" from XML 0x80070542 (2147943746)
    TaskSequenceProvider
    Failed to load children steps for node "" from XML 0x80070542 (2147943746)
    TaskSequenceProvider
    Failed to load XML for the task sequence into WMI 0x80070542 (2147943746)
    TaskSequenceProvider
    [PID: 7608] Done with method SMS_TaskSequence.LoadFromXml
    TaskSequenceProvider
    Setting status complete:  status code = 0x80070542; Failed to load dynamic properties for class "SMS_TaskSequence_ApplyWindowsSettingsAction" from XML into WMI
    TaskSequenceProvider
    I exported the task sequence and checked in "object.xml" for the "ApplyWindowsSettingsAction", to see if there was something odd in the xml, but I don't find anything that jumps out as being wrong.  Here's the section of XML for
    that step.  I've removed identifying info, and replaced it with a generic term in bold.
    <step type="SMS_TaskSequence_ApplyWindowsSettingsAction" name="Apply Windows Settings" description="" runIn="WinPE" successCodeList="0" runFromNet="false"><action>osdwinsettings.exe /config</action><defaultVarList><variable name="OSDLocalAdminPassword" property="AdminPassword"></variable><variable name="OSDComputerName" property="ComputerName">%_SMSTSMachineName%</variable><variable name="OSDProductKey" property="ProductKey"></variable><variable name="OSDRandomAdminPassword" property="RandomAdminPassword">false</variable><variable name="OSDRegisteredOrgName" property="RegisteredOrgName">COMPANY NAME</variable><variable name="OSDRegisteredUserName" property="RegisteredUserName">COMPANY NAME</variable><variable name="OSDServerLicenseConnectionLimit" property="ServerLicenseConnectionLimit">5</variable><variable name="OSDTimeZone" property="TimeZone">Central Standard Time</variable></defaultVarList></step><step type="SMS_TaskSequence_ApplyNetworkSettingsAction" name="Apply Network Settings" description="" runIn="WinPEandFullOS" successCodeList="0" runFromNet="false"><action>osdnetsettings.exe configure</action><defaultVarList><variable name="OSDDomainName" property="DomainName">DOMAIN.COM</variable><variable name="OSDJoinPassword" property="DomainPassword"></variable><variable name="OSDJoinAccount" property="DomainUsername">DOMAIN ACCOUNT</variable><variable name="OSDEnableTCPIPFiltering" property="EnableTCPIPFiltering" hidden="true">false</variable><variable name="OSDNetworkJoinType" property="NetworkJoinType">0</variable><variable name="OSDAdapterCount" property="NumAdapters" hidden="true">0</variable></defaultVarList></step>
    Is there any other log I should check for a clue on this issue?  What could be causing this error?

    Thanks for sharing that!  I tend to save contacting MS support until after I've exhausted other options.  I'm always afraid that I'll spend the $500 to open a case and then it turns out to be something simple that I would have found if I had just
    kept working on it myself a little longer.
    It looks like that link is for an update released in February as KB3023562.  I downloaded and installed it. I'll try opening/editing/saving the task sequence a few times today to see if the issue is resolved.  
    After I had already installed it, I thought to look up that update in configmgr.  The update is listed as superseded by 2 other updates.  The newest of those is KB3046049, which just installed last night with the other March patches, so it's possible
    that I didn't need to install KB3023562 after all.  

  • Re: Downloading BSP Code to PC for backup

    Hi,
    Is there any method or code to download BSP code to local PC? I found a link named SAPLINK but not sure how to use this.
    Please help me.
    Regards,
    Anshuman

    Hi,
    ABAP prog for downloading BSP application to PC:
    Selection Text:
    CHK_ATTR Attributes
    CHK_BSP DownLoad BSP
    CHK_CLS DownLoad Class
    CHK_CONT Controllers
    CHK_EVTS Events
    CHK_FRAG Page Fragments
    CHK_METH Methods
    CHK_PGFL Page with Flow Logic
    CHK_TYPE Types
    CHK_VIEW Views
    P_DIRCLS Folder Name
    P_DIRNAM Folder Name
    R_ALL All Components
    R_BSPALL All Components
    R_BSPPAR Partial Components
    R_PAR Partial Components
    S_BSPAPP BSP Application/s
    S_CLSNAM Class Name/s
    *& Report Z_UMA_BSP_DOWNLOAD
    report z_uma_bsp_download message-id zmsgcls line-size 180.
    * TABLES
    tables: seoclass,
    o2appl,
    o2pagcon.
    * TYPE-POOLS
    type-pools: seoo,seos,seor,seof,seot,seok,seop.
    * TYPE DEFINITIONS
    types: begin of t_class,
    clsname type seoclass-clsname, "Class Name
    descrip type seoclasstx-descript, "Class Description
    end of t_class.
    types: begin of t_component,
    clsname type seoclsname,
    cmpname type seocmpname,
    cmptype type seocmptype,
    mtdtype type seomtdtype,
    descrip type seodescr,
    end of t_component.
    types: begin of t_format,
    cmpname(30),
    decltyp(20),
    exposur(15),
    typtype(15),
    type(110),
    attval(110),
    desc(100),
    end of t_format.
    types: begin of t_format1,
    pad(4),
    sconame(30),
    decl(10),
    pass(20),
    optn(10),
    typtype(15),
    type(100),
    valu(100),
    desc(100),
    end of t_format1.
    types: begin of t_format2,
    pad(4),
    sconame(30),
    desc(100),
    end of t_format2.
    types: begin of t_mtd_compo,
    clsname type seoclsname,
    cmpname type seocmpname,
    sconame type seosconame,
    scotype type seoscotype,
    descrip type seodescr,
    end of t_mtd_compo.
    types: begin of t_bspappl,
    applname type o2applname,
    applclas type o2applclas,
    startpage type o2pageext,
    stateful type o2stateful,
    descrip type o2descr,
    end of t_bspappl.
    types: begin of t_pagdetl,
    applname type o2applname,
    pagekey type o2page,
    pagename type o2pageext,
    implclass type o2ctrcls,
    pagetype type o2pagtyp,
    controllerurl type o2pageext,
    lifetime type o2lifetime,
    state type o2pagstate,
    is_error_page type o2errpag,
    error_page type o2pageext,
    browser_cache type o2bcache,
    server_cache type o2scache,
    author type cnam,
    createdon type rdir_cdate,
    changedby type unam,
    changedon type rdir_udate,
    end of t_pagdetl.
    types: begin of t_pagcon,
    applname type o2applname,
    pagekey type o2page,
    objtype type o2objtype,
    version type r3state,
    end of t_pagcon.
    types: begin of t_pagedata,
    content type o2pageline_table,
    ev_handler type o2pagevh_tabletype,
    parameters type o2pagpar_tabletype,
    typesource type rswsourcet,
    xml_source type xstring,
    otr_guids type bsp_guids,
    html_pool type string,
    end of t_pagedata.
    types : begin of t_scr_out,
    appname type string,
    component type string,
    path type string,
    status type string ,
    etype type c,
    end of t_scr_out.
    * DATA DECLARATIONS
    data: v_langu type sy-langu,
    v_filename type string,
    x_format type t_format,
    x_format1 type t_format1,
    x_format2 type t_format2,
    v_lines type i,
    x_mtdkey type seocpdkey,
    x_transport type trkey,
    v_sourcename type programm,
    v_repid type sy-repid,
    v_dynnr type sy-dynnr,
    v_uzeit type sy-uzeit,
    v_filestr type string,
    v_datum type sy-datum,
    r_temp_all type c,
    v_cnt_cls type string.
    INTERNAL TABLE DECLARTIONS
    data: it_class type standard table of t_class with header line,
    it_compo type standard table of t_component with header line,
    it_mtd_compo type standard table of t_mtd_compo with header line,
    it_attributes type seoo_attributes_r,
    it_methods type seoo_methods_r,
    it_events type seoo_events_r,
    it_types type seoo_types_r,
    it_parameters type seos_parameters_r,
    it_exceps type seos_exceptions_r,
    it_implementings type seor_implementings_r,
    it_redefinitions type seor_redefinitions_r,
    it_friendships type seof_friendships_r,
    it_typepusages type seot_typepusages_r,
    it_clsdeferrds type seot_clsdeferrds_r,
    it_intdeferrds type seot_intdeferrds_r,
    it_explore_inheritance type seok_cls_typeinfos,
    it_explore_implementings type seok_int_typeinfos,
    it_aliases type seoo_aliases_r,
    it_bspappl type standard table of t_bspappl with header line,
    it_pagdetl type standard table of t_pagdetl with header line,
    it_pagcon type standard table of t_pagcon with header line,
    it_source type t_pagedata,
    it_scr_out type standard table of t_scr_out with header line,
    it_data(400) occurs 0 with header line,
    wa_source type line of o2pageline_table,
    wa_pagecon_key type o2pconkey.
    * CONSTANTS DECLARATIONS
    constants: gc_cmp_attr type n value 0, "COMPONENT ATTRIBUTE
    gc_cmp_meth type n value 1, "COMPONENT METHOD
    gc_cmp_evnt type n value 2, "COMPONENT EVENT
    gc_cmp_type type n value 3, "COMPONENT TYPE
    gc_mtd_meth type n value 0, "METHOD METHOD
    gc_mtd_evnt type n value 1, "METHOD EVENT
    gc_mtd_cons type n value 2, "METHOD CONSTRUCTOR
    gc_mtd_dest type n value 3, "METHOD DESTRUCTOR
    gc_mtd_getm type n value 4, "METHOD GET
    gc_mtd_setm type n value 5, "METHOD SET
    gc_sco_para type n value 0, "SCOPE PARAMETER
    gc_sco_excp type n value 1, "SCOPE EXCEPTION
    gc_exp_priv type n value 0, "EXPOSURE PRIVATE
    gc_exp_prot type n value 1, "EXPOSURE PROTECTED
    gc_exp_publ type n value 2, "EXPOSURE PUBLIC
    gc_typ_like type n value 0, "TYPE LIKE
    gc_typ_type type n value 1, "TYPE TYPE
    gc_typ_otyp type n value 2, "TYPE OBJECT TYPE
    gc_typ_tref type n value 3, "TYPE TYPE REF TO
    gc_atr_inst type n value 0, "ATTRIBUTE INSTANCE
    gc_atr_stat type n value 1, "ATTRIBUTE STATIC
    gc_atr_cnst type n value 2, "ATTRIBUTE CONSTANT
    gc_par_impo type n value 0, "PARAMETER IMPORTING
    gc_par_expo type n value 1, "PARAMETER EXPORTING
    gc_par_chng type n value 2, "PARAMETER CHANGING
    gc_par_retn type n value 3, "PARAMETER RETURNING
    gc_pas_valu type n value 0, "PARAMETER PASS BY VALUE
    gc_pas_refr type n value 1, "PARAMETER CALL BY REFERENCE
    gc_yes type c value 'X',
    gc_no type c value space,
    gc_tab(8) type c value ' ',
    gc_bsp_ctrl type o2pagtyp value 'C',
    gc_bsp_pgfr type o2pagtyp value 'X',
    gc_bsp_pgfl type o2pagtyp value space,
    gc_bsp_view type o2pagtyp value 'V',
    gc_lft_upgc type c value space,
    gc_lft_requ type c value '1',
    gc_lft_sess type c value '2'.
    * SELECTION SCREENS
    *Selection Screen for the Options
    selection-screen : begin of block b_main with frame title text-009.
    parameters : chk_bsp as checkbox user-command ucom,
    chk_cls as checkbox user-command ucom1.
    selection-screen : end of block b_main.
    *Selection Screen for the BSP Application
    selection-screen : begin of block b_bsp1 with frame title text-005.
    selection-screen : begin of block b_bsp2 with frame title text-006.
    select-options : s_bspapp for o2appl-applname no intervals modif id bsp.
    parameters : p_dirnam type rlgrap-filename default 'C:\' modif id bsp.
    selection-screen : end of block b_bsp2.
    selection-screen : begin of block b_bsp3 with frame title text-007.
    parameters : r_bspall radiobutton group rad1 user-command u1 modif id bsp default 'X',
    r_bsppar radiobutton group rad1 modif id bsp.
    selection-screen : begin of block b_bsp4 with frame title text-008.
    parameters : chk_cont as checkbox modif id bs1,
    chk_view as checkbox modif id bs1,
    chk_pgfl as checkbox modif id bs1,
    chk_frag as checkbox modif id bs1.
    selection-screen : end of block b_bsp4.
    selection-screen : end of block b_bsp3.
    selection-screen : end of block b_bsp1.
    *Selection Screen for Class Download
    selection-screen : begin of block b1 with frame title text-001.
    selection-screen : begin of block b2 with frame title text-002.
    select-options : s_clsnam for seoclass-clsname no intervals modif id cls.
    parameters : p_dircls like rlgrap-filename default 'C:\' modif id cls.
    selection-screen : end of block b2.
    selection-screen : begin of block b3 with frame title text-003.
    parameters : r_all radiobutton group rbsp user-command u2 modif id cls default 'X',
    r_par radiobutton group rbsp modif id cls.
    selection-screen : begin of block b4 with frame title text-004.
    parameters : chk_attr as checkbox modif id cl1,
    chk_meth as checkbox modif id cl1,
    chk_evts as checkbox modif id cl1,
    chk_type as checkbox modif id cl1.
    selection-screen : end of block b4.
    selection-screen : end of block b3.
    selection-screen : end of block b1.
    * INTIALIZATION
    initialization.
    v_repid = sy-repid.
    v_dynnr = sy-dynnr.
    v_langu = sy-langu.
    * AT SELECTION-SCREEN OUTPUT
    at selection-screen output.
    loop at screen.
    if chk_bsp = 'X'.
    if screen-group1 = 'BSP' or screen-group1 = 'BS1'.
    screen-active = 1.
    endif.
    else.
    if screen-group1 = 'BSP' or screen-group1 = 'BS1' .
    screen-active = 0.
    endif.
    endif.
    if r_bspall = 'X'.
    if screen-group1 = 'BS1'.
    screen-active = 0.
    endif.
    else.
    if screen-group1 = 'BS1'.
    screen-active = 1.
    endif.
    endif.
    modify screen.
    endloop.
    loop at screen.
    if chk_cls = 'X'.
    if screen-group1 = 'CLS' or screen-group1 = 'cl1'.
    screen-active = 1.
    endif.
    else.
    if screen-group1 = 'CLS' or screen-group1 = 'cl1'.
    screen-active = 0.
    endif.
    endif.
    if r_all = 'X'.
    if screen-group1 = 'CL1'.
    screen-active = 0.
    endif.
    else.
    if screen-group1 = 'CL1'.
    screen-active = 1.
    endif.
    endif.
    modify screen.
    endloop.
    * AT SELECTION-SCREEN
    at selection-screen.
    * START OF SELECTION
    start-of-selection.
    * If the user selected BSP check box then we need to do down load the BSP application
    if chk_cls is initial and
    chk_bsp is initial.
    message i001 with 'Select any download option'(007).
    exit.
    endif.
    if chk_bsp = 'X'.
    refresh it_bspappl.
    clear it_bspappl.
    if s_bspapp is initial.
    set pf-status'AA'.
    message i002 with 'Enter BSP Application Names'(010).
    exit.
    endif.
    * Check the directory name is entered or not
    if p_dirnam is initial.
    message i004 with 'Enter Directory name for BSP Download'(012).
    exit.
    else.
    if r_bspall = 'X'.
    clear : chk_cont,chk_view,chk_pgfl,chk_frag.
    endif.
    select a~applname
    a~applclas
    a~startpage
    a~stateful
    b~text into table it_bspappl
    from o2appl as a inner join o2applt as b
    on a~applname = b~applname
    where a~applname in s_bspapp and
    a~version = 'A' and
    b~langu = v_langu.
    * Check we got any entries in the class internal table
    clear v_lines.
    describe table it_bspappl lines v_lines.
    if v_lines > 0.
    loop at it_bspappl.
    perform save_bspappl_details using it_bspappl.
    perform get_bspappl_compo using it_bspappl.
    endloop.
    else.
    write:/ 'Enter Valid BSP Application Names'.
    endif.
    endif.
    endif.
    * If the user selected class check box then we need to do down load the class
    if chk_cls = 'X'.
    refresh it_class.
    clear it_class.
    clear r_temp_all.
    * Check Class name is empty or not
    if s_clsnam is initial.
    message i003 with 'Enter Class Names'(011).
    exit.
    endif.
    * Check the directory name is entered or not
    if p_dircls is initial.
    message i000 with 'Enter Directory name for Class Download'(008).
    exit.
    else.
    * if user selected All Components in Class Down Load
    * then clear all the check box variables
    move r_all to r_temp_all.
    if r_temp_all = 'X'.
    clear: chk_attr,chk_meth,chk_evts,chk_type.
    endif.
    * get the class name and Class Description from the table SEOCLASS
    * for all the classes which user entered in selection screen based on
    * the system language
    select a~clsname b~descript into table it_class
    from seoclass as a left outer join seoclasstx as b
    on a~clsname = b~clsname and
    b~langu = v_langu
    where a~clsname in s_clsnam.
    * Check we got any entries in the class internal table
    clear v_lines.
    describe table it_class lines v_lines.
    * if you got any enties in class interbnal table then we need to
    * get the other details about that class
    if v_lines > 0.
    perform add_slash_4dir changing p_dircls.
    perform check_dir_exists using p_dircls.
    loop at it_class.
    perform get_class_details using it_class-clsname 'X' ' '.
    endloop.
    else.
    write:/ 'PLEASE ENTER VALID CLASS NAMES'.
    endif.
    endif.
    endif.
    * END OF SELECTION
    end-of-selection.
    write: /1(25) 'Application Name',
    26(25) 'Component Name',
    52(50) 'Download Path',
    102(50) 'ErrorSuccess Message'.
    write:/ sy-uline.
    loop at it_scr_out.
    write:/1(25) it_scr_out-appname,
    26(25) it_scr_out-component,
    52(50) it_scr_out-path,
    102(50) it_scr_out-status.
    endloop.
    *& Form GET_CLASS_DETAILS
    * used to get the other details of the class
    form get_class_details using p_clsname p_check p_filename.
    * Data Declarations
    data: x_class type vseoclass,
    x_inheritance type vseoextend,
    x_seoclskey type seoclskey,
    x_attributes type line of seoo_attributes_r,
    x_methods type line of seoo_methods_r,
    x_events type line of seoo_events_r,
    x_types type line of seoo_types_r,
    x_parameters type line of seos_parameters_r,
    x_exceps type line of seos_exceptions_r,
    x_implementings type line of seor_implementings_r,
    x_redefinitions type line of seor_redefinitions_r,
    x_friendships type line of seof_friendships_r,
    x_typepusages type line of seot_typepusages_r,
    x_clsdeferrds type line of seot_clsdeferrds_r,
    x_intdeferrds type line of seot_intdeferrds_r,
    x_explore_inheritance type line of seok_cls_typeinfos,
    x_explore_implementings type line of seok_int_typeinfos,
    x_aliases type line of seoo_aliases_r.
    * REFRESH & CLEAR ALL THE VARIABLES.
    refresh: it_attributes,it_methods,it_events,it_types,it_parameters,
    it_exceps,it_implementings,it_redefinitions,it_friendships,
    it_typepusages,it_clsdeferrds,it_intdeferrds,it_data,
    it_explore_inheritance,it_explore_implementings,it_aliases.
    clear : it_attributes,it_methods,it_events,it_types,it_parameters,
    it_exceps,it_implementings,it_redefinitions,it_friendships,
    it_typepusages,it_clsdeferrds,it_intdeferrds,it_data,
    it_explore_inheritance,it_explore_implementings,it_aliases.
    clear : x_attributes,x_methods,x_events,x_types,x_parameters,
    x_exceps,x_implementings,x_redefinitions,x_friendships,
    x_typepusages,x_clsdeferrds,x_intdeferrds,
    x_explore_inheritance,x_explore_implementings,x_aliases,
    x_class,x_inheritance,x_seoclskey.
    * SET THE CLASS NAME TO THE STRUCTURE
    x_seoclskey-clsname = p_clsname.
    call function 'SEO_CLASS_TYPEINFO_GET'
    exporting
    clskey = x_seoclskey
    importing
    class = x_class
    attributes = it_attributes
    methods = it_methods
    events = it_events
    types = it_types
    parameters = it_parameters
    exceps = it_exceps
    implementings = it_implementings
    inheritance = x_inheritance
    redefinitions = it_redefinitions
    friendships = it_friendships
    typepusages = it_typepusages
    clsdeferrds = it_clsdeferrds
    intdeferrds = it_intdeferrds
    explore_inheritance = it_explore_inheritance
    explore_implementings = it_explore_implementings
    aliases = it_aliases
    exceptions
    not_existing = 1
    is_interface = 2
    model_only = 3
    others = 4.
    if sy-subrc <> 0.
    it_scr_out-component = p_clsname.
    it_scr_out-status = 'ERROR'.
    it_scr_out-etype = 'E'.
    append it_scr_out.
    clear it_scr_out.
    else.
    * DOWNLOAD CLASS INFORMATION
    perform download_class_info using x_class.
    * DOWNLOAD INHERITANCE INFORMATION
    perform download_class_inht using x_inheritance.
    * DOWNLOAD CLASS IMPLEMENTATION
    perform download_class_otherdetails using p_clsname seop_ext_class_locals_imp.
    * DOWNLOAD CLASS TYPES
    perform download_class_otherdetails using p_clsname seop_ext_class_locals_def.
    DOWNLOAD CLASS MACROS
    perform download_class_otherdetails using p_clsname seop_ext_class_macros.
    DOWNLOAD CLASS ATTRIBUTES
    if r_temp_all = 'X' or chk_attr = 'X'.
    perform download_class_attr tables it_attributes.
    endif.
    DOWNLOAD CLASS METHODS
    if r_temp_all = 'X' or chk_meth = 'X'.
    perform download_class_meth tables it_methods
    it_parameters
    it_exceps.
    endif.
    Interface Implementations.
    perform download_class_implementation tables it_explore_implementings.
    DOWNLOAD CLASS EVENTS.
    if r_temp_all = 'X' or chk_evts = 'X'.
    perform download_class_evts.
    endif.
    * DOWNLOAD CLASS TYPE GROUPS.
    perform download_class_type_groups.
    * DOWNLOAD INTERNAL TYPES
    if r_temp_all = 'X' or chk_type = 'X'.
    perform download_class_internal_types.
    endif.
    if p_check = 'X'.
    * DOWNLOAD CLASS DEFINITION
    perform download_classdef using p_filename.
    else.
    * while downloading the bsp we need to pass the directory and
    * class name to the function module so the file will create
    perform download_class using p_check.
    endif.
    endif.
    endform. " GET_CLASS_DETAILS
    *& Form DOWNLOAD_CLASS_INFO
    * used to download the class information
    form download_class_info using p_x_class structure vseoclass.
    it_data = p_x_class-clsname.
    append it_data.
    clear it_data.
    it_data = p_x_class-descript.
    append it_data.
    clear it_data.
    endform. " DOWNLOAD_CLASS_INFO
    *& Form DOWNLOAD_CLASS_INHT
    * used to download the inheritance
    form download_class_inht using p_x_inheritance structure vseoextend.
    if not p_x_inheritance-refclsname is initial.
    concatenate 'INHERITED FROM: ' p_x_inheritance-refclsname into it_data.
    append it_data.
    clear it_data.
    endif.
    endform. " DOWNLOAD_CLASS_INHT
    *& Form DOWNLOAD_CLASS_ATTR
    * text
    form download_class_attr tables p_it_attr type seoo_attributes_r.
    data: x_attributes type line of seoo_attributes_r.
    it_data = '*********************************************************'.
    append it_data.
    clear it_data.
    it_data = 'ATTRIBUTES'.
    append it_data.
    clear it_data.
    it_data = '-----------'.
    append it_data.
    clear it_data.
    loop at p_it_attr into x_attributes.
    clear x_format.
    * ATTRIBUTE NAME
    x_format-cmpname = x_attributes-cmpname.
    * ATTRIBUTE DECLARATION LEVEL
    case x_attributes-attdecltyp.
    when gc_atr_inst.
    x_format-decltyp = 'INSTANCE ATTRIBUTE'.
    when gc_atr_stat.
    x_format-decltyp = 'STATIC ATTRIBUTE'.
    when gc_atr_cnst.
    x_format-decltyp = 'CONSTANT ATTRIBUTE'.
    endcase.
    * ATTRIBUTE EXPOSURE
    case x_attributes-exposure.
    when gc_exp_priv.
    x_format-exposur = 'PRIVATE'.
    when gc_exp_publ.
    x_format-exposur = 'PUBLIC'.
    when gc_exp_prot.
    x_format-exposur = 'PROTECTED'.
    endcase.
    * ATTRIBUTE TYPTYPE
    case x_attributes-typtype.
    when gc_typ_like.
    x_format-typtype = 'LIKE'.
    when gc_typ_type.
    x_format-typtype = 'TYPE'.
    when gc_typ_otyp.
    x_format-typtype = 'OBJECT TYPE'.
    when gc_typ_tref.
    x_format-typtype = 'TYPE REF TO'.
    endcase.
    * ATTRIBUTE REFERNCE TYPE
    x_format-type = x_attributes-type.
    * ATTRIBUTE INITIAL VALUE
    x_format-attval = x_attributes-attvalue.
    * ATTRIBUTE DESCRIPTION
    x_format-desc = x_attributes-descript.
    move x_format to it_data.
    append it_data.
    clear it_data.
    endloop.
    it_data = '*********************************************************'.
    append it_data.
    clear it_data.
    endform. " DOWNLOAD_CLASS_ATTR
    *& Form DOWNLOAD_CLASS_METH
    * used to download the methods of the class
    form download_class_meth tables p_it_meth type seoo_methods_r
    p_it_parm type seos_parameters_r
    p_it_excp type seos_exceptions_r.
    data: x_methods type line of seoo_methods_r,
    x_params type line of seos_parameters_r,
    x_exceps type line of seos_exceptions_r.
    clear: x_methods,x_params,x_exceps.
    it_data = 'METHODS'.
    append it_data.
    clear it_data.
    it_data = '-------'.
    append it_data.
    clear it_data.
    loop at p_it_meth into x_methods.
    clear: x_format.
    * METHOD NAME
    x_format-cmpname = x_methods-cmpname.
    * METHOD DECLARATION TYPE
    case x_methods-mtddecltyp.
    when gc_atr_inst.
    x_format-decltyp = 'INSTANCE METHOD'.
    when gc_atr_stat.
    x_format-decltyp = 'STATIC METHOD'.
    endcase.
    * METHOD EXPOSURE
    case x_methods-exposure.
    when gc_exp_priv.
    x_format-exposur = 'PRIVATE'.
    when gc_exp_publ.
    x_format-exposur = 'PUBLIC'.
    when gc_exp_prot.
    x_format-exposur = 'PROTECTED'.
    endcase.
    * METHOD DESCRIPTION.
    x_format-desc = x_methods-descript.
    move x_format to it_data.
    append it_data.
    clear it_data.
    * DOWNLOAD METHOD PARAMETERS
    perform download_method_params tables it_parameters
    using x_methods-cmpname.
    * DOWNLOAD METHOD EXCEPTIONS
    perform download_method_exceps tables it_exceps
    using x_methods-cmpname.
    * DOWNLOAD METHOD SOURCE
    perform download_method_source using it_class-clsname
    x_methods-cmpname.
    endloop.
    * DOWNLOAD RE-DEFINED METHODS IF ANY
    perform download_redef_methods.
    endform. " DOWNLOAD_CLASS_METH
    *& Form DOWNLOAD_METHOD_PARAMS
    * used to download the method parameters
    form download_method_params tables p_it_params type seos_parameters_r
    using p_cmpname.
    data: x_parameters type line of seos_parameters_r.
    clear: x_parameters.
    it_data = '^^^^PARAMETERS'.
    append it_data.
    clear it_data.
    loop at p_it_params into x_parameters where cmpname = p_cmpname.
    clear: x_format1.
    * METHOD PARAMETER NAME
    x_format1-sconame = x_parameters-sconame.
    * METHOD PARAMETER DECLARATION TYPE
    case x_parameters-pardecltyp.
    when gc_par_impo.
    x_format1-decl = 'IMPORTING'.
    when gc_par_expo.
    x_format1-decl = 'EXPORTING'.
    when gc_par_chng.
    x_format1-decl = 'CHANGING'.
    when gc_par_retn.
    x_format1-decl = 'RETURNING'.
    endcase.
    * METHOD PARAMETERS PASSING TYOE
    case x_parameters-parpasstyp.
    when gc_pas_valu.
    x_format1-pass = 'PASS BY VALUE'.
    when gc_pas_refr.
    x_format1-pass = 'PASS BY REFERENCE'.
    endcase.
    * METHOD PARAMETER TYPTYPE
    case x_parameters-typtype.
    when gc_typ_like.
    x_format1-typtype = 'LIKE'.
    when gc_typ_type.
    x_format1-typtype = 'TYPE'.
    when gc_typ_otyp.
    x_format1-typtype = 'OBJECT TYPE'.
    when gc_typ_tref.
    x_format1-typtype = 'TYPE REF TO'.
    endcase.
    * METHOD PARAMETER OPTIONAL/MANDATORY
    case x_parameters-paroptionl.
    when gc_yes.
    x_format1-optn = 'OPTIONAL'.
    when gc_no.
    x_format1-optn = 'MANDATORY'.
    endcase.
    * METHOD PARAMETER TYPE
    x_format1-type = x_parameters-type.
    * METHOD PARAMETER INITIAL VALUE
    x_format1-valu = x_parameters-parvalue.
    * METHOD PARAMETER DESCRIPTION
    x_format1-desc = x_parameters-descript.
    move x_format1 to it_data.
    append it_data.
    clear it_data.
    endloop.
    endform. " DOWNLOAD_METHOD_PARAMS
    *& Form DOWNLOAD_METHOD_EXCEPS
    * used to download the Exceptions of methods
    form download_method_exceps tables p_it_exceps type seos_exceptions_r
    using p_cmpname.
    data: x_exceps type line of seos_exceptions_r.
    clear: x_exceps.
    it_data = '^^^^EXCEPTION'.
    append it_data.
    loop at p_it_exceps into x_exceps where cmpname = p_cmpname.
    clear x_format2.
    * METHOD EXCEPTION NAME
    x_format2-sconame = x_exceps-sconame.
    * METHOD EXCEPTION DESCRIPTION
    x_format2-desc = x_exceps-descript.
    move x_format2 to it_data.
    append it_data.
    clear it_data.
    endloop.
    endform. " DOWNLOAD_METHOD_EXCEPS
    *& Form DOWNLOAD_METHOD_SOURCE
    * text
    form download_method_source using p_clsname
    p_cmpname.
    data : x_mtdkey type seocpdkey,
    x_source type line of seop_source,
    it_source type seop_source.
    refresh: it_source.
    clear : it_source,x_source,x_mtdkey.
    x_mtdkey-clsname = p_clsname.
    x_mtdkey-cpdname = p_cmpname.
    call function 'SEO_METHOD_GET_SOURCE'
    exporting
    mtdkey = x_mtdkey
    importing
    source = it_source
    exceptions
    _internal_method_not_existing = 1
    _internal_class_not_existing = 2
    others = 3.
    if sy-subrc <> 0.
    it_scr_out-component = p_cmpname.
    it_scr_out-status = ' FAILED '.
    it_scr_out-etype = 'E'.
    append it_scr_out.
    clear it_scr_out.
    else.
    it_data = '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@'.
    append it_data.
    clear it_data.
    loop at it_source into x_source.
    move x_source to it_data.
    append it_data.
    clear it_data.
    endloop.
    it_data = '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@'.
    append it_data.
    clear it_data.
    endif.
    endform. " DOWNLOAD_METHOD_SOURCE
    *& Form DOWNLOAD_REDEF_METHODS
    * used to download any redefined methods if any
    form download_redef_methods .
    data: x_redef type line of seor_redefinitions_r.
    loop at it_redefinitions into x_redef.
    * DOWNLOAD METHOD SOURCE
    perform download_method_source using it_class-clsname
    x_redef-mtdname.
    endloop.
    endform. " DOWNLOAD_REDEF_METHODS
    *& Form DOWNLOAD_CLASS_EVTS
    * used to download the class events types
    form download_class_evts .
    data: x_events type line of seoo_events_r.
    it_data = 'EVENTS'.
    append it_data.
    clear it_data.
    it_data = '-------'.
    append it_data.
    clear it_data.
    loop at it_events into x_events.
    clear: x_format.
    * EVENT NAME
    x_format-cmpname = x_events-cmpname.
    * METHOD DECLARATION TYPE
    case x_events-evtdecltyp.
    when gc_atr_inst.
    x_format-decltyp = 'INSTANCE EVENT'.
    when gc_atr_stat.
    x_format-decltyp = 'STATIC EVENT'.
    endcase.
    * EVENT EXPSOURE.
    case x_events-exposure.
    when gc_exp_priv.
    x_format-exposur = 'PRIVATE'.
    when gc_exp_publ.
    x_format-exposur = 'PUBLIC'.
    when gc_exp_prot.
    x_format-exposur = 'PROTECTED'.
    endcase.
    * EVENT DESCRIPTION
    x_format-desc = x_events-descript.
    append x_format to it_data.
    clear it_data.
    endloop.
    endform. " DOWNLOAD_CLASS_EVTS
    *& Form DOWNLOAD_CLASS_TYPE_GROUPS
    * used to download the type groups
    form download_class_type_groups .
    data: x_typep type line of seot_typepusages_r.
    it_data = '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@'.
    append it_data.
    clear it_data.
    it_data = 'TYPE-GROUPS'.
    append it_data.
    clear it_data.
    it_data = '------------'.
    append it_data.
    clear it_data.
    loop at it_typepusages into x_typep.
    it_data = x_typep-typegroup.
    append it_data.
    clear it_data.
    endloop.
    endform. " DOWNLOAD_CLASS_TYPE_GROUPS
    *& Form DOWNLOAD_CLASS_INTERNAL_TYPES
    * used to download the class type internal type definitions
    form download_class_internal_types .
    data: x_types type line of seoo_types_r.
    it_data = '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@'.
    append it_data.
    clear it_data.
    it_data = 'INTERNAL TYPES'.
    append it_data.
    clear it_data.
    it_data = '------------'.
    append it_data.
    clear it_data.
    loop at it_types into x_types.
    clear: x_format.
    * TYPE NAME
    x_format-cmpname = x_types-cmpname.
    * TYPE EXPSOURE.
    case x_types-exposure.
    when gc_exp_priv.
    x_format-exposur = 'PRIVATE'.
    when gc_exp_publ.
    x_format-exposur = 'PUBLIC'.
    when gc_exp_prot.
    x_format-exposur = 'PROTECTED'.
    endcase.
    * TYPTYPE
    case x_types-typtype.
    when gc_typ_like.
    x_format-typtype = 'LIKE'.
    when gc_typ_type.
    x_format-typtype = 'TYPE'.
    when gc_typ_otyp.
    x_format-typtype = 'OBJECT TYPE'.
    when gc_typ_tref.
    x_format-typtype = 'TYPE REF TO'.
    endcase.
    * TYPE
    x_format-type = x_types-type.
    * DESCRIPTION
    x_format-desc = x_types-descript.
    append x_format to it_data.
    clear it_data.
    endloop.
    endform. " DOWNLOAD_CLASS_INTERNAL_TYPES
    *& Form DOWNLOAD_CLASSDEF
    * used to download total class to the text file
    form download_classdef using p_p_filename.
    data: lv_filename type string.
    if p_p_filename = ' '.
    v_filename = it_class-clsname.
    concatenate p_dircls v_filename '.txt' into lv_filename.
    else.
    move p_p_filename to lv_filename.
    concatenate lv_filename '.txt' into lv_filename.
    endif.
    call function 'GUI_DOWNLOAD'
    exporting
    filename = lv_filename
    tables
    data_tab = it_data
    exceptions
    file_write_error = 1
    no_batch = 2
    gui_refuse_filetransfer = 3
    invalid_type = 4
    no_authority = 5
    unknown_error = 6
    header_not_allowed = 7
    separator_not_allowed = 8
    filesize_not_allowed = 9
    header_too_long = 10
    dp_error_create = 11
    dp_error_send = 12
    dp_error_write = 13
    unknown_dp_error = 14
    access_denied = 15
    dp_out_of_memory = 16
    disk_full = 17
    dp_timeout = 18
    file_not_found = 19
    dataprovider_exception = 20
    control_flush_error = 21
    others = 22.
    if sy-subrc <> 0.
    it_scr_out-component = it_class-clsname.
    it_scr_out-path = lv_filename.
    it_scr_out-status = 'FAILED'.
    it_scr_out-etype = 'E'.
    append it_scr_out.
    clear it_scr_out.
    else.
    it_scr_out-component = it_class-clsname.
    it_scr_out-path = lv_filename.
    it_scr_out-status = 'SUCCESSFULL'.
    it_scr_out-etype = 'S'.
    append it_scr_out.
    clear it_scr_out.
    endif.
    endform. " DOWNLOAD_CLASSDEF
    *& Form SAVE_BSPAPPL_DETAILS
    * Used to Save the Bsp Application Details
    form save_bspappl_details using p_it_bspappl type t_bspappl.
    data: lv_filestr type string,
    lv_filenam type rlgrap-filename.
    refresh it_data.
    clear: it_data,lv_filestr.
    concatenate 'APPLICATION NAME: ' p_it_bspappl-applname into it_data.
    append it_data.
    concatenate 'DESCRIPTION: ' p_it_bspappl-descrip into it_data.
    append it_data.
    concatenate 'APPLICATION CLASS: ' p_it_bspappl-applclas into it_data.
    append it_data.
    concatenate 'START PAGE: ' p_it_bspappl-startpage into it_data.
    append it_data.
    if p_it_bspappl-stateful is initial.
    it_data = 'STATELESS APPLICATION'.
    else.
    it_data = 'STATEFUL APPLICATION'.
    endif.
    append it_data.
    perform add_slash_4dir changing p_dirnam.
    concatenate p_dirnam it_bspappl-applname '\' into lv_filenam.
    move lv_filenam to lv_filestr.
    call function 'GUI_CREATE_DIRECTORY'
    exporting
    dirname = lv_filenam
    exceptions
    failed = 1
    others = 2.
    move lv_filestr to v_filestr.
    concatenate lv_filestr it_bspappl-applname '.TXT' into lv_filestr.
    call function 'GUI_DOWNLOAD'
    exporting
    filename = lv_filestr
    tables
    data_tab = it_data
    exceptions
    file_write_error = 1
    no_batch = 2
    gui_refuse_filetransfer = 3
    invalid_type = 4
    no_authority = 5
    unknown_error = 6
    header_not_allowed = 7
    separator_not_allowed = 8
    filesize_not_allowed = 9
    header_too_long = 10
    dp_error_create = 11
    dp_error_send = 12
    dp_error_write = 13
    unknown_dp_error = 14
    access_denied = 15
    dp_out_of_memory = 16
    disk_full = 17
    dp_timeout = 18
    file_not_found = 19
    dataprovider_exception = 20
    control_flush_error = 21
    others = 22.
    if sy-subrc <> 0.
    it_scr_out-appname = p_it_bspappl-applname.
    it_scr_out-component = 'Application Details'.
    it_scr_out-path = lv_filestr.
    it_scr_out-status = 'FAILED'.
    it_scr_out-etype = 'E'.
    append it_scr_out.
    clear it_scr_out.
    else.
    it_scr_out-appname = p_it_bspappl-applname.
    it_scr_out-component = 'Application Details'.
    it_scr_out-path = lv_filestr.
    it_scr_out-status = 'SUCCESSFULL'.
    it_scr_out-etype = 'S'.
    append it_scr_out.
    clear it_scr_out.
    endif.
    endform. " SAVE_BSPAPPL_DETAILS
    *& Form ADD_SLASH_4DIR
    * used to add '/' after the direcory if necessary
    form add_slash_4dir changing p_dirnamcls.
    data: lv_tempvar(1),
    lv_length type i.
    lv_length = strlen( p_dirnamcls ).
    lv_length = lv_length - 1.
    lv_tempvar = p_dirnam+lv_length(1).
    if lv_tempvar <> '\'.
    concatenate p_dirnamcls '\' into p_dirnamcls.
    endif.
    endform. " ADD_SLASH_4DIR
    *& Form CHECK_DIR_EXISTS
    * Check the Directory Exists or Not
    form check_dir_exists using p_dirnamcls.
    data: lv_filename type rlgrap-filename,
    lv_filestr type string,
    it_data(10) occurs 0 with header line.
    clear: lv_filename.
    v_datum = sy-datum.
    v_uzeit = sy-uzeit.
    concatenate p_dirnamcls 'TESTFIL_09087' '.TXT' into lv_filename.
    move lv_filename to lv_filestr.
    call function 'GUI_DOWNLOAD'
    exporting
    filename = lv_filestr
    tables
    data_tab = it_data
    exceptions
    file_write_error = 1
    no_batch = 2
    gui_refuse_filetransfer = 3
    invalid_type = 4
    no_authority = 5
    unknown_error = 6
    header_not_allowed = 7
    separator_not_allowed = 8
    filesize_not_allowed = 9
    header_too_long = 10
    dp_error_create = 11
    dp_error_send = 12
    dp_error_write = 13
    unknown_dp_error = 14
    access_denied = 15
    dp_out_of_memory = 16
    disk_full = 17
    dp_timeout = 18
    file_not_found = 19
    dataprovider_exception = 20
    control_flush_error = 21
    others = 22.
    if sy-subrc <> 0.
    message e901(zt) with 'INVALID DIRECTORY'.
    endif.
    endform. " CHECK_DIR_EXISTS
    *& Form GET_BSPAPPL_COMPO
    * To get the BSP Applciation Component Details
    form get_bspappl_compo using p_it_bspappl type t_bspappl.
    data: lv_filestr type string,
    lv_tempstr type string,
    lv_fn type rlgrap-filename.
    refresh it_pagdetl.
    clear it_pagdetl.
    select applname
    pagekey
    pagename
    implclass
    pagetype
    controllerurl
    lifetime
    state
    is_error_page
    error_page
    browser_cache
    server_cache
    author
    createdon
    changedby
    changedon
    into table it_pagdetl
    from o2pagdir
    where applname = p_it_bspappl-applname.
    * Downloading the application Class Details
    if not p_it_bspappl-applclas is initial.
    clear : lv_filestr.
    concatenate v_filestr 'APPLICATIONCLASS' '\' into lv_filestr.
    it_scr_out-appname = p_it_bspappl-applname.
    perform create_directory using lv_filestr.
    it_scr_out-appname = p_it_bspappl-applname.
    perform download_class_details using lv_filestr p_it_bspappl-applclas.
    endif.
    if r_bspall = 'X' or chk_cont = 'X'.
    clear : lv_filestr.
    concatenate v_filestr 'CONTROLLERS' '\' into lv_filestr.
    perform create_directory using lv_filestr.
    * DOWNLOADING THE CONTROLLER DETAILS
    loop at it_pagdetl where pagetype = gc_bsp_ctrl.
    concatenate lv_filestr it_pagdetl-pagename '\' into lv_tempstr.
    perform create_directory using lv_tempstr.
    clear: lv_fn.
    move lv_tempstr to lv_fn.
    it_scr_out-appname = p_it_bspappl-applname.
    perform download_controller_details using lv_tempstr .
    it_scr_out-appname = p_it_bspappl-applname.
    perform download_class_details using lv_tempstr it_pagdetl-implclass.
    endloop.
    endif.
    if r_bspall = 'X' or chk_view = 'X'.
    clear : lv_filestr.
    concatenate v_filestr 'VIEWS' '\' into lv_filestr.
    perform create_directory using lv_filestr.
    * DOWNLOADING THE VIEW DETAILS
    loop at it_pagdetl where pagetype = gc_bsp_view.
    concatenate lv_filestr it_pagdetl-pagename '\' into lv_tempstr.
    perform create_directory using lv_tempstr.
    it_scr_out-appname = p_it_bspappl-applname.
    perform download_html_event_details using it_pagdetl-applname
    it_pagdetl-pagekey
    lv_tempstr.
    endloop.
    endif.
    if r_bspall = 'X' or chk_frag = 'X'.
    clear : lv_filestr.
    concatenate v_filestr 'PAGEFRAGMENTS' '\' into lv_filestr.
    perform create_directory using lv_filestr.
    * DOWNLOADING THE PAGE FRAGMENTS DETAILS.
    loop at it_pagdetl where pagetype = gc_bsp_pgfr.
    concatenate lv_filestr it_pagdetl-pagename '\' into lv_tempstr.
    perform create_directory using lv_tempstr.
    it_scr_out-appname = p_it_bspappl-applname.
    perform download_html_event_details using it_pagdetl-applname
    it_pagdetl-pagekey
    lv_tempstr.
    endloop.
    endif.
    if r_bspall = 'X' or chk_pgfl = 'X'.
    clear : lv_filestr.
    concatenate v_filestr 'PAGEFLOWLOGIC' '\' into lv_filestr.
    perform create_directory using lv_filestr.
    * DOWNLOADING THE PAGES WITH FLOW LOGIC DETAILS.
    loop at it_pagdetl where pagetype = gc_bsp_pgfl.
    concatenate lv_filestr it_pagdetl-pagename '\' into lv_tempstr.
    perform create_directory using lv_tempstr.
    it_scr_out-appname = p_it_bspappl-applname.
    perform download_html_event_details using it_pagdetl-applname
    it_pagdetl-pagekey
    lv_tempstr.
    endloop.
    endif.
    endform. " GET_BSPAPPL_COMPO
    *& Form CREATE_DIRECTORY
    * To Create Directory*----------------------------------------------------------------------*
    form create_directory using p_lv_filestr.
    data: lv_filename type rlgrap-filename.
    move p_lv_filestr to lv_filename.
    call function 'GUI_CREATE_DIRECTORY'
    exporting
    dirname = lv_filename
    exceptions
    failed = 1
    others = 2.
    endform. " CREATE_DIRECTORY
    *& Form DOWNLOAD_CONTROLLER_DETAILS
    * Controller Details
    form download_controller_details using p_lv_tempstr .
    data: lv_temp type n.
    refresh it_data.
    clear : it_data,
    v_cnt_cls.
    concatenate 'CONTROLLER_NAME: ' it_pagdetl-pagekey into it_data.
    append it_data.
    it_data = space.
    append it_data.
    concatenate 'ERROR HANDLING' ':' into it_data.
    append it_data.
    if it_pagdetl-is_error_page is initial.
    concatenate 'IS ERROR PAGE? ' 'NO' into it_data.
    else.
    concatenate 'IS ERROR PAGE? ' 'YES' into it_data.
    endif.
    append it_data.
    concatenate 'ERROR PAGE: ' it_pagdetl-error_page into it_data.
    append it_data.
    concatenate 'CONTROLLER CLASS : ' it_pagdetl-implclass into it_data.
    append it_data.
    it_data = space.
    append it_data.
    it_data = 'STATUS'.
    append it_data.
    case it_pagdetl-state.
    when gc_lft_requ.
    it_data = 'STATE: STATELESS FROM NOW ON'.
    when gc_lft_sess.
    it_data = 'STATE: STATEFUL FROM NOW ON'.
    when others.
    concatenate 'IS ERROR PAGE? ' 'YES' into it_data.
    endif.
    append it_data.
    concatenate 'ERROR PAGE: ' it_pagdetl-error_page into it_data.
    append it_data.
    concatenate 'CONTROLLER CLASS : ' it_pagdetl-implclass into it_data.
    append it_data.
    it_data = space.
    append it_data.
    it_data = 'STATUS'.
    append it_data.
    case it_pagdetl-state.
    when gc_lft_requ.
    it_data = 'STATE: STATELESS FROM NOW ON'.
    when gc_lft_sess.
    it_data = 'STATE: STATEFUL FROM NOW ON'.
    when others.
    it_data = 'STATE: UNCHANGED'.
    endcase.
    append it_data.
    case it_pagdetl-state.
    when gc_lft_requ.
    it_data = 'LIFETIME: REQUEST'.
    when gc_lft_sess.
    it_data = 'LIFETIME: SESSION'.
    when others.
    it_data = 'LIFETIME: UNTIL PAGE CHANGE'.
    endcase.
    append it_data.
    it_data = space.
    append it_data.
    it_data = 'CACHING'.
    append it_data.
    lv_temp = it_pagdetl-browser_cache.
    concatenate 'BROWSER CACHE: ' lv_temp into it_data.
    append it_data.
    lv_temp = it_pagdetl-server_cache.
    concatenate 'SERVER CACHE: ' lv_temp into it_data.
    append it_data.
    it_data = space.
    append it_data.
    it_data = 'LOG DETAILS'.
    append it_data.
    concatenate 'CREATED BY: ' it_pagdetl-author ' ON ' it_pagdetl-createdon into it_data.
    append it_data.
    concatenate 'CHANGED BY: ' it_pagdetl-changedby ' ON ' it_pagdetl-changedon into it_data.
    append it_data.
    concatenate p_lv_tempstr it_pagdetl-pagename into p_lv_tempstr.
    call function 'GUI_DOWNLOAD'
    exporting
    filename = p_lv_tempstr
    tables
    data_tab = it_data
    exceptions
    file_write_error = 1
    no_batch = 2
    gui_refuse_filetransfer = 3
    invalid_type = 4
    no_authority = 5
    unknown_error = 6
    header_not_allowed = 7
    separator_not_allowed = 8
    filesize_not_allowed = 9
    header_too_long = 10
    dp_error_create = 11
    dp_error_send = 12
    dp_error_write = 13
    unknown_dp_error = 14
    access_denied = 15
    dp_out_of_memory = 16
    disk_full = 17
    dp_timeout = 18
    file_not_found = 19
    dataprovider_exception = 20
    control_flush_error = 21
    others = 22.
    if sy-subrc <> 0.
    concatenate 'CONTROLLER' it_pagdetl-pagekey into it_scr_out-component separated by ':'.
    it_scr_out-path = p_lv_tempstr.
    it_scr_out-status = 'Cntl Class Details Download FAILED'.
    it_scr_out-etype = 'E'.
    append it_scr_out.
    clear it_scr_out.
    else.
    concatenate 'CONTROLLER' it_pagdetl-pagekey into it_scr_out-component separated by ':'.
    it_scr_out-path = p_lv_tempstr.
    it_scr_out-status = 'SUCCESSFULL'.
    it_scr_out-etype = 'S'.
    append it_scr_out.
    clear it_scr_out.
    endif.
    * Getting the Controller Class Name into Global Variable
    clear v_cnt_cls.
    move it_pagdetl-implclass to v_cnt_cls.
    endform. " DOWNLOAD_CONTROLLER_DETAILS
    *& Form download_class
    * DownLoading the Data to File
    form download_class using lv_filename.
    call function 'GUI_DOWNLOAD'
    exporting
    filename = lv_filename
    tables
    data_tab = it_data
    exceptions
    file_write_error = 1
    no_batch = 2
    gui_refuse_filetransfer = 3
    invalid_type = 4
    no_authority = 5
    unknown_error = 6
    header_not_allowed = 7
    separator_not_allowed = 8
    filesize_not_allowed = 9
    header_too_long = 10
    dp_error_create = 11
    dp_error_send = 12
    dp_error_write = 13
    unknown_dp_error = 14
    access_denied = 15
    dp_out_of_memory = 16
    disk_full = 17
    dp_timeout = 18
    file_not_found = 19
    dataprovider_exception = 20
    control_flush_error = 21
    others = 22.
    if sy-subrc <> 0.
    it_scr_out-component = lv_filename.
    it_scr_out-status = 'FAILED'.
    it_scr_out-etype = 'E'.
    append it_scr_out.
    clear it_scr_out.
    else.
    it_scr_out-component = lv_filename.
    it_scr_out-status = 'SUCCESSFULL'.
    it_scr_out-etype = 'S'.
    append it_scr_out.
    clear it_scr_out.
    endif.
    endform. " download_class
    *& Form DOWNLOAD_HTML_EVENT_DETAILS
    * text
    form download_html_event_details using p_applname
    p_pagekey
    p_lv_tempstr.
    data: lv_tempstr type string,
    lv_count type n.
    refresh it_pagcon.
    clear it_pagcon.
    select applname
    pagekey
    objtype
    version
    into table it_pagcon
    from o2pagcon
    where applname = p_applname and
    pagekey = p_pagekey and
    version = 'A' and
    objtype = 'PD'.
    lv_count = 0.
    loop at it_pagcon.
    clear: lv_tempstr,it_source,wa_source,wa_pagecon_key.
    wa_pagecon_key-applname = it_pagcon-applname.
    wa_pagecon_key-pagekey = it_pagcon-pagekey.
    wa_pagecon_key-objtype = it_pagcon-objtype.
    wa_pagecon_key-version = it_pagcon-version.
    if it_pagcon-objtype = 'PD'. "PAGE
    concatenate p_lv_tempstr p_pagekey into lv_tempstr.
    endif.
    import content to it_source-content from database o2pagcon(tr) id wa_pagecon_key
    accepting padding ignoring conversion errors.
    if not it_source-content[] is initial.
    call function 'GUI_DOWNLOAD'
    exporting
    filename = lv_tempstr
    tables
    data_tab = it_source-content
    exceptions
    file_write_error = 1
    no_batch = 2
    gui_refuse_filetransfer = 3
    invalid_type = 4
    no_authority = 5
    unknown_error = 6
    header_not_allowed = 7
    separator_not_allowed = 8
    filesize_not_allowed = 9
    header_too_long = 10
    dp_error_create = 11
    dp_error_send = 12
    dp_error_write = 13
    unknown_dp_error = 14
    access_denied = 15
    dp_out_of_memory = 16
    disk_full = 17
    dp_timeout = 18
    file_not_found = 19
    dataprovider_exception = 20
    control_flush_error = 21
    others = 22.
    if sy-subrc <> 0.
    it_scr_out-component = p_pagekey.
    it_scr_out-path = lv_tempstr.
    it_scr_out-status = 'FAILED'.
    it_scr_out-etype = 'E'.
    append it_scr_out.
    clear it_scr_out.
    else.
    it_scr_out-component = p_pagekey.
    it_scr_out-path = lv_tempstr.
    it_scr_out-status = 'SUCCESSFULL'.
    it_scr_out-etype = 'S'.
    append it_scr_out.
    clear it_scr_out.
    endif.
    endif.
    endloop.
    * NOW DOWNLOAD ALL THE PARAMETERS FOR THAT PAGE
    perform download_params_for_page using p_applname
    p_pagekey
    p_lv_tempstr.
    * NOW DOWNLOAD ALL EVENTS FOR THAT PAGE
    perform download_events_for_page using p_applname
    p_pagekey
    p_lv_tempstr.
    endform. " DOWNLOAD_HTML_EVENT_DETAILS
    *& Form DOWNLOAD_PARAMS_FOR_PAGE
    * text
    form download_params_for_page using p_applname
    p_pagekey
    p_lv_tempstr.
    types: begin of t_dld_params,
    compname type o2param,
    auto(5),
    typtype(15),
    type1 type rs38l_typ,
    parvalue type seovalue,
    end of t_dld_params.
    data: it_params type standard table of o2pagpar with header line.
    data: it_dld_params type standard table of t_dld_params with header line.
    data: lv_tempstr type string.
    refresh: it_params,it_dld_params.
    clear : it_params,it_dld_params.
    concatenate p_lv_tempstr 'PARAMETERS.TXT' into lv_tempstr.
    select * from o2pagpar into table it_params
    where applname = p_applname and
    pagekey = p_pagekey and
    version = 'A'.
    loop at it_params.
    it_dld_params-compname = it_params-compname.
    it_dld_params-type1 = it_params-type.
    it_dld_params-parvalue = it_params-parvalue.
    if it_params-pardecltyp = '0'.
    it_dld_params-auto = 'AUTO'.
    endif.
    if it_params-typtype = '3'.
    it_dld_params-typtype = 'TYPE REF TO'.
    else.
    it_dld_params-typtype = 'TYPE'.
    endif.
    append it_dld_params.
    clear it_dld_params.
    endloop.
    if not it_dld_params[] is initial.
    call function 'GUI_DOWNLOAD'
    exporting
    filename = lv_tempstr
    tables
    data_tab = it_dld_params.
    endif.
    endform. " DOWNLOAD_PARAMS_FOR_PAGE
    *& Form DOWNLOAD_EVENTS_FOR_PAGE
    * To Download the Events data
    form download_events_for_page using p_applname
    p_pagekey
    p_lv_tempstr.
    data: lv_tempstr type string,
    it_events type standard table of o2pagevh with header line,
    lv_count type i.
    types: begin of t_ev_handler,
    name type o2evhandlr,
    source type rswsourcet,
    end of t_ev_handler.
    types : it_ev_handler type sorted table of t_ev_handler with unique key name.
    data : it_ev_sources type it_ev_handler with header line.
    field-symbols : <fs_ev_handler> type it_ev_handler.
    refresh it_events.
    clear : it_events,lv_count.
    select * from o2pagevh into table it_events
    where applname = p_applname and
    pagekey = p_pagekey and
    version = 'A'.
    describe table it_events lines lv_count.
    if lv_count > 0.
    concatenate p_lv_tempstr 'EVENTS' '\' into lv_tempstr.
    perform create_directory using lv_tempstr.
    p_lv_tempstr = lv_tempstr.
    endif.
    refresh: it_ev_sources.
    clear: lv_tempstr,it_source,wa_source,wa_pagecon_key,it_ev_sources.
    wa_pagecon_key-applname = p_applname.
    wa_pagecon_key-pagekey = p_pagekey.
    wa_pagecon_key-objtype = 'EV'.
    wa_pagecon_key-version = 'A'.
    import evhandler to it_ev_sources from database o2pagcon(tr) id wa_pagecon_key
    accepting padding ignoring conversion errors.
    loop at it_ev_sources.
    concatenate p_lv_tempstr it_ev_sources-name '.TXT' into lv_tempstr.
    call function 'GUI_DOWNLOAD'
    exporting
    filename = lv_tempstr
    tables
    data_tab = it_ev_sources-source.
    endloop.
    endform. " DOWNLOAD_EVENTS_FOR_PAGE
    *& Form download_cnt_class
    * Perform to Download the Controller Class Details
    form download_class_details using p_lv_filestr pclassname.
    data : v_cnt_cls_name type string,
    v_cnt_lines type i.
    clear : v_cnt_cls_name.
    * As We need to call the common perform which is used for Downloading
    * Class . Before doing that we need to Set Some varibles.
    if pclassname is not initial.
    clear : r_temp_all,chk_attr,chk_meth,chk_evts,chk_type,it_class.
    move 'X' to r_temp_all.
    refresh it_class.
    concatenate p_lv_filestr pclassname into v_cnt_cls_name.
    * get the class name and Class Description from the table SEOCLASS
    * for all the classes which user entered in selection screen based on
    * the system language
    select a~clsname b~descript
    into table it_class
    from seoclass as a left outer join seoclasstx as b
    on a~clsname = b~clsname and
    b~langu = v_langu
    where a~clsname = pclassname.
    describe table it_class lines v_cnt_lines.
    if v_cnt_lines > 0.
    loop at it_class.
    perform get_class_details using it_class-clsname 'X' v_cnt_cls_name .
    endloop.
    endif.
    endif.
    endform. " download_cnt_class
    *& Form download_class_implementation
    * To Down Load the Class Implementaions
    form download_class_implementation tables p_implementation type seok_int_typeinfos.
    data : x_imp type line of seok_int_typeinfos.
    loop at p_implementation into x_imp.
    perform get_inferface_data using x_imp.
    endloop.
    endform. " download_class_implementation
    *& Form get_inferface_data
    * Getting the Interface Data
    form get_inferface_data using p_x_imp type line of seok_int_typeinfos.
    data : x_inmeth type line of seoo_methods_r,
    v_methodname type string,
    v_classname type string.
    it_data = 'INTERFACE'.
    append it_data.
    it_data = '----------'.
    append it_data.
    * Interface Name
    clear it_data.
    concatenate 'Interface Name : ' p_x_imp-interface-clsname into it_data.
    append it_data.
    * Interface Description
    clear it_data.
    concatenate 'Interface Description : ' p_x_imp-interface-descript into it_data.
    append it_data.
    * Interace Methods
    it_data = '-----------------'.
    append it_data.
    clear it_data.
    it_data = 'Interface Methods'.
    append it_data.
    clear it_data.
    it_data = '-----------------'.
    append it_data.
    loop at p_x_imp-methods into x_inmeth where clsname eq p_x_imp-interface-clsname .
    data : temp_str type string.
    * Adding Class Name & Class Description
    concatenate x_inmeth-cmpname cl_abap_char_utilities=>horizontal_tab x_inmeth-descript
    cl_abap_char_utilities=>horizontal_tab into temp_str.
    * Declaration Type
    if x_inmeth-mtddecltyp eq 0.
    concatenate temp_str 'Instance Method' into temp_str.
    else.
    concatenate temp_str 'Static Method' into temp_str.
    endif.
    * Visibility
    case x_inmeth-exposure.
    when 0.
    concatenate temp_str cl_abap_char_utilities=>horizontal_tab 'PRIVATE' into temp_str.
    when 2.
    concatenate temp_str cl_abap_char_utilities=>horizontal_tab 'PUBLIC' into temp_str.
    when 1.
    concatenate temp_str cl_abap_char_utilities=>horizontal_tab 'PROTECTED' into temp_str.
    endcase.
    it_data = temp_str.
    append it_data.
    * To Get Corresponding Paramenters.
    perform get_int_meth_parameters using p_x_imp x_inmeth-cmpname.
    * To Get Source Code for Interface methods.
    clear v_methodname.
    clear v_classname.
    concatenate p_x_imp-interface-clsname '~' x_inmeth-cmpname into v_methodname.
    v_classname = it_class-clsname.
    perform download_method_source using v_classname
    v_methodname.
    clear temp_str.
    clear it_data.
    append it_data.
    endloop.
    endform. " get_inferface_data
    *& Form GET_INT_METH_PARAMETERS
    * To get the method Parameters
    form get_int_meth_parameters using p_x_imp type line of seok_int_typeinfos
    p_x_inmeth_cmpname.
    data: x_parameters type line of seos_parameters_r,
    temp_str type string.
    it_data = '^^^^PARAMETERS'.
    append it_data.
    clear it_data.
    loop at p_x_imp-parameters into x_parameters where clsname eq p_x_imp-interface-clsname and
    cmpname eq p_x_inmeth_cmpname.
    concatenate cl_abap_char_utilities=>horizontal_tab
    cl_abap_char_utilities=>horizontal_tab
    x_parameters-sconame
    cl_abap_char_utilities=>horizontal_tab into temp_str.
    case x_parameters-pardecltyp.
    when 0.
    concatenate temp_str 'Importing' cl_abap_char_utilities=>horizontal_tab into temp_str.
    when 1.
    concatenate temp_str 'Exporting' cl_abap_char_utilities=>horizontal_tab into temp_str.
    when 2.
    concatenate temp_str 'Changing' cl_abap_char_utilities=>horizontal_tab into temp_str.
    when 3.
    concatenate temp_str 'Returning' cl_abap_char_utilities=>horizontal_tab into temp_str.
    endcase.
    case x_parameters-typtype.
    when 0.
    concatenate temp_str 'Like' cl_abap_char_utilities=>horizontal_tab into temp_str.
    when 1.
    concatenate temp_str 'Type' cl_abap_char_utilities=>horizontal_tab into temp_str.
    when 2.
    concatenate temp_str 'Type Ref To' cl_abap_char_utilities=>horizontal_tab into temp_str.
    endcase.
    concatenate temp_str x_parameters-type cl_abap_char_utilities=>horizontal_tab x_parameters-parvalue into temp_str.
    it_data = temp_str.
    append it_data.
    clear it_data.
    clear temp_str.
    endloop.
    endform. " GET_INT_METH_PARAMETERS
    *& Form DOWNLOAD_CLASS_OTHERDETAILS
    * Downloading Class Implementation , Types & Macros
    form download_class_otherdetails using p_p_clsname
    p_inctype.
    data : lv_inctype type string,
    l_clsname type seoclskey,
    cl_source type seop_source,
    cl_exsource type seop_source_string,
    x_source type line of seop_source.
    move p_p_clsname to l_clsname.
    case p_inctype.
    when seop_ext_class_locals_imp.
    lv_inctype = 'CLASS IMPLEMENTAION'.
    when seop_incextapp_definition.
    lv_inctype = 'CLASS TYPES'.
    when seop_incextapp_macros.
    lv_inctype = 'CLASS MACROS'.
    endcase.
    call function 'SEO_CLASS_GET_INCLUDE_SOURCE'
    exporting
    clskey = l_clsname
    inctype = p_inctype
    importing
    source = cl_source
    source_expanded = cl_exsource
    exceptions
    _internal_class_not_existing = 1
    not_existing = 2
    others = 3.
    if sy-subrc <> 0.
    it_scr_out-component = lv_inctype.
    it_scr_out-status = 'FAILED'.
    it_scr_out-etype = 'E'.
    append it_scr_out.
    clear it_scr_out.
    else.
    it_data = '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@'.
    append it_data.
    clear it_data.
    it_data = lv_inctype .
    append it_data.
    clear it_data.
    it_data = '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@'.
    append it_data.
    clear it_data.
    loop at cl_source into x_source.
    move x_source to it_data.
    append it_data.
    clear it_data.
    endloop.
    it_data = '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@'.
    append it_data.
    clear it_data.
    endif.
    endform. " DOWNLOAD_CLASS_OTHERDETAILS
    Regards,
    Anubhav.

  • How to Download displayed output to Excel Using Bsp Application

    Hi Experts,
    please give me some idea because I am New In BSP.
    How to Download displayed output to Excel Using Bsp Application.
    If any sample code please do send me.
    In my condition I am getting data in  2-3 table view formats on one page and i want download that in Excel.
    please help me.
    Regards & Thanks,
    Yogesh

    Hi,
    This is more a question for the BSP forum.
    Anyway, as such it's realy easy since you can use HTML in order to import to Excel. All you need to do is add
    runtime->server->response->set_header_field( name = 'Contnet-Type'
    value = 'application/vnd.ms-excel' ).
    runtime->server->response->delete_header_field( name = 'Cache-Control' ).
    runtime->server->response->delete_header_field( name = 'Expires' ).
    runtime->server->response->delete_header_field( name = 'Pragma' ).
    Also check threads like
    Download BSP data into Excel
    export bsp-table to excel
    Export BSP Table to Excel
    Eddy
    PS. Reward useful answers and earn points yourself

  • I've developed classes to convert amount into it's phrase representation

    Hi everybody!
    Example:
    Number 25 can be converted into the phrase "twenty five"
    or even into "twenty five Canadian Dollars" for english language, Canadian currency
    This functionality can be supplied for major languages like Russian, German,
    Spanish. French, Chinese, Hindi etc. All of these languages might have their
    own specifics.
    In future end-users will to be able to use this functionality via Web-services.
    I also look forward to find reliable web site where We can host this web service and front-end servlet which will show this phrase based on { amount, language, currency } selected. That everybody can recieve it electronically via xml request or just copy result phrase from web page . Please send me a list of companies who potentially interested to host it including detailed info of Company/Persons name and his/her e-mail if possible.
    I'm going to post them at apache.org but for now I've attached source code below
    for your feedbacks and if somebody wants to join to me to implement some languages like french, spanish etc. Currency feature will be ready when I have more languages supporrt.
    Author Igor Artimenko my e-mail is <[email protected]>
    package org.apache.bussinessapi.test;
    import org.apache.bussinessapi.AmountByWord;
    * Test case prototype
    * @author Igor Artimenko <[email protected]>
    * @version 1.0 Initial draft for review
    * Created on Jun 5, 2003
    public class TestAmountByWord
         public TestAmountByWord()
              double array[] = { 123456789777L, -627845, 300.84, 670, 30, -100, -56879, 1008, 37, 205100, 0, 3000.67 };
              AmountByWord amountByWord = new AmountByWord();
              amountByWord.setLanguage( "en" );
              amountByWord.setCurrency( "en" );
              for (int i = 0; i < array.length; i++)
                   System.out.println( array[ i ] );
                   try {
                        System.out.println( amountByWord.getAmountByWord( array[ i ] ) );
                   } catch (Exception e) {
                        e.printStackTrace();
                   System.out.println( "---------------------------------" );               
         public static void main(String[] args)
              TestAmountByWord test = new TestAmountByWord();
    package org.apache.bussinessapi;
    * Usially used class to get string representation of the number
    * in the human-readable format
    * @author Igor Artimenko <[email protected]>
    * @version 1.0 Initial draft for review
    * Created on Jun 5, 2003
    public class AmountByWord implements IAmountByWord
         private String language;
         private String currency;
         private String amountByWord;
         * Constructor AmountByWord
         public AmountByWord()
              super();
         * Method getAmountByWord is the most important method
         * @param amount to be represented in the human-readable format
         * @return String the phrase representation of number
         public String getAmountByWord( double amount ) throws Exception
              StringBuffer resultAmount = new StringBuffer();
              IAmountByWord amountByWord = null;
              //     First, create an appropriate instance
              try
                   if ( language == null )
                        throw new Exception( "Language has not been assigned yet" );                    
                   else if ( currency == null )
                        throw new Exception( "Currency has not been assigned yet" );                    
                   Class cl = Class.forName( "org.apache.bussinessapi.AmountByWord".concat( language ) );
                   try
                        amountByWord = (IAmountByWord) cl.newInstance();
                   catch ( InstantiationException e )
                        throw new Exception( "can not be instantiated" );
                   } // catch
                   catch ( IllegalAccessException e )
                        throw new Exception(
                             "IllegalAccessException arrised during instantiating of " );
                   }     // catch
              } // try
              catch ( ClassNotFoundException e )
                   throw new Exception( "Class could not be found " );
              } // catch
              // for now the number only
              return amountByWord.getAmountByWord( amount );
         * Method getMoneyAmountByWord is the most important method
         * @param amount to be represented in the human-readable format
         * @return String the phrase representation of number
         public String getMoneyAmountByWord( double amount ) throws Exception
              StringBuffer resultAmount = new StringBuffer();
              IAmountByWord amountByWord = null;
              //     First, create an appropriate instance
              try
                   if ( language == null )
                        throw new Exception( "Language has not been assigned yet" );                    
                   else if ( currency == null )
                        throw new Exception( "Currency has not been assigned yet" );                    
                   Class cl = Class.forName( "org.apache.bussinessapi.AmountByWord".concat( language ) );
                   try
                        amountByWord = (IAmountByWord) cl.newInstance();
                   catch ( InstantiationException e )
                        throw new Exception( "can not be instantiated" );
                   } // catch
                   catch ( IllegalAccessException e )
                        throw new Exception(
                             "IllegalAccessException arrised during instantiating of " );
                   }     // catch
              } // try
              catch ( ClassNotFoundException e )
                   throw new Exception( "Class could not be found " );
              } // catch
              // for now the number only
              return amountByWord.getMoneyAmountByWord( amount );
         * getCurrency Method
         * @return To retrieve currency code currently used
         public String getCurrency()
              return currency;
         * getLanguage
         * @return To retrieve Language locale code currently used
         public String getLanguage()
              return language;
         * setCurrency
         * @return To setup Currency locale code to be used
         public void setCurrency( String currency )
              this.currency = currency;
         * setLanguage
         * @return To setup Language locale code to be used
         public void setLanguage( String language )
              this.language = language;
    package org.apache.bussinessapi;
    import java.util.Properties;
    * The purpose is to return string representation on the number
    * in the human-readable format based on English grammar
    * Generally you can use this class as a base for your own language
    * like Russian, German, Spanish, French etc.
    * They must implement IAmountByWord interface
    * @author Igor Artimenko <[email protected]>
    * @version 1.0 Initial draft for review
    * Created on Jun 5, 2003
    public class AmountByWorden implements IAmountByWord
         final private Properties langTokens = new Properties();
         AmountByWorden()
              langTokens.put( "0", "zero" );          
              langTokens.put( "1", "one" );
              langTokens.put( "2", "two" );
              langTokens.put( "3", "three" );
              langTokens.put( "4", "four" );
              langTokens.put( "5", "five" );
              langTokens.put( "6", "six" );
              langTokens.put( "7", "seven" );
              langTokens.put( "8", "eight" );
              langTokens.put( "9", "nine" );
              langTokens.put( "10", "ten" );
              langTokens.put( "11", "eleven" );
              langTokens.put( "12", "twelve" );
              langTokens.put( "13", "thirteen" );
              langTokens.put( "14", "fourteen" );
              langTokens.put( "15", "fifteen" );
              langTokens.put( "16", "sixteen" );
              langTokens.put( "17", "seventeen" );
              langTokens.put( "18", "eighteen" );          
              langTokens.put( "19", "nineteen" );
              langTokens.put( "20", "twenty" );
              langTokens.put( "30", "thirty" );
              langTokens.put( "40", "fourty" );
              langTokens.put( "50", "fifty" );
              langTokens.put( "60", "sixty" );
              langTokens.put( "70", "seventy" );
              langTokens.put( "80", "eighty" );
              langTokens.put( "90", "ninety" );
              langTokens.put( "100", "hundred" );          
              langTokens.put( "1000", "thousand" );
              langTokens.put( "1000000", "million" );
              langTokens.put( "1000000000", "billion" );
              langTokens.put( "1000000000000L", "trillion" );
              langTokens.put( "minus", "minus" );
              langTokens.put( "and", "and" );
              langTokens.put( "point", "point" );
         /* (non-Javadoc)      
         * It does not yet working. Proper implementation coming soon.
         * @see org.apache.bussinessapi.IAmountByWord#getAmountByWord(double)
         public String getAmountByWord( double amount ) throws Exception
              NumberByWord numberByWord = new NumberByWord();
              StringBuffer fullNumber = new StringBuffer();
              numberByWord.setLanguageTokens( langTokens );
              // also should be replaced by full phrase
              fullNumber = fullNumber.append(
                        numberByWord.getNumberByWord( (long) amount ).trim() );
              // for now 2 numbers after .
              int theRest = (int) ( ( amount - (long) amount ) * 100 );
              if ( theRest != 0 )
                   fullNumber.append( " " ). append( langTokens.get( "point" ) ).
                             append( " " ).append(     
                             numberByWord.getNumberByWord( (long) theRest ).trim() );
              return fullNumber.toString();           
         /* (non-Javadoc)      
         * It does not yet working. Proper implementation coming soon.
         * @see org.apache.bussinessapi.IAmountByWord#getMoneyAmountByWord(double)
         public String getMoneyAmountByWord( double amount ) throws Exception
              NumberByWord numberByWord = new NumberByWord();
              StringBuffer fullNumber = new StringBuffer();
              numberByWord.setLanguageTokens( langTokens );
              // also should be replaced by full phrase
              fullNumber = fullNumber.append(
                        numberByWord.getNumberByWord( (long) amount ).trim() );
              // for now 2 numbers after .
              int theRest = (int) ( ( amount - (long) amount ) * 100 );
              if ( theRest != 0 )
                   fullNumber.append( " " ). append( langTokens.get( "point" ) ).
                             append( " " ).append(     
                             numberByWord.getNumberByWord( (long) theRest ).trim() );
              return fullNumber.toString();           
    package org.apache.bussinessapi;
    * Each class created for the purpose of giving back
    * a string representation of the number MUST implement this interface
    * @author Igor Artimenko <[email protected]>
    * @version 1.0 Initial draft for review
    * Created on Jun 5, 2003
    public interface IAmountByWord {
         * getMoneyAmountByWord The purpose of this method is to return
         * string representation on the number in the human-readable format
         * in a regular format ( like 25.78
         * "twenty five point seventy eight" )
         * @param anAmount to be converted into it's string representation
         * @return A string representation of the number
         * @throws Exception if something went wrong
         public String getAmountByWord( double anAmount ) throws Exception;
         * getMoneyAmountByWord The purpose of this method is to return
         * string representation on the number in the human-readable format
         * in a money format like ( 25.78 Can
         * "twenty five Canadian Dollars and seventy eight Cents" )
         * @param anAmount to be converted into it's string representation
         * @return A string representation of the number
         * @throws Exception if something went wrong
         public String getMoneyAmountByWord( double anAmount )
                   throws Exception;
    package org.apache.bussinessapi;
    import java.util.*;
    * This class implements generic algoritm of converting a number into
    * human-readable format.
    * @author Igor Artimenko <[email protected]>
    * @version 1.0 Initial draft for review
    * Created on Jun 5, 2003
    * You can use getNumberByWord method
    * if your language fits into this algorithm or
    * extend from this class and make some transformations in the child
    * method.
    * Don't forget to setup language Tokens
    * via setLanguageTokens method call first
    public class NumberByWord
         private Properties langTokens = new Properties();
         * Constructor for NumberByWord.
         public NumberByWord()
              super();
         * Method getNumberByWord. The most important method.
         * Standard actions are here
         * @param amount Accepts only mathematical integer
         * @return String representation of this phrase
         public String getNumberByWord( long amount )
              StringBuffer strNumberByWord = new StringBuffer( "" );
              SortedMap smallAmounts = new TreeMap();
              String str = new Long( Math.abs( amount ) ).toString();
              int currentPosition = str.length();
              long currentThousand = 1;
              // break by thousands
              while ( currentPosition > 0 )
                   smallAmounts.put( new Long( currentThousand ), new Integer(
                             str.substring( Math.max( 0, currentPosition - 3 ),
                             currentPosition ) ) );               
                   strNumberByWord.insert( 0,
                        getSmallest( (Integer) smallAmounts.get( new Long( currentThousand ) ) ) +
                        ( currentThousand == 1 ? "" : " " +
                   langTokens.getProperty( new Long( currentThousand ).toString() ) ) );
                   currentPosition -= 3;     
                   currentThousand *= 1000;
              if ( amount == 0 ) {
                   strNumberByWord.append( langTokens.getProperty( "0" ) );
              else if ( amount < 0 )
                   strNumberByWord.insert( 0, langTokens.getProperty( "minus" ) );
              return strNumberByWord.toString().trim();
         * @param smallNumber this number must in the range from 0 to 999
         *      inclusive
         * @return String representation of this number
         public StringBuffer getSmallest( Integer smallNumber )
              StringBuffer smallestNumberByWord = new StringBuffer( "" );
              int hundreds = (int) ( smallNumber.intValue() / 100 );
              int dozens = (int)( ( smallNumber.intValue() - hundreds * 100 ) / 10 );
              int rest = smallNumber.intValue() - hundreds * 100 - dozens * 10;
              // using smallNumber create small phrase
              // Let's compund the phrase itself
              if ( hundreds > 0 ) {
                   smallestNumberByWord.append( " " ).append(
                             langTokens.getProperty( new Long( hundreds ).toString() ) ).append( " " ).append(
                             langTokens.getProperty( new Long( 100 ).toString() ) );
              Object obj = langTokens.getProperty( new Long( dozens * 10 + rest ).toString() );
              // is atomic like 15 juust substitute
              if ( dozens * 10 + rest != 0 )
                   if ( obj != null )
                        smallestNumberByWord.append( " " ).append( obj );
                   else
                        smallestNumberByWord.append( " " ).append(
                                  langTokens.getProperty( new Long( dozens * 10 ).toString() ) ).
                                  append( " " ).append(     langTokens.getProperty( new Long( rest ).
                                  toString() ) );
              return smallestNumberByWord;
         * setLanguageTokens Use before making call to getNumberByWord
         * @param langTokens Properties of language token used by
         * particular language
         public void setLanguageTokens( Properties langTokens )
              this.langTokens = langTokens;
    ----------------------------------------------------------------------------------

    Hi Hoos!
    I found a host for that project. It's called valia at sourceforge.net.
    We have already about 7 developers ( English, Russian, French, German, Italian, Arabic, Hindi, Traditional Chinese ). We are looking for guys with Spanish and Japanese.
    Also if you want we can expand our support for Persian you are very welcome to join. It's usially small job, just replace one, two etc by your spoken language plus coding of grammar exceptions.
    Withregard of applicability we are making first version to be working for even small j2me. So you can integrate it to everywhere including cell phones. But major goal is for bussiness apps & web services, possibly entertainements.
    Would you reply to me if you wanted to join at [email protected]
    Have a great day
    Igor Artimenko
    valia, Project Manager

  • Create generic HTTPService class

    I am trying to create a generic HTTPService class. I am using
    this code as my starting point:
    import mx.controls.Alert;
    import mx.rpc.http.HTTPService;
    import mx.rpc.events.ResultEvent;
    import mx.rpc.events.FaultEvent;
    private var service:HTTPService
    public function useHttpService(parameters:Object):void {
    service = new HTTPService();
    service.destination = "sampleDestination";
    service.method = "POST";
    service.addEventListener("result", httpResult);
    service.addEventListener("fault", httpFault);
    service.send(parameters);
    public function httpResult(event:ResultEvent):void {
    var result:Object = event.result;
    //Do something with the result.
    ?? How to run my function here if I dont know a name of it
    public function httpFault(event:FaultEvent):void {
    var faultstring:String = event.fault.faultString;
    Alert.show(faultstring);
    httpResult should be able to fire different functions that a
    service requester will provide. How can I send a function name or
    something else for the httpResult to fire when data has arrived?
    Thanks

    There are several options. First look into the AsyncToken. It
    allows you to associate a dynamic "token" object with a given
    request and result. properties of this object can be almos anyting,
    including strings, if you want to use a switch statement to direct
    the results to the desited handler, and even functions, if you want
    to specify a callback function.
    Additionally, bracket notation will resolve a function name
    expressed as a string, and let you call that. So if you pass in a
    reference to the scope of the handler, say "caller", and the
    calling component has a public function processResult(), and you
    pass the name of that function in via a var, say "handlerFunc",
    then from wiithin your HTTP component you can do:
    caller[handlerFunc](whatever)
    Tracy

  • How to download data into  two different columns 2003 excel format in ole

    Hi ALL
    when we download data into excel using ole with delimiter it works fine in 2007 but when we check this with 2003 format
    both fields come in only one column .Can any one suggest  
      CONCATENATE WA_ALL-PERNR LV_ICNUM INTO WA_PERNR SEPARATED BY W_DELI   IN CHARACTER MODE.

    If you're already using OLE, you can fill in value for each cell separately instead of using a delimiter. Something like this fragment:
    FORM fill_cell USING p_row p_col p_value.
      CALL METHOD OF obj_excel 'CELLS' = obj_cell
        EXPORTING
        #1 = p_row
        #2 = p_col.
      SET PROPERTY OF obj_cell 'VALUE' = p_value.
    ENDFORM.                    "fill_cell

  • I have several manuals in PDF format. How do I download them into my iPad and view them?

    I have several manuals in PDF format. How do I download them into my iPad and view them? I downloaded a PDF viewer on my iPad and via itunes I can download the PDF to the iPad although for some reason the iPad comes up as 'RmoteTV' with a sub-directory of 'Books'. The 'PDFReader' app doesn't seem to find the file.

    You can use the free iBooks to read PDF files. Download the app, use itunes to transfer the data then open the PDFs.
    There are other pdf readers as well. I see good reader recommended and I'm sure there are more.

  • I have downloaded cds into my itunes library and want to load them ont my ipod touch.  it is only transferring music that i have purchased.  How come?

    I have downloaded cds into my itunes library and want to load them ont my ipod touch.  it is only transferring music that i have purchased.  I did not have this problem with my iphone or my old ipod touch.  How come?

    Do they play in iTunes on the computer?
    Did you use the iTunes import feature?
    http://support.apple.com/kb/PH12486
    What is the format of the songs? Select a song and right click and select Get Info and go to the Summary tab

Maybe you are looking for

  • Reporting Services Add-in for Sharepoint- does it need an SQL Server license?

    In a new project we will be creating an SSRS in Sharepoint integrated mode. For this we'll need SQL Server and Sharepoint on that box. We'll also have one or more SharePoint Web Front End (WFE) servers. To allow them to connect to the SSRS-in-sharepo

  • Error in program SAPLCKDI screen 4610

    Hi everyone. I've have trouble with screen 4610 in program SAPLCKDI, during costing sales order. In sometimes we have a runtime error in the same program and same screen. That's the runtime error: Overwriting a protected field In other cases, the men

  • Soap attachment in jaxws

    hi i am trying to add an attachment to a soap message . im using jaxws2.0 and this is a snippet of my code.. public boolean handleMessage (SOAPMessageContext messageContext) {           boolean request = ((Boolean) messageContext.get(SOAPMessageConte

  • FB03 in print preview mode

    Hi Experts, when I display FB03  and  click menu "documentu2192print preview" , there will show document content for printing , is it possible to change its cell color? Thanks a lot. Regards, Yacoa

  • Migrate data

    Dear all, We have oracle 9i on SLES 9 and would like to migrate the data/schmas to a new server SLES 9 and having oracle 10.2. Is it possible and how. Regards SL