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

Similar Messages

  • Create a Excel File in a Background Job

    Hi SAP Gurus,
    I am trying to create an Excel file using a background job but it is not possible.
    In foreground mode i get a file.
    Can someone give an explanation for that? Or someone have a workaround ??
                   Best Regards
                          João Fernandes

    João,
    If you have successfully demonstrated that SAP can write an output to an excel file, then it can do this in background as well as foreground.  The problem is probably not with the fact that it is 'Excel', but that it is trying to write a file in the background to a destination file location that is unknown to the system.
    Generally, without special setup, SAP software is unaware of most file locations that are outside of the SAP system itself.  When you log on through the SAP Gui, the SAP back end can "learn" about certain additional file locations through your PC setup and the SAPGUI session.  This 'knowledge' is lost as soon as you commit your program to a background process.
    Talk to your Basis person, and tell him what you wish to do.  This functionality is possible to do, but probably not in the way you are expecting.
    Best Regards,
    DB49

  • 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 throug

    Hi every one,
    I have a requirement, to upload data from excel sheet to sap every month end, means some G/L posting from external system to sap, I need to interface this system with sap,
    Here, in my external system, I have possibility to get month end data in Excel format; I need simply upload this into sap.
    I have developed BAPI program for this, and its working fine. But now my problem is, my people want to execute this program in background, they ask me to do background schedule.
    Here I know how to do background schedule, but my question is how system will respond in background in case of u2018ALSM_EXCEL_TO_INTERNAL_TABLEu2019 function module.
    Please give the suggestions regarding to the excel upload in background schedule.
    Regards,
    Sreenu.

    Hi ,
    Please refer to the following link
    Re: Upload Excel file in Background mode: Code
    upload an excel file in the server  with a background job
    It might give you some idea.
    Regards,
    Bhanu.

  • 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

  • Excel file upload using LSMW

    HI all,
    Is it possible to upload excel file using LSMW method?
    If it is? Plz tell me the process ASAP.
    Thanks & regards,
    Srini

    Hi,
    It's no possible to upload directly Excel file in LSMW.
    You must transform to an flat File.
    There are 6 delimiters
    - No Separator
    - Tabulator
    - Semi-Colon
    - Comma
    - Blanks
    - Others
    Rgds

  • Validation after Excel File Upload in Table Maintenance

    Hello All,
    I've done extensive research on this topic and still have yet to find the answer. I have created a custom button in the TMG to upload an Excel file to the table maintenance using the FM CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD. I updated the EXTRACT and TOTAL table so it will show up in the TMG interface, but no validations occur. So, I am now trying to do the validations of this file upload. I would like to validate each record and allow the user to modify the error record then continue validating the rest. Essentially I would like to mimic the functionality that occurs when multiple records are copied to the table maintenance and validated one by one. Updating the EXTRACT table through ABAP, does not reach the PAI where the validations occur.
    Is this approach possible? If not, what would be the best way to do validations, inform the user of the error record, and allow modification in the table maintenance interface?
    Thanks,
    Justin

    Or just a report program - have the file name on the selection screen.
    1) Upload the file
    2) Validate the file and produce error messages.
    3) Based on the validations, update the table.
    Rob

  • Excel file Upload in NWDS 2.0.9

    Hi ,
    I am working on NWDS 2.0.9. Can somebody tell me how to upload an Excel file, using      File Upload UI element and update my Context.
    -->IWDResource cannot be implemented in this version.
    -->Also FileUpload UI Element does not have a resource property, in this version.
    I have tried using POI , jxl but my code generates NoClassDefFoundError: or FileNotFoundError:
    Thanks in advance.
    Shibin
    PS: If some one can give me a simple code it will be very useful.
    Edited by: Shibin Kumblat on Mar 20, 2008 2:01 PM

    hi ,
    here is the code
    Workbook wb= Workbook.getWorkbook(new File("e:/file1.xls"));
    for (int shNo = 0; shNo < wb.getNumberOfSheets(); shNo++)
         Sheet sheet = wb.getSheet(shNo);
         for (int i = 1; i < sheet.getRows(); i++)
              for (int j = 0; j < sheet.getColumns(); j++)
                             wdComponentAPI.getMessageManager().reportSuccess(""+sheet.getCell(j,i).getContents());

  • Excel file upload in ODI 11g

    Hi,
    I am trying to define new data server in topology manager in order to upload excel file, and when i test the connection i got this error:The specified DSN contains an architecture mismatch between the Driver and Application.
    I did all the steps required before this step.
    can anyone help me with this error
    thanks in advance

    You might be using 32 bit driver in a 64 bit operating system. Please download the 64 bit driver and use the same for creating DSN

  • Create and Format an Excel File as a Background Process(Application Server)

    Hi all,
    I have a requirement to Output a formatted(Bold fonts, Merged Cells etc.) Excel File.
    It is to be run as background process. So ideally, the file will be produced in the ApplicationServer and will already contain the formatting. If I am to use ole2 functions such as
    *--Opening the existing document
       call method of gs_wbooks 'Open' = gs_wbook
       exporting #1 = file_path.
    Is this possible? can file_path point to the file created in the ApplicationServer?
    Any answers, suggestions or workarounds would be greatly appreciated.
    Thanks in Advance

    no.
    that works only in dialog
    A.

  • Excel file upload failing

    hi all,
    i have a webdynpro application,
    in which i am uploading an excel 
    file, and reading the same file, it is working fine.
    But the problem is, Some times while uploading
    it is taking  time for the processing. after that it is failing to upload and the application is refreshing
    (ie the control is going to the initial screen).
    i am not able to understand the problem.
    please suggest me the solution soon.
    regards ,
    Brahmanandam Ausali

    hi armin,
    I am using SP14.
    I have not gone to OSS note.
    regards
    Brahmannadam ausali

  • Excel file upload restriction

    Dear,
    I have developed a object which upload any type of file( mainly excel file ) form desktop.
    Now i want to restrict user to upload the excel file , if that file is open in desktop.
    Please give me idea how i ll solve this issue ??????
    Thanks & Regards,
    Ajit

    Hi Ajith
    If you use the FM-TEXT_CONVERT_XLS_TO_SAP with enabling exception, system will say clearly 'Excel file & cannot be processed'
    You might tried without exception.
    Still you are not clear send your requirements.
    Regards,
    Vadamalai A

  • Excel file upload

    Hi All,
    I have a requirement wherein I will have to upload an Excel file into an internal table. This excel file is coming from LLS. I used the GUI_UPLOAD FM... But this FM does not work. I also used TEXT_CONVERT_XLS_TO_SAP FM... But this FM does not work until the data from the source file is copied onto another excel sheet.... Please suggest me a FM which works correctly in such a scenario
    Regards,
    Jean Pearl D'souza

    Hey all I had used the FM TEXT_CONVERT_XLS_TO_SAP in a different way.... I had missed out on a few parametrs.... It is working fine now....
    Thanks and Regards,
    Jean Pearl D'souza

  • 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.

  • LSMW - excel file Upload

    Hi,
    I want to upload the excel file through LSMW, pls let me know how to do this.
    I have converted the excel file to .csv and .txt file and can upload the fiel, but not able to upload when trying to do with .xls file.
    Pls let me know.
    Thanks,
    Raju
    Moderator message: please search for available information, consult LSMW documentation.
    Edited by: Thomas Zloch on Oct 15, 2010 4:23 PM

    Hi,
    It's no possible to upload directly Excel file in LSMW.
    You must transform to an flat File.
    There are 6 delimiters
    - No Separator
    - Tabulator
    - Semi-Colon
    - Comma
    - Blanks
    - Others
    or
    In txn LSMW, then create an object for your purpose. The txn can guide you to create the template.
    The Excel file needs to be converted to a text file and uploaded through LSMW. If necessary, you may need to change the input file so that the column layout matches with the LSMW object.
    or
    But in essence this is what you need to do:
    Create a headers datafile, and a lines datafile.
    Go through the routine of setting up LSMW to read both files, one the subordinate of the other.
    Link files together using "Fields with identical names" button (turns pink!)
    When you specify your structure relations, make the header datafile relate to the header structures, and your lines datafile relate to the lines structures.
    LSMW will work out the loops for you!
    Hope it helps.
    Mathew
    Moderator message: copy/pasted from several sources, do not repeat, might lead to account deletion!
    http://www.google.com/search?hl=en&q=%22Gothroughtheroutineofsettingup+LSMW%22
    Edited by: Thomas Zloch on Oct 15, 2010 4:21 PM

Maybe you are looking for

  • MIGO Base Value.

    Dear Expert Please help me on below scenario. My client is raising PO. The Material cost is 100 INR. While goods receipting, Knowing that material cost is 120 INR. So i am changing the Base value 100 to 120 INR in detail data (Excise item) tab while

  • Adobe Flash Player 11.4 quits working, won't show videos even after reinstalling.

    Had Adobe Flash Player 11.3 r300 and it stopped showing videos, etc. in Firefox a few days ago. Now I've installed v 11.4 r402 and it still gives error message "Adobe Flash Player ... has stopped working." I uninstalled, downloaded again and reinstal

  • Mapping of Address fields

    HI all, I am getting Two address fields from Source side (Sender name, city, country etc & Receiver name, city, country etc). But at the target side (IDOC) has only one Name, city and country fields. how to map these two name, city, country etc field

  • FILE NAMING IN RUNTIME in scheduler/plsql code in 102g. please help, thankU

    Hi, we have a scheduler job which calls/executes a stored procedure that generates a report file. however we need to give file name run at run time and need to copy it to shared folder. we do not want use any shell scripts here and like to complete t

  • Updated G4 eMac to 10.4.11. FCP 5.1 Doesn't Open. Can't Install FCE3 Or 4?

    Not really a problem as I don't usually use my G4 eMac but I don't like it when things suddenly lose functionality. A couple of months ago I updated from OS X 10.4.10 to 10.4.11 and I have noticed recently that FCP 5.1 no longer opens. I also tried t