Problem while transfering data from form to excel

Hi all.
I have a little problem. I have a procedure that fires on when-button-pressed trigger that goes to current block and download the data into an excel file.
The block has 2200 records.
The problem is that if I make the application visible all is ok; if I make the application not visible it remains "append" and nothing happens.
I'm on developer suite 10g.
Here is the code:
PROCEDURE pr_Forms_to_Excel(p_block_name IN VARCHAR2 DEFAULT NAME_IN('system.current_block')) IS
-- Declare the OLE objects
application OLE2.OBJ_TYPE;
workbooks OLE2.OBJ_TYPE;
workbook OLE2.OBJ_TYPE;
worksheets OLE2.OBJ_TYPE;
worksheet OLE2.OBJ_TYPE;
cell OLE2.OBJ_TYPE;
range OLE2.OBJ_TYPE;
range_col OLE2.OBJ_TYPE;
-- Declare handles to OLE argument lists
args OLE2.LIST_TYPE;
-- Declare form and block items
form_name VARCHAR2(100);
f_block VARCHAR2(100);
l_block VARCHAR2(100);
f_item VARCHAR2(100);
l_item VARCHAR2(100);
cur_block VARCHAR2(100) := NAME_IN('system.current_block');
cur_item VARCHAR2(100) := NAME_IN('system.current_item');
cur_record VARCHAR2(100) := NAME_IN('system.cursor_record');
item_name VARCHAR2(100);
baslik VARCHAR2(100);
row_n NUMBER;
col_n NUMBER;
filename VARCHAR2(100);
BEGIN
-- Start Excel
application:=OLE2.CREATE_OBJ('Excel.Application');
OLE2.SET_PROPERTY(application, 'Visible', 'TRUE');
-- Return object handle to the Workbooks collection
workbooks:=OLE2.GET_OBJ_PROPERTY(application, 'Workbooks');
-- Add a new Workbook object to the Workbooks collection
workbook:=OLE2.GET_OBJ_PROPERTY(workbooks,'Add');
-- Return object handle to the Worksheets collection for the Workbook
worksheets:=OLE2.GET_OBJ_PROPERTY(workbook, 'Worksheets');
-- Get the first Worksheet in the Worksheets collection
-- worksheet:=OLE2.GET_OBJ_PROPERTY(worksheets,'Add');
args:=OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(args, 1);
worksheet:=OLE2.GET_OBJ_PROPERTY(worksheets,'Item',args);
OLE2.DESTROY_ARGLIST(args);
-- Return object handle to cell A1 on the new Worksheet
go_block(p_block_name);
baslik := get_block_property(p_block_name,FIRST_ITEM);
f_item := p_block_name||'.'||get_block_property(p_block_name,FIRST_ITEM);
l_item := p_block_name||'.'||get_block_property(p_block_name,LAST_ITEM);
first_record;
LOOP
item_name := f_item;
row_n := NAME_IN('SYSTEM.CURSOR_RECORD');
col_n := 1;
LOOP
IF get_item_property(item_name,ITEM_TYPE)<>'BUTTON' AND
get_item_property(item_name,VISIBLE)='TRUE'
THEN
-- Set first row with the item names
IF row_n=1 THEN
baslik:=NVL(get_item_property(item_name,PROMPT_TEXT),baslik);
args:=OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(args, row_n);
OLE2.ADD_ARG(args, col_n);
cell:=OLE2.GET_OBJ_PROPERTY(worksheet, 'Cells', args);
OLE2.DESTROY_ARGLIST(args);
OLE2.SET_PROPERTY(cell, 'Value', baslik);
OLE2.RELEASE_OBJ(cell);
END IF;
-- Set other rows with the item values
args:=OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(args, row_n+1);
OLE2.ADD_ARG(args, col_n);
cell:=OLE2.GET_OBJ_PROPERTY(worksheet, 'Cells', args);
OLE2.DESTROY_ARGLIST(args);
IF get_item_property(item_name,DATATYPE)<>'NUMBER' THEN
OLE2.SET_PROPERTY(cell, 'NumberFormat', '@');
END IF;
OLE2.SET_PROPERTY(cell, 'Value', name_in(item_name));
OLE2.RELEASE_OBJ(cell);
END IF;
IF item_name = l_item THEN
exit;
END IF;
baslik := get_item_property(item_name,NEXTITEM);
item_name := p_block_name||'.'||get_item_property(item_name,NEXTITEM);
col_n := col_n + 1;
END LOOP;
EXIT WHEN NAME_IN('system.last_record') = 'TRUE';
NEXT_RECORD;
END LOOP;
-- Autofit columns
range := OLE2.GET_OBJ_PROPERTY( worksheet,'UsedRange');
range_col := OLE2.GET_OBJ_PROPERTY( range,'Columns');
OLE2.INVOKE( range_col,'AutoFit' );
OLE2.RELEASE_OBJ( range );
OLE2.RELEASE_OBJ( range_col );
-- Get filename and path
args := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG( args, p_block_name );
OLE2.ADD_ARG( args,'Excel Workbooks (*.xls, *.xls');
filename := OLE2.INVOKE_CHAR( application,'GetSaveAsFilename',args );
OLE2.DESTROY_ARGLIST( args );
-- Save as worksheet
IF NVL(filename,'0')<>'0' THEN
args := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG( args,filename );
OLE2.INVOKE( worksheet,'SaveAs',args );
OLE2.DESTROY_ARGLIST( args );
END IF;
-- Close workbook
OLE2.INVOKE( workbook ,'Close');
-- Release the OLE objects
OLE2.RELEASE_OBJ(worksheet);
OLE2.RELEASE_OBJ(worksheets);
OLE2.RELEASE_OBJ(workbook);
OLE2.RELEASE_OBJ(workbooks);
OLE2.INVOKE(application, 'Quit');
OLE2.RELEASE_OBJ(application);
-- Focus to the original location
go_block(cur_block);
go_record(cur_record);
go_item(cur_block||'.'||cur_item);
END;
Is there anyone that can help me????
Thanks,
Fabrizio

Hi all.
I have a little problem. I have a procedure that fires on when-button-pressed trigger that goes to current block and download the data into an excel file.
The block has 2200 records.
The problem is that if I make the application visible all is ok; if I make the application not visible it remains "append" and nothing happens.
I'm on developer suite 10g.
Here is the code:
PROCEDURE pr_Forms_to_Excel(p_block_name IN VARCHAR2 DEFAULT NAME_IN('system.current_block')) IS
-- Declare the OLE objects
application OLE2.OBJ_TYPE;
workbooks OLE2.OBJ_TYPE;
workbook OLE2.OBJ_TYPE;
worksheets OLE2.OBJ_TYPE;
worksheet OLE2.OBJ_TYPE;
cell OLE2.OBJ_TYPE;
range OLE2.OBJ_TYPE;
range_col OLE2.OBJ_TYPE;
-- Declare handles to OLE argument lists
args OLE2.LIST_TYPE;
-- Declare form and block items
form_name VARCHAR2(100);
f_block VARCHAR2(100);
l_block VARCHAR2(100);
f_item VARCHAR2(100);
l_item VARCHAR2(100);
cur_block VARCHAR2(100) := NAME_IN('system.current_block');
cur_item VARCHAR2(100) := NAME_IN('system.current_item');
cur_record VARCHAR2(100) := NAME_IN('system.cursor_record');
item_name VARCHAR2(100);
baslik VARCHAR2(100);
row_n NUMBER;
col_n NUMBER;
filename VARCHAR2(100);
BEGIN
-- Start Excel
application:=OLE2.CREATE_OBJ('Excel.Application');
OLE2.SET_PROPERTY(application, 'Visible', 'TRUE');
-- Return object handle to the Workbooks collection
workbooks:=OLE2.GET_OBJ_PROPERTY(application, 'Workbooks');
-- Add a new Workbook object to the Workbooks collection
workbook:=OLE2.GET_OBJ_PROPERTY(workbooks,'Add');
-- Return object handle to the Worksheets collection for the Workbook
worksheets:=OLE2.GET_OBJ_PROPERTY(workbook, 'Worksheets');
-- Get the first Worksheet in the Worksheets collection
-- worksheet:=OLE2.GET_OBJ_PROPERTY(worksheets,'Add');
args:=OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(args, 1);
worksheet:=OLE2.GET_OBJ_PROPERTY(worksheets,'Item',args);
OLE2.DESTROY_ARGLIST(args);
-- Return object handle to cell A1 on the new Worksheet
go_block(p_block_name);
baslik := get_block_property(p_block_name,FIRST_ITEM);
f_item := p_block_name||'.'||get_block_property(p_block_name,FIRST_ITEM);
l_item := p_block_name||'.'||get_block_property(p_block_name,LAST_ITEM);
first_record;
LOOP
item_name := f_item;
row_n := NAME_IN('SYSTEM.CURSOR_RECORD');
col_n := 1;
LOOP
IF get_item_property(item_name,ITEM_TYPE)<>'BUTTON' AND
get_item_property(item_name,VISIBLE)='TRUE'
THEN
-- Set first row with the item names
IF row_n=1 THEN
baslik:=NVL(get_item_property(item_name,PROMPT_TEXT),baslik);
args:=OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(args, row_n);
OLE2.ADD_ARG(args, col_n);
cell:=OLE2.GET_OBJ_PROPERTY(worksheet, 'Cells', args);
OLE2.DESTROY_ARGLIST(args);
OLE2.SET_PROPERTY(cell, 'Value', baslik);
OLE2.RELEASE_OBJ(cell);
END IF;
-- Set other rows with the item values
args:=OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(args, row_n+1);
OLE2.ADD_ARG(args, col_n);
cell:=OLE2.GET_OBJ_PROPERTY(worksheet, 'Cells', args);
OLE2.DESTROY_ARGLIST(args);
IF get_item_property(item_name,DATATYPE)<>'NUMBER' THEN
OLE2.SET_PROPERTY(cell, 'NumberFormat', '@');
END IF;
OLE2.SET_PROPERTY(cell, 'Value', name_in(item_name));
OLE2.RELEASE_OBJ(cell);
END IF;
IF item_name = l_item THEN
exit;
END IF;
baslik := get_item_property(item_name,NEXTITEM);
item_name := p_block_name||'.'||get_item_property(item_name,NEXTITEM);
col_n := col_n + 1;
END LOOP;
EXIT WHEN NAME_IN('system.last_record') = 'TRUE';
NEXT_RECORD;
END LOOP;
-- Autofit columns
range := OLE2.GET_OBJ_PROPERTY( worksheet,'UsedRange');
range_col := OLE2.GET_OBJ_PROPERTY( range,'Columns');
OLE2.INVOKE( range_col,'AutoFit' );
OLE2.RELEASE_OBJ( range );
OLE2.RELEASE_OBJ( range_col );
-- Get filename and path
args := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG( args, p_block_name );
OLE2.ADD_ARG( args,'Excel Workbooks (*.xls, *.xls');
filename := OLE2.INVOKE_CHAR( application,'GetSaveAsFilename',args );
OLE2.DESTROY_ARGLIST( args );
-- Save as worksheet
IF NVL(filename,'0')<>'0' THEN
args := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG( args,filename );
OLE2.INVOKE( worksheet,'SaveAs',args );
OLE2.DESTROY_ARGLIST( args );
END IF;
-- Close workbook
OLE2.INVOKE( workbook ,'Close');
-- Release the OLE objects
OLE2.RELEASE_OBJ(worksheet);
OLE2.RELEASE_OBJ(worksheets);
OLE2.RELEASE_OBJ(workbook);
OLE2.RELEASE_OBJ(workbooks);
OLE2.INVOKE(application, 'Quit');
OLE2.RELEASE_OBJ(application);
-- Focus to the original location
go_block(cur_block);
go_record(cur_record);
go_item(cur_block||'.'||cur_item);
END;
Is there anyone that can help me????
Thanks,
Fabrizio

Similar Messages

  • Problem while opening data from mysql  in Excel

    Hi friends
    when i try to download data from MySQL to excel sheet I am getting error of
    This file is not in a recognizable format.
    . If you know the file is from another program which is incompatible with Microsoft Office Excel,click Cancel then open this file in its original application.If you want to open the file later in Microsoft Office Excel,save it in a format that is compatible,such as text format.
    etc
    Code is
    Class.forName("org.gjt.mm.mysql.Driver");
    Connection conn = DriverManager.getConnection("xxxxxx");
    Statement st = conn.createStatement();
    StringBuffer sb = new StringBuffer();
    sb.append("SAP#" + "\t");
    sb.append("x-plant status" + "\t");
    sb.append("Total Amount" +"\t");
    sb.append(">90 days" + "\t");
    sb.append("\n");
    try
    String query="select * from temp_Xplant";
    ResultSet rs = st.executeQuery(query);
    while(rs.next()){
    sb.append(rs.getString("sapNo") + "\t");
    sb.append(rs.getString("status")+ "\t");
    sb.append(rs.getString("amt") + "\t");
    sb.append(rs.getString("days") + "\t");
    sb.append("\n");
    conn.close();
    st.close();
    catch (Exception e)
    out.println("error");
    conn.close();
    st.close();
    response.setContentType("application/vnd.ms-excel");
    response.setHeader("Content-Disposition", "attachment; filename=\"test.XLS\"");
    I can open them after clicking OK, but before that it is showing the above error message
    Thank you
    Edited by: priyap on Apr 3, 2008 4:54 AM

    hi,
    there are some specific restrictions in downloading data in alv.
    i.e you cannot have morethan 1024 characters that can be downloaded in single row.
    so change your report columns accordingly.

  • Problem while downloadind data from ALV in excel format.

    Hi Experts,
    I have developed one ALV Report.
    it have 53 columns. when i tried to download it in excel format using standard functionality, all columns are not coming in one line i.e 50 cloumns in one line and rest columns to the next line.
    For Example.
    Row 1 Header->    Fld1    Fld2    Fld3   Fld4   Fld5 
                               Fld6    Fld7
    Row 2 Values->    Val1    Val2    Val3  Val4   Val5
                               Val6    Val7
    how i will get all these 53 columns in one line in EXCEL..
    its urget........
    Usefull answer will be rewarded...

    hi,
    there are some specific restrictions in downloading data in alv.
    i.e you cannot have morethan 1024 characters that can be downloaded in single row.
    so change your report columns accordingly.

  • Error in subroutine READ_NAMTB while transferring data from HCM to xRPM.

    Hi Guys,
    I am facing a problem while transferring data from HCM to xRPM via ALE.
    We are getting the error " Error in subroutine READ_NAMTB" during the Inbound Processing of Idocs in xRPM.
    We have used the standard message type HRMD_ABA and IDoc type HRMD_ABA04 without any modifications.
    Request you all to kindly let me know the solution to fix this issue asap.
    Thanks in advance,
    Punkuj..

    It was a bug in SP2, it is fixed in SP2 Patch 4.
    Cheers !!
    Zaheer

  • Export data from forms to excel

    HI
    In my application im trying to export data from forms to excel.Everything works fine.First of all im using get_file_name for selecttion of file and passing it to ole2 package as follows
    FILENAME := GET_FILE_NAME(File_Filter=> 'XLS Files (*.xls)|*.xls|',dialog_type=>SAVE_FILE);
         ARGS:=OLE2.CREATE_ARGLIST;
         oLE2.ADD_ARG(ARGS,Filename);
         OLE2.INVOKE(WORKSHEET,'SAVEAS',ARGS);
    The problem is if i select an existing file the get_file_name itself raises one message ".....file already exists Replace an existing file?"
    Similarly the excel also also raises the same message "".....file already exists Replace an existing file?".I want to suppress atleast one of them? Could anyone help for this problem?
    appreciate ur help
    THANKS

    Looks like...
    ole2.set_property( ex_app, 'DisplayAlerts', false );
    where "ex_app" variable Excel Application -
         ex_app:=     ole2.create_obj('Excel.Application');
    and more Question:
    When i close excel app - in process viewer i see "excel.exe"
    ole2.release_obj don't work :(

  • Problem while retrving data from a view

    Hi Friends
      i have a problem while retriving data from a view <b>v_t685a</b>.
    the error message is :""" "V_T685A" is not defined in the ABAP Dictionary as a table, projection view or database view."""
    i wrote : select single VTEXT1 from V_T685A into w_cst_jin1 where
                        KSCHL = 'JIN1' and
                        KAPPL = 'V'.
    how to retrive the data.
    waiting for quick response
    Regards
    Mukesh

    Hi
    This is a Maintenance View, not a Database View
    SO can't fetch data using select statement.
    You can use the Table <b>T685</b> directly to fetch the condition Types data straight away instead of the view. write the same select for this table and use.
    Regards
    Anji
    Message was edited by:
            Anji Reddy Vangala

  • HT201269 while transferring data from iphone 3GS to iphone 4S SMS details are not getting transferred.

    While transferring data from old iphone 3gs to new iphone4s through itunes the data in messages is not getting transferred.

    @ melfromvictoria
    Have you tried right clicking on the 4s and select "restore from back up"

  • HT1473 Im having problem while transferring songs from PC to Ipod. Ive followed all steps 'File Add to Library' but i cant find songs in my ipod. Ive also synced the ipod and backup as well but still same. what to do?

    Im having problem while transferring songs from PC to Ipod. Ive followed all steps 'File<Add to Library' but i cant find songs in my ipod. Ive also synced the ipod and backup as well but still same. what to do?

    Try:
    iTunes: Finding lost media and downloads
    iTunes: How to re-create your iTunes library and playlists
    Next try:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store
    Also:
    Recovering your iTunes library from your iPod or iOS device: Apple Support Communities

  • Exporting Data from Forms to Excel

    Hi,
    How can I export the data from Forms to Excel like which Export function in the Oracle Applications.
    Thank you,
    Voon

    Hello,
    By using dde package you can export the data from Form to Excel. Here is the sample code which i have used. you can write this code in the when_button_pressed trigger.
    declare
    appl_name varchar2(255);
    channel_id pls_integer;
    application_id pls_integer;
    x number;
    y number;
    V_TIME VARCHAR2(30);
    begin
    if :global.application_id is not null then
    message('Application already open');
    else
    appl_name := 'c:\program files\microsoft office\office\excel.exe';
    :global.application_id := dde.app_begin(appl_name,dde.app_mode_normal);
    end if;
    if :global.channel_id is not null then
    message('Communication channel already established.');
    elsif :global.application_id is null then
    message('Application must be launched first.');
    else
    :global.channel_id := dde.initiate('excel','book1');
    end if;
    DDE.POKE(:global.channel_id,'R1C1','Col1 Heading',DDE.CF_TEXT,1000);
    DDE.POKE(:global.channel_id,'R1C2','Col2 Heading',DDE.CF_TEXT,1000);
    DDE.POKE(:global.channel_id,'R1C3','Col3 Heading',DDE.CF_TEXT,1000);
    FIRST_RECORD;
    X := No of Records;
    for y in 2..x
    loop
    launch_excel is a program unit--
    launch_excel(y,:global.channel_id,:block.item1,:block.item2,::block.item3);
    next_record;
    end loop;
    FIRST_RECORD;
    EXCEPTION
    WHEN DDE.DDE_APP_FAILURE THEN
    MESSAGE('Could not launch application for DDE operations.');
    RAISE FORM_TRIGGER_FAILURE;
    WHEN DDE.DDE_INIT_FAILED THEN
    MESSAGE('Could not initialize DDE communication channel.');
    RAISE FORM_TRIGGER_FAILURE;
    WHEN DDE.DMLERR_NO_CONV_ESTABLISHED THEN
    MESSAGE('Could not establish DDE communication channel.');
    RAISE FORM_TRIGGER_FAILURE;
    WHEN OTHERS THEN
    MESSAGE('Error: '&#0124; &#0124;TO_CHAR(SQLCODE)&#0124; &#0124;' '&#0124; &#0124;SQLERRM);
    RAISE FORM_TRIGGER_FAILURE;
    END;
    LAUNCH_EXCEL
    PROCEDURE LAUNCH_EXCEL(
    y in number,
    channel_id pls_integer,
    param1 varchar2,
    param2 VARCHAR2,
    param3 varchar2) IS
    v_rowno varchar2(20) := 'R'&#0124; &#0124;y;
    BEGIN
    dde.poke(channel_id,v_rowno&#0124; &#0124;'C1',col1,dde.cf_text,2000);
    dde.poke(channel_id,v_rowno&#0124; &#0124;'C2',col2,dde.cf_text,2000);
    dde.poke(channel_id,v_rowno&#0124; &#0124;'C3',col3,dde.cf_text,2000);
    EXCEPTION
    when others then
    message('Error --'&#0124; &#0124;sqlcode&#0124; &#0124;sqlerrm);
    message('Error --'&#0124; &#0124;sqlcode&#0124; &#0124;sqlerrm);
    raise form_trigger_failure;
    END;
    null

  • Problem while loading data from ODS to infoobject

    Hi guys,
    I am facing problem while loading data from <b>ODS to infoobject</b>.
    If I load data via PSA it works fine but
    if I load data without PSA its giving error as Duplicate records.
    Do u have any idea why it is so.
    Thanks in advance
    savio

    Hi,
    when you load the data via the PSA, what did you select? Serial or Paralel?
    If you select serial most likely you don't have duplicates within the same datapackage and your load can go through.
    Loading directly in the IObj will happen thefore if you have the same key in two different packages, the "duplicate records" will be raised; you can perhaps flag your IPack with the option "ignore duplicate records" as suggested...
    hope this helps...
    Olivier.

  • While transfering data from my pc to my mac  my pc crashed. what do i do now??

    While transfering data from my old pc to my new mac the pc crashed what do i do now?

    If you used Migration Assistant and do not have the PC data on an external disk you can merge the two accounts by copying the data to through Shared folder.

  • Problem while reading data from Serial Port

    Hi All,
    I am facing some problem while reading data from Serial Port.
    As per the requirement I am writing the data on Serial Port and waiting for response of that data.
    Notification for data availabilty is checked with method public void serialEvent(SerialPortEvent event) of javax.comm.SerialPortEventListener.
    When we are writing data on the port one thread i.e. "main" thread is generated and when data availability event occures another thread "Win32SerialPort Notification thread" is generated. This creates problem for me as we can't control thread processing.
    So can anybody pls explain me how to overcome this problem?
    Regards,
    Neha

    My Problem is:-
    I am simoultaneouly wrting data on port & reading data from port.
    First I write data on port using outputStream.write() method. Now when target side sends me response back for the request on serial port DATA_AVAILABLE of SerialPortEventListner event occured,we are reading data from serial port.Now till the time we didn't get the response from target next command can't be written on the serial port. When we are writing data on port main thread is executed.Now my problem starts when DATA_AVAILABLE event occured.At this point another thread is created.Due to this my program writes data of next command without reading response of previous command.To solve this prob. I have used wait() & notify() methods as follows.But again due to this my pc hangs after execution of 2 commands. (PC hang in while loop in a code provided below.)
    From SOPs I could figure it out that after 2 commands we are not able to write data on serial port so DATA_AVAILABLE event doesn't occure n pro. goes in wait state.
    Can anybody help me to solve this issue.
    Neha.
    Code:
    public void serialEvent(SerialPortEvent event)
              switch (event.getEventType())
                   case SerialPortEvent.BI:
                   case SerialPortEvent.OE:
                   case SerialPortEvent.FE:
                   case SerialPortEvent.PE:
                   case SerialPortEvent.CD:
                   case SerialPortEvent.CTS:
                   case SerialPortEvent.DSR:
                   case SerialPortEvent.RI:
                   case SerialPortEvent.OUTPUT_BUFFER_EMPTY:
                                 break;
                   case SerialPortEvent.DATA_AVAILABLE:
                        try
                             dataThread = Thread.currentThread();
                             dataThread.setPriority(10);
                             dataAvailable = true;
                                                                                    byte[] tempArray=new byte[availableBytes];
                                        inputStream.read(tempArray);
                                                                       catch (IOException io)
                             SOP(io, "Error in serialEvent callback call for event DATA_AVAILABLE");
    public void  writetoPort(byte[] data) throws IOException
                             outputStream.write(data);
                              while(finalTimeOut >= actualTime)
                            if( ! dataAvailable)
                                    actualTime = System.currentTimeMillis();
                           else
              synchronized (mainThread)
                   mainThread = Thread.currentThread();
                   mainThread.wait();
    public  void sendDatatoUser(byte[] b) throws Exception, HWCCSystemFailure
              obj.returnData(b);
              synchronized(mainThread)
                   mainThread.notify();
                                                           

  • Fatal error while transferring data from one bb to another

    I was trying to transfer data from one bb to a different bb using the bb desktop manager tool.  It collected all the data from the first bb fine and then while transferring data to the new one it said a fatal error occured to try again.  That bb will not even turn on now.  No white screen or anything.  Its like there is no operating system.  I don't know what to do.  I tried to connect it and just update the software but that isnt working either.  Says it is not responding during initialization! I think I killed it.... any ideas what to do???

    You can try to reload the OS in one of the following ways
    http://www.blackberry.com/btsc/KB03485
    http://blackberryfaq.net/index.php/How_do_I_wipe_the_BlackBerry_using_Jl_Cmder%3F
    If someone has been helpful please consider giving them kudos by clicking the star to the left of their post.
    Remember to resolve your thread by clicking Accepted Solution.

  • Error while exporting data from ABAP to Excel

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

    Solved

  • Importing data from form to excel (beginner)

    I need assistance with a pretty lengthy survey I'm creating. I am finding it difficult to find answers on the question/help and in the forums largely because I don't know what the right questions to ask are.
    I would like to create a survey where the end-uese fills it in and emails it to me. I would like to take the xml file received via email and import the results into an excel spreadsheet, one line per each survey result.
    The biggest problem is that I know enough to get myself into trouble but not enough to get myself out of it and any and all assistance would be appreciated.
    Thanks

    Similar to the original posting, I have also created a form for individuals to complete and email back to me. I will not be receiving a one time response, however, these individuals will email me a newly completed copy of the form at various times throughout the year for multiple years.  I need to get the data into a designated excel spreadsheet each time I receive a newly completed form. What is the simplest way to achieve this?
    Thank you

Maybe you are looking for