Custom TCode for Excel File Upload/Import - WebGUI Error

We get an ABAP runtime error when uploading an excel file with a custom tcode using WebGUI.  It works ok with WinGUI.  Any ideas what could be causing that error?
Runtime Errors         RAISE_EXCEPTION
Date and Time          01/05/2011 17:27:16
Short text
     Exception condition "JAVABEANNOTSUPPORTED" raised.
What happened?
     The current ABAP/4 program encountered an unexpected
     situation.
What can you do?
     Note down which actions and inputs caused the error.
     To process the problem further, contact you SAP system
     administrator.
     Using Transaction ST22 for ABAP Dump Analysis, you can look
     at and manage termination messages, and you can also
     keep them for a long time.
Error analysis
     A RAISE statement in the program "C_OI_CONTAINER_CONTROL_CREATORCP" raised the
      exception
     condition "JAVABEANNOTSUPPORTED".
     Since the exception was not intercepted by a superior
     program, processing was terminated.

You can use the below code. One more thing while running make sure there is no unsaved excel sheet open in your system.
FORM sub_create_container .
Create Instance control for container
  CALL METHOD c_oi_container_control_creator=>get_container_control
    IMPORTING
      control = iref_control
      error   = iref_error.
  IF iref_error->has_failed = c_check.
    CALL METHOD iref_error->raise_message
      EXPORTING
        type = 'E'.
  ENDIF.
Create generic container linked to container in screen 100
  CREATE OBJECT oref_container
    EXPORTING
      container_name              = 'CONT'
    EXCEPTIONS
      cntl_error                  = 1
      cntl_system_error           = 2
      create_error                = 3
      lifetime_error              = 4
      lifetime_dynpro_dynpro_link = 5
      OTHERS                      = 6.
  IF sy-subrc <> 0.
    MESSAGE e000 WITH 'Error while creating container'(012).
  ENDIF.
Establish connection to GUI Control
  CALL METHOD iref_control->init_control
    EXPORTING
      inplace_enabled      = c_check
      r3_application_name  = 'EXCEL CONTAINER'
      parent               = oref_container
    IMPORTING
      error                = iref_error
    EXCEPTIONS
      javabeannotsupported = 1
      OTHERS               = 2.
  IF iref_error->has_failed = c_check.
    CALL METHOD iref_error->raise_message
      EXPORTING
        type = 'E'.
  ENDIF.
Create Document Proxy
  CALL METHOD iref_control->get_document_proxy
    EXPORTING
      document_type  = soi_doctype_excel_sheet
    IMPORTING
      document_proxy = iref_document
      error          = iref_error.
  IF iref_error->has_failed = c_check.
    CALL METHOD iref_error->raise_message
      EXPORTING
        type = 'E'.
  ENDIF.
ENDFORM.                    " SUB_CREATE_CONTAINER
FORM sub_create_document  USING    p_sheet TYPE i.
  DATA:  l_title   TYPE char40,
          l_char    TYPE char2,
          l_time    TYPE i,
          l_sheet   TYPE char12.
Calculate the number of sheets to be created
  l_time = p_sheet - 1.
  CONCATENATE 'Assembly Table'(015) v_char INTO l_title
  SEPARATED BY space.
Create document
  CALL METHOD iref_document->create_document                 " Open use Open_document method
    EXPORTING
      open_inplace   = c_check
      document_title = l_title
      no_flush       = c_check
    IMPORTING
      error          = iref_error.
Open Spreadsheet interface
  CALL METHOD iref_document->get_spreadsheet_interface
    EXPORTING
      no_flush        = c_check
    IMPORTING
      sheet_interface = iref_spreadsheet
      error           = iref_error.
Get number of sheets
  CALL METHOD iref_spreadsheet->get_sheets
    EXPORTING
      no_flush = c_check
    IMPORTING
      sheets   = i_sheets
      error    = iref_error.
Reaname he sheet
  READ TABLE i_sheets INTO wa_sheets INDEX 1.
  l_char = p_sheet.
  CONCATENATE 'Sheet' l_char INTO l_sheet.
  CALL METHOD iref_spreadsheet->set_sheet_name
    EXPORTING
      newname  = l_sheet
      oldname  = wa_sheets-sheet_name
      no_flush = c_check
    IMPORTING
      error    = iref_error.
  REFRESH i_sheets.
  CLEAR: l_char,
         l_sheet.
Add sheets
  DO l_time TIMES.
    l_char = sy-index.
    l_char = p_sheet - l_char.
    CONCATENATE 'Sheet' l_char INTO l_sheet.
    CALL METHOD iref_spreadsheet->add_sheet
      EXPORTING
        name     = l_sheet
        no_flush = c_check
      IMPORTING
        error    = iref_error.
  ENDDO.
Get number of sheets
  CALL METHOD iref_spreadsheet->get_sheets
    EXPORTING
      no_flush = c_check
    IMPORTING
      sheets   = i_sheets
      error    = iref_error.
  SORT i_sheets BY sheet_name DESCENDING.
ENDFORM.                    " SUB_CREATE_DOCUMENT
FORM sub_save_document .
  DATA: l_changed     TYPE int4.
Save the document
  CALL METHOD iref_document->save_as
    EXPORTING
      file_name = p_file
      no_flush  = c_check
    IMPORTING
      error     = iref_error.
Close the document
  CALL METHOD iref_document->close_document
    EXPORTING
      do_save     = c_check
      no_flush    = ''
    IMPORTING
      has_changed = l_changed
      error       = iref_error.
ENDFORM.                    " SUB_SAVE_DOCUMENT
Thanks
Subhankar

Similar Messages

  • Function module for Excel file upload

    Hi,
    I am new to APO technical. My requirement is upload excel file data. However commonly used FM in R/3 for uploading excel files from presentation server are not avaliable ( KCD_EXCEL_OLE_TO_INT_CONVERT , ALSM_EXCEL_TO_INTERNAL_TABLE , TEXT_CONVERT_XLS_TO_SAP etc) in APO system(SCM 4.0 version).
    Let me know if there are any other FM avaliable and procedure to upload the excel files in APO?
    Please let me know if you require any further details.
    Regards
    Reddy

    Hi
    The data structures in APO differ from R/3 (e.g. data is held in livecache tables) and hence the FM's you mention will not work in APO.
    Try looking at the Wiki pages as there is a lot of useful information there for you, e.g. this example code to download and upload data between Excel and APO:
    Link: [Download SCM data into Excel|http://wiki.sdn.sap.com/wiki/display/SCM/DownloadPlanningdataintoexcel]
    Have a look around the Wiki, hopefully it will help you out
    Regards
    Ian

  • LSMW Errors for Excel file upload

    Hi all,
    We've loaded an Excel file with 20,000+ records into SAP using LSMW and a background run. However, the LSMW returned errors for about 2,000 of those records and seems to have processed the other 18,000. Questions as follows:
    1. Is there a way to extract the 2000 records into another Excel file?
    2. If so, how can I isolate the 2000 records so that I can reload them with correct information?  I do not want to have to go through each record one by one to find them.
    3. How can I identify what the problem was for a record that produced an error?
    Thanks in advance. Points will be awarded for helpful answers.

    u have used LSMW which will normally create a Session which will be executed using SM35 in background mode...Goto the session and click on errors...the errors are been shown up..U can correct there itself or else prepare another one with correct data and do a lsmw once again.

  • Excel File Upload In Webdynpro For ABAP

    Hi All,
    I have a doubt regarding EXCEL file upload for Webdynpro for ABAP.
    I am able to get the path of file using 'FILEUPLOAD' UI element.Now I need to upload the EXCEL file into ALV.I have tried out with GUI_UPLOAD and other excel upload function module.But these Function Module throws Dump.
    Can you please suggest how to go about it.It will be a great help if u can suggest any function module or method.

    Hi Amita,
    Insetad of using GUI_UPLOAD use 'HR_KR_XSTRING_TO_STRING'
    Here is the sample code,
    TYPES :BEGIN OF str_itab,
                  name(10) TYPE c,
                  age(10) TYPE c,
                 END OF str_itab.
    DATA : t_table1 TYPE STANDARD TABLE OF str_itab,
           i_data TYPE STANDARD TABLE OF string,
                   lo_nd_sflight TYPE REF TO if_wd_context_node,
                    lo_el_sflight TYPE REF TO if_wd_context_element,
                    l_string TYPE string,
            fs_table TYPE str_itab,
                    l_xstring TYPE xstring,
    fields TYPE string_table,
    lv_field TYPE string.
    DATA : t_table TYPE if_main=>elements_data_tab,
    data_table TYPE if_main=>elements_data_tab.
      * get single attribute
    wd_context->get_attribute(EXPORTING name =  `DATASOURCE`  
                              IMPORTING value = l_xstring ).
    CALL FUNCTION 'HR_KR_XSTRING_TO_STRING'
    EXPORTING
    in_xstring = l_xstring
    IMPORTING
    out_string = l_string.
    SPLIT l_string  AT
    cl_abap_char_utilities=>newline INTO TABLE i_data.
      * Bind With table Element.
    LOOP AT i_data INTO l_string.
    SPLIT l_string AT cl_abap_char_utilities=>horizontal_tab INTO TABLE
    fields.
    READ TABLE fields INTO lv_field INDEX 1.
    fs_table-name = lv_field.
    READ TABLE fields INTO lv_field INDEX 2.
    fs_table-age = lv_field.
    APPEND fs_table TO t_table1.
    ENDLOOP.
    lo_nd_sflight = wd_context->get_child_node( 'DATA_TAB' ).
    lo_nd_sflight->bind_table( t_table1 ).
      ENDMETHOD.
    if correct give correct answer
    Thanks & Regards,
    Meenachi.R

  • Excel file upload in background

    Hi
    any one inform me how to Excel file will be Executed as a background job.
    The Excel file will be executed as a background job.
    This will eliminate issues related to network speed,
    time-outs,user logging off,ect;
    and the need for the user to remain logged in to the transaction till it finishes
    execution. After the background job completes the output report will be sent to the
    user via email as an attachment.
    Regards
    Gopal
    Duplicate thread.
    Edited by: kishan P on Aug 24, 2010 10:39 AM

    hi,
    function module for email attachment  -
    function module SO_DOCUMENT_SEND_API1
    function module for background schedule - u2018ALSM_EXCEL_TO_INTERNAL_TABLEu2019
    When scheduling a job in the background the appropriate statement to read in your file is OPEN DATASET, and the file must be on the file system that the SAP server can see.
    At anytime, a user can switch of the Personal Computers even though the job is still running in the background.  Therefore GUI_* and WS_* function modules are not designed to work in that way, as they need to access your personal computer  file.
    To choose the correct download method to used, you can check the value of SY-BATCH in your code,
    if it is 'X' use OPEN DATASET and if it is ' ' use WS_UPLOAD.
    link for help -
    Re: Excel file upload through BAPI in BACKGROUND
    Rgds
    Raj

  • Versioning for excel docs uploaded to workspace

    I need info on how to apply versioning for Excel documents uploaded to Oracle Beehive Workspace.
    I actually want to enable versioning for excel documents, which enable me to track the changes made to the documents and revert to previous versions if required.
    Any help is appreciated.
    Thanks,
    Smita

    Hi Jereen,
    Thanks For the information. But I did not understand if the versioning is getting applied to Excel documents uploaded to workspace.
    My requirement is like.
    I have a folder in my workspace. I upload an Excel document into the folder. Later When I modify the file and upload it back, I should be able to see what are the changes from previous file and if required I need to revert back to old version. Main thing required is I should be able to view the updates done.. just like the feature available for wiki pages, where I can compare the current version with the previous version and understand what was updated.
    Please help me out on how to have such a feature enabled for Documents uploaded to workspace.
    Thanks,
    Smita

  • How to increase page size for balance file upload in Workspace.

    Hi All,
    Please suggest how to increase page size for balance file upload in shared Workspace pages.
    Thanks,

    A word of caution is in order regarding changing from facing to non-facing and back again. If you have overridden master page items, you'll get a second, non-overridden copy on all the even-number pages when that half of the master page is re-applied. This applies to master text frames which override automatically when text flows into them as well as to objects you manually override. I think you'll find this particular technique also only works for master text frames, whereas the Layout Adjustment should work in all situations where frames snap to guides.

  • Custom Icon for application file

    I can make director allow me to have a custom icon for appliacation file.
    In director I have attempted this several times where I have tried to have my appliaction file have an icon.  I have purchased two icon program Candy Bar and Fastincs trying to remedy this problem.
    As you see here I am using an ins file created in Fastincs.  Now here is an image to the path and the icon itself Applipcations/ Adobe Director 11/3 HorseLogo.mac.ins
    So there is the setup now when I complile for my program file I get this.
    See the grey Director icon I don't want that I want the three horse logo.
    I also tried to assign the logo after publishing the file.
    then I drag my icon file in
    The program created in director still wont see the icon file.
    If I use Candy bar (icon application)  I get a  different result. The icon works
    in both finder and on the task bar
    This is exactly what I want.
    I works until I try to move the entire package into an installer program  I am using BitRock.  When I compile the installation program then try to run the application I get the following message
    If I choose ignore the install continues.  But I have no icon.
    I am desperate , weeping , screaming , and almost a lost cause, any help any help at all I could really use.
    Thanks
    Robin aka innish

    Hi Robin,
    I'm more of a PC person rather than Mac. I would recommend you look at the Resource and Icon Editor page at:
    http://collab.directorforum.com/Resource_and_Icon_Editor
    It may fix your icon issue from Director.
    Dean

  • Custom certificates for JAR file signing

    Hi,
    Can anyone please let me know how to check that we have custom certificates for JAR file signing set up in our instance
    Thanks,
    Praveen

    It depends on the version of your $ADJVAPRG. See the referenced note.
    How to use,create and /or update Digital Certificates for Jinitiator in 11i Applications
    http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=365735.1

  • Reason to set MaxErrorCount along with Propogate value for Excel Files

    Hi,
    I had an ETL earlier which processed CSV files from a folder. The requirement was to load the error files into a Rejected folder but continue to process all the files from the source Folder. This requirement was satisfied by setting the value of the
    system variable "Propogate" in EventHandler section for DataFlowTask to "false".
    MaxErrorCount value for the ForEach Loop is having its default value as "1".
    When tested, it was working perfectly fine
    Now currently there is an Excel file as source having same requirement as above. But even when then variable "Propogate" was set to "false" as above, the execution was getting stopped when an error file was found.
    Later I found the below link :
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/0065b5c2-f633-4cbf-81f9-031d1ed25555/how-to-skip-wrong-excel-files-ignore-errors-on-ssis-foreach-task
    As mentioned in the link, I have done below changes
    1)Set MaxErrorCount for ForEachLoop to 1000
    2)"Propogate" variable is set to false
    Now this is working perfectly fine.
    Can you please let me know why did the setting of "Propogate" worked for CSV but did not work for Excel. For Excel files why was an additional setting for MaxErrorCount  was required.
    It would be very much helpful if I can get a detail information on the above
    Thanks,
    Raksha
    Raksha

    Hi Raksha,
    In you SSIS package, setting the Propagate system variable to False of the Event Handler prevents the Data Flow Task (DFT) propagating its failure to its parent container. For the ValidateMetadata property of a Data Flow Task Component, it doesn’t only affect
    the DFT at design time but also at runtime. During the Validation phase, a component is supposed to check to make sure that the cached metadata in the package is still in sync with the underlying table/view/query. If there is a mismatch, the component returns
    a special status (VS_NEEDSNEWMETADATA). When this happens at design-time, SSIS triggers a metadata refresh by calling ReinitializeMetadata(). At runtime, this results in an error.
    In your scenario, by setting the ValidateMetadata property to false, the error of the DFT is avoided, hence, you don’t need to set the MaxErrorCount to a value more than 1.
    For more information about how ValidateMetadate property works, please see Matt’s answer in the following thread:
    http://stackoverflow.com/questions/3297097/validateexternalmetadata-property-what-exactly-does-this-do 
    Regards,
    Mike Yin
    TechNet Community Support

  • Custom code for Flat file reconciliation on LDAP

    Hello,
    I have to write a custom code for flat file reconciliation on LDAP as the GTC connector wasn't working entirely.
    Could someone help me out with this.. How do i do this ??
    Thanks

    flat file reconciliation on LDAPWhat do you mean by Flat File on LDAP ?
    If you want to create Flat File connector then search google for reading a flat file using Java.
    Define RO Fields and do mapping in Process Defintion. You can use Xellerate User RO for Trusted Recon.
    Make a map of CSV that and Recon Field
    Call the Reconciliation API

  • Applet for multiple file upload

    Hi All
    I have a requirement for multiple file upload where user can select multiple files as well as folders.
    Would appreciate any pointers.
    Thanks.

    Google "java file upload"

  • HTML File Upload - using DAD - Error

    I have set up my document table, the document upload package is in there, but my HTML for the file upload is not working correctly:
    DAD info
    DAD Name: /pls/portal
    Document Table: dw_target.documents
    Document Access Procedure: document_api.download
    here is the upload HTML:
    <html>
    <head>
    <title>test upload</title>
    </head>
    <body>
    <form enctype="multipart/form-data" action="http://MYURL:7777/portal/pls/portal/dw_target.document_api.download" method="post">
    File to upload: <input type="file" name="file"><br>
    <input type="submit" value="Upload">
    </form>
    </body>
    </html>
    But i get this error when i try to upload a doc:
    The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.
    anyone have any insight on how to get the file upload to work (specifically how to configure the HTML to correctly use the upload process?
    using Oracle App Server 10g
    jason

    Pschar,
    What is "dw_target.documents"?
    Joel

  • Have been trying all weekend to upload Jpegs- either Send does not work or shows files uploading then shows error- never had this problem with Send Now-16 images total size 92MB-largest image 13MB

    Have been trying all weekend to upload Jpegs- either Send does not work or shows files uploading then shows error- never had this problem with Send Now-16 images total size 92MB-largest image 13MB

    Hi Ciaran19,
    Are you sending files from the Adobe Send interface, Adobe Reader, or the Outlook plug-in?
    Have you checked to see whether the files that you're sending appear in the Recent Files/Sent Files list when you're logged on to https://cloud.acrobat.com? (It could be that they're uploading, but not being sent.)
    It would also be worthwhile to send the files in smaller batches, to see whether a particular file or files is problematic, and causing the error.
    Please let us know how it goes. If you're still having trouble, please let us know where you're sending from, and whether you're able to send the files in smaller batches. It would also be helpful to know the exact error message that you're receiving.
    Best,
    Sara

  • Custom thumbnail for a file type, not a single file

    I understand that when I upload an asset to the DAM of a file type for which CQ5 doesn't support thumbnail generation (Excel .xls and .xlsx, in my case), CQ5 will use a default dogeared-page icon for the thumbnail.  it also writes an error-level message to the log to the effect that it can't generate a thumbnail.  E.g.,
    15.10.2012 12:03:47.078 ERROR [JobHandler: /etc/workflow/instances/2012-10-15/model_1135358760340484:/content/dam/FY06NIVDetailTable1.xls/jcr:content/renditions/original] com.day.cq.dam.commons.handler.AbstractAssetHandler createThumbnails: cannot create thumbnails for asset [/content/dam/FY06NIVDetailTable1.xls], failed loading graphical representation for rendition [/content/dam/FY06NIVDetailTable1.xls/jcr:content/renditions/original].
    The error message is mostly harmless, but I would like to prevent it.
    And I understand that I can add a thumbnail after the fact.  But despite the language in the document, apparently this thumbnail does not apply to subsequent uploads (for all files of the same type).
    Is there a way to establish a thumbnail image that applies to subsequent uploads?

    Hi David,
    Thumbnail upload (or for that matter any rendition upload) is specific to that image and it will not apply to set of images.
    If we want to apply some custom thumbnail instead of the default one either we need to override the default image or custom workflow step is required.
    If we override the default image it will apply acroos the DAM.
    Regarding custome workflow step. This step will be added after thumbnail creation step in DAM Update Asset workflow(this wf is responsible for creating all renditions). In this workflow step you can check whether thumbnail is created or not if not create thumbnail of your desire.

Maybe you are looking for