Uploading XL data in background(SM37)

Hi Experts,
I am uploading XL sheet data in foreground. It is working fine. But when i sheduled in background using SM36 then JOB IS CANCELLED.
SEE LOG
Job started
Step 001 started (program ZYK_TEST1, variant &0000000000001, user ID DEVELOPER)
Excel file C:\Documents and Settings\ky74217\Desktop\req.xls cannot be processed
Job cancelled after system exception ERROR_MESSAGE
MY CODE IS
type-pools: TRUXS.
types: begin of t_mara,
  matnr type char10,
  end of t_mara.
data: i_tab type standard table of t_mara,
      i_raw type TRUXS_T_TEXT_DATA,
      inter type standard table of ALSMEX_TABLINE.
parameters pa_mat type RLGRAP-FILENAME.
if pa_mat is initial.
  write:/ 'ok', pa_mat.
  else.
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
      EXPORTING
        filename                      = pa_mat
        i_begin_col                   = '1'
        i_begin_row                   = '1'
        i_end_col                     = '1'
        i_end_row                     = '1'
      tables
        intern                        = inter.
*CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
  I_FIELD_SEPERATOR          =
  I_LINE_HEADER              =
   i_tab_raw_data             = i_raw
   i_filename                 = pa_mat
tables
   i_tab_converted_data       = i_tab.
write: 'done'.
ENDIF.
Can anyone suggest.
regards,
kiran

There are many threads already with this question , do a little search at sdn with [upload excel file background|https://www.sdn.sap.com/irj/scn/advancedsearch?query=uploadexcelfile+background&cat=sdn_all]
Basically, the FM you call use Sapgui functions to access a local drive of your workstation and call Excel, Three reasons that result in a failure in background mode.
Regards

Similar Messages

  • ERROR while uploading the data into ztable with background processing

    Hi gurus,
    i am trying to upload the data from excel file to internal table 
    its working fine ..
    but........
    if i try to upload the data with background processing , in sm37 it is saying "error during the upload of clipboard contents".
    Regards,
    Sri

    Hi,
    FM GUI_UPLOAD doesnt work in background, use dataset to upload it from application server.
    refer below code
    *--Local Variables
      DATA : l_file  TYPE string,
             l_line  TYPE string,
             l_index TYPE sy-tabix.
    *--Clear
      CLEAR : l_file.
      l_file = p_ipfile.
    *--Read the data from application server file.
      OPEN DATASET l_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
      IF sy-subrc NE 0.
    *--Error in opening file
        MESSAGE i368(00) WITH text-005.
      ENDIF.
    *--Get all the records from the specified location.
      DO.
        READ DATASET l_file INTO l_line.
        IF sy-subrc NE 0.
          EXIT.
        ELSE.
          SPLIT l_line AT cl_abap_char_utilities=>horizontal_tab
                          INTO st_ipfile-vbeln
                               st_ipfile-posnr
                               st_ipfile-edatu
                               st_ipfile-wmeng.
          APPEND st_ipfile TO it_ipfile.
        ENDIF.
      ENDDO.
    Regards,
    Prashant

  • Uploading data in Background - for CJ27 LSMW recording or BDC

    Hi
    1. please suggest the BAPI for creating project with reference to standard project definition/WBS similar to CJ27 or CJ20N with copy project method
    2. we tried to upload the data in background for LSMW recording and BDC but geting runtime error with raise exception and GUI can not be reach error
    recording done using t.code. cj27
    suggest the suitable method or solution for above

    Hi,
    Refer to this link..creation of project definition and wbs element

  • Uploading sales orders in background

    Hi everyone,
    Iam trying to upload sales orders in background.As my program is a customised program of the standard sales order uplaod program RVINVB10 ,it is a direct input program which updates the tables using the function modules.
    So to run direct input programs in background we are using transaction BMV0,creating a job and running it with the desired variant.the file which has the salesorders to be uploaded is also in the application server.
    the problem is we have to upload bulk data so when ever an error occurs in the transaction BMV0,it says "Job cancelled after system exception ERROR_MESSAGE" . but my requirement is it should log the error and continue creating the other orders and log all the errors possible instead of cancelling the job.
    please help.
    Regards,
    Sravanthi

    Hi,
    One your bapi has returned the error table  'GT_RETURN'... you can use the following logic...
    LOOP AT gt_return INTO gs_return WHERE type CA 'AE'.
        CLEAR gs_bapi_errors.
        CALL FUNCTION 'MESSAGE_TEXT_BUILD'
             EXPORTING
                  msgid               = gs_return-id
                  msgnr               = gs_return-number
                  msgv1               = gs_return-message_v1
                  msgv2               = gs_return-message_v2
                  msgv3               = gs_return-message_v3
                  msgv4               = gs_return-message_v4
             IMPORTING
                  message_text_output = gs_bapi_errors.
        APPEND gs_bapi_errors TO gt_bapi_errors.
      ENDLOOP.
    * Update successful
      IF gt_bapi_errors[] IS INITIAL.
        REFRESH gt_return.
        CLEAR ls_return.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
             EXPORTING
                  wait   = c_x
             IMPORTING
                  return = ls_return.
        IF NOT ls_return IS INITIAL.
          CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
          APPEND ls_return TO gt_return.
          PERFORM store_bapi_errors.
        ENDIF.
    * Update failed
      ELSE.
        CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
      ENDIF.
    This will not interrupt your processing...

  • Upload the data into interface

    HI Abapers,
    My requirement is that i want to upload the data into the transaction where for the header data there are n number of  item transactions , so my requirement is to select all the item  transactions that should be done in background, so i have written the code below but it is selectiong only the first row
    itd2[] = itd[].
    *icount = 1.
        LOOP AT itd2 INTO wa_itd2.
    icount = 1.
        CONCATENATE 'GWA_MTBAL-CHECK(' icount ')'  INTO w_fnam.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                  w_fnam.
          PERFORM bdc_field       USING w_fnam
            'X'.
          icount = icount + 1.
        ENDLOOP.
        PERFORM bdc_dynpro      USING 'SAPMZPP001_PRODORDCONF' '9010'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=GR'.
    Pls reply for any changes in code or any clarifications for this post.
    Thanks In advance.

    Hi thank you  for kind reply i need to create the entries  for CO Activity /Price planning .
    i have to upload data to KP26 which i have posted the fields ..
    i already cheked the function modules which you have been given .. it is not suitable ..
    Is there any ohter  BAPI is there ... le t me know ...
    regards
    purushotham.ineni

  • How to activate master data in background ?

    Hi All,
    I  would like to know How to activate master data in background ?
    When I try with right clic on infoobject and choose activate I have a time out
    Thanks for your help
    Sebastien

    Nikhil
    This method is to activate the structure in development server
    I want to activate the master data after an upload with a DTP in production

  • LSMW - Upload customer data (KNA1)

    Hi,
    I'm trying to upload customer data from a legacy system using buisness object KNA1 and method CREATEFROMDATA1 (BAPI). At first I discovered that to be able to use business object KNA1 I had to generate an ALE interface in transaction BDBG.
    My problem is that when I try to "Maintain Structure Relations" I get following error message:
    No target structures could be found
    Message no. /SAPDMC/LSMW_OBJ_030001
    Shouldn't it be possible to do it this way?
    I prefer to use the BAPI method compare to Batch input for following reasons:
    - Better performance
    - I don't have to think of screen sequences. For example can different account groups mean different screens.
    Thanks for help,
    Hans

    Hans, did you ever come back to this problem and see if you could come up with a solution?
    I am facing a similar problem while trying to upload Business Partners into our CRM system. Unfortunately for me, the batch input recording option is not viable, as that takes too long (~95 days to load our data, and can't be run in background). I have been told that I should look to use a BAPI, but am getting errors when trying to specify the field mapping.
    Cheers,
    Andrew

  • " Can not interpret the data in file " error while uploading the data in DB

    Dear All ,
    After running the below report I am getting the " Can not interpret the data in file " error.
    Need to upload the data in DB through excel or .txt file.
    Kindly advise to resolve the issue.
    REPORT  ZTEST_4.
    data : it like ZPRINT_LOC occurs 0 with header line,
    FILETABLE type table of FILE_TABLE,
    wa_filetable like line of filetable,
    wa_filename type string,
    rc type i.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
    CHANGING
    FILE_TABLE = filetable
    RC = rc.
    IF SY-SUBRC = 0.
    read table filetable into wa_filetable index 1.
    move wa_filetable-FILENAME to wa_filename.
    Else.
    Write: / 'HI'.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    start-of-selection.
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    FILENAME = wa_filename
    FILETYPE = 'ASC'
    HAS_FIELD_SEPARATOR = 'X'
    TABLES
    DATA_TAB = it.
    IF SY-SUBRC = 0.
    Write: / 'HI'.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    insert ZPRINT_LOC from table it.
    if sy-subrc = 0.
    commit work.
    else.
    rollback work.
    endif.
    Regards
    Machindra Patade
    Edited by: Machindra Patade on Apr 9, 2010 1:34 PM

    Dear dedeepya reddy,
    Not able to upload the excel but have sucess to upload the .csv file to db through the below code. Thanks for your advise.
    REPORT  ZTEST_3.
             internal table declaration
    DATA: itab TYPE STANDARD TABLE OF ZPRINT_LOC,
          wa LIKE LINE OF itab,
          wa1 like line of itab.
                       variable  declaration
    DATA: v_excel_string(2000) TYPE c,
           v_file LIKE v_excel_string VALUE    'C:\Documents and Settings\devadm\Desktop\test.csv',  " name of the file
            delimiter TYPE c VALUE ' '.         " delimiter with default value space
         read the file from the application server
      OPEN DATASET v_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    IF sy-subrc NE 0.
    write:/ 'error opening file'.
      ELSE.
        WHILE ( sy-subrc EQ 0 ).
          READ DATASET v_file INTO wa.
          IF NOT wa IS INITIAL.
            append wa TO itab.
          ENDIF.
          CLEAR wa.
        ENDWHILE.
      ENDIF.
    CLOSE DATASET v_file.
    EXEC SQL.
         TRUNCATE TABLE "ZPRINT_LOC"
    ENDEXEC.
    *------display the data from the internal table
    LOOP AT itab into wa1.
    WRITE:/ wa1-mandt,wa1-zloc_code,wa1-zloc_desc,wa1-zloc,wa1-zstate.
    ENDLOOP.
    insert ZPRINT_LOC from table itab.

  • Issue when uploading Sales data from DSO to Cube.

    Dear All,
    I have an issue when I am uploading Sales data from DSO to Cube.  I am using BI 7.0 and I have uploaded all sales document level data to my DSO.  Then I use a transformation rule to calculate the Sales Value when I am doing DTP to cube.  Cube has customer wise aggregation data.
    In DSO I have NetPrice(KF) and Delivered_QTY(KF).  I do a simple multiplication routine in the transformation from DSO to Cube.
    RESULT =   SOURCE_FIELDS-NET_PRICE * SOURCE_FIELDS-DLV_QTY .
    At the moment I use Active Table(With out Archive) on the DSO to get the data since this is my first load.
    Issue is that the figure (Sales Value) in the cube is incorrect. I am getting a very large values which is impossible.
    Can someone please help me.
    Shanka

    Hi,
    are you sure that cube has customer wise aggregated data..since it will always aggregate the values of the key figures for the same set of characters...
    did you checked the values for the key figures as well and if even they are inflated or is the problem with this key figure only.
    During the data load the records may aggregates first for the same values of characters and then multiplication will be happening....if that is the case then you may have to multiply the values before storing it in the data package and then let it aggregate....can be achived through start routine...
    but first verify if other key figures are also having the same issue.
    Thanks
    Ajeet

  • What is the Tcodes for Uploading of data using BDC & CATT

    PP members:
    I was going through the <b>cutover activities</b> ,  and what I understood is  we transfer all the legacy system data into SAP before going live
    The data upload follows certain steps (depends on the organizational design load strategies)
    First we upload all the master data ( material master, BOM, W/C's & Routings)
    Then the transaction data ( Ideally speaking, there should no open orders i.e. WIP as on the day of cutoff )
    If the WIP (Work in Process) is unavoidable then the materials consumed shall be treated as <b>materials of the previous stage</b> and necessary adjustments shall be made after cutover day
    At this point, I could not able to understand what does the author mean <b>materials of the previous stage</b>
    Now comming to the uploading of data into SAP from legacy system, we use tools like LSMW, CATT & BDC
    Is it a must to use <b>only LSMW tool</b> to upload master data or any other upload tools are fine
    Lastly,. I am not sure about the Tcode of CATT & BDC
    Summary of the questions:
    1.What does the author mean  <b>material of previous stage</b>, for WIP materials during cutover activities
    2. Is it mandatory to use only LSMW tool for uploading for master data
    3. What are the Tcodes for upload tools CATT & BDC ?
    Thanks for your time
    Suren R

    Dear,
    1.What does the author mean material of previous stage, for WIP materials during cutover activities - as i understood, what is the stage of material..like it must have gone through 2 work centers and other 2 is left. i.e. you need to create Production order with only 2 operation as other 2 is already over. - usually it is done in such a way that we will create Production order and confirm till 2 operations and WIp is calculated so thatb FI will tally the books in SAP and lagacy.
    2. Is it mandatory to use only LSMW tool for uploading for master data - no you can use any tool as required and suits yr requirement
    3. What are the Tcodes for upload tools CATT & BDC- BDC through a prog in SE38. CATT through - SCEM.

  • Infocube was not uploaded with data in BI 7

    Dear One's,
    Iam trying to upload data from flat file to info cube. It was successfull even in infocube. But contents of infocube does not shows PRICE key figure values, it is showing only MAT_KEY values uploaded successfully. what could be the reason?
    Is it necessary to create a flat file with 0CURRENCY unit chara. to support PRICE ?
    And also while DTP is scheduled under processing tab it show only PSA rest all were disabled then how can it upload into data target?
    Kindly provide me with solution for the above situation.
    Thanks,
    Raj

    Dear One's
    Thanks for your replies, but what Iam facing is let me explain -
    I have to upload only 2 infoobjects data i.e MAT_KEY [cara.] and PRICE [keyfig] into infocube. Now tell me what are all the files should be entered into the flat file?
    and how can I enter USD price and INR prices values without 0CURRENCY?
    While running DTP between DS & Datatarget Iam getting only to PSA under processing tab if Iam correct.
    Kindly do the needful
    Thanks,
    Raj

  • How to upload Excel data in Ztables fastly & easily.

    Dear ALL,
    I  want to compare material codes in 2 different excel sheets.
    I have downloaded output from 2 different SQVI into 2 different excel sheets.
    Now I want to compare these 2 sheets to get matching codes or unmatching codes.
    I can use VLOOKUP in excel also. But How can I make use of ABAP by downloading these excel data in 2 different Ztables and compare these 2 tables with some user defined TC (transaction code) ?
    For this activity How to upload Excel data(2 sheets) in 2 Ztables fastly & easily ?
    Is there any method other than SCAT , BDC and LSMW  ???
    Or which is best method in above ?
    Pl' reply.
    Thanks.

    Have a look at the program
    *: Description                                                :
    *: This is a simple example program to get data from an excel :
    *: file and store it in an internal table.                    :
    *: Author : www.sapdev.co.uk, based on code from Jayanta      :
    *: SAP Version : 4.7                                          :
    REPORT  zupload_excel_to_itab.
    TYPE-POOLS: truxs.
    PARAMETERS: p_file TYPE  rlgrap-filename.
    TYPES: BEGIN OF t_datatab,
          col1(30)    TYPE c,
          col2(30)    TYPE c,
          col3(30)    TYPE c,
          END OF t_datatab.
    DATA: it_datatab type standard table of t_datatab,
          wa_datatab type t_datatab.
    DATA: it_raw TYPE truxs_t_text_data.
    At selection screen
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          field_name = 'P_FILE'
        IMPORTING
          file_name  = p_file.
    *START-OF-SELECTION.
    START-OF-SELECTION.
      CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
        EXPORTING
        I_FIELD_SEPERATOR        =
          i_line_header            =  'X'
          i_tab_raw_data           =  it_raw       " WORK TABLE
          i_filename               =  p_file
        TABLES
          i_tab_converted_data     = it_datatab[]    "ACTUAL DATA
       EXCEPTIONS
          conversion_failed        = 1
          OTHERS                   = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    END-OF-SELECTION.
    END-OF-SELECTION.
      LOOP AT it_datatab INTO wa_datatab.
        WRITE:/ wa_datatab-col1,
                wa_datatab-col2,
                wa_datatab-col3.
      ENDLOOP.
    Message was edited by:
            K N  REDDY

  • Upload Excel data to Sharepoint list VIA infopath form

    Hi,
    I'll try to explain the process of what I want to do first.
    1. In Excel
    I have an exceldocument (XLS, XLSX or XLSM) with 4 named columns and a named worksheet saved locally on my computer.
    I want to upload this data into preferably a custom list in sharepoint but it needs to run via a infopath template first.
    2. In Infopath
    The Infopath template will prompt the user to specify values in 2 additional fields.
    After giving input to these fields user may browse for the locally stored excel document and upload the document.
    In the same infopath template a dynamic array should be visible containing 6 columns (4 from excel + 2 from headerlevel of template) and the amount of rows based on the number of rows from excelsheet.
    At the end of template a submit button is found for uploading the entire array into sharepoint custom list.
    Is this possible to do at all?
    NOTE! End user should not have to save the excelsheet as XML file nor do a XML mapping.
    Infopath should, perhaps with help of VBA read excelsheet and transfer data to correct destination in sharepoint on it self.
    Looking forward to your reply

    Hi Jonas,
    You can attach your Excel doucment into InfoPath form and send InfoPath form to a custom web service. Then you can parse the Excel data and combine the Excel data and additional fields into SharePoint list in the customized  web service.
    For more information, you can have a look at the thread:
    http://dandeng.blogspot.com/2012/03/submit-infopath-form-data-to-web.html
    http://www.codeproject.com/Articles/88547/Submit-entire-InfoPath-form-to-web-service
    https://social.msdn.microsoft.com/Forums/office/en-US/590f1e78-5c08-47bd-8af4-9709102b568d/webservice-to-send-attachments-in-infopath-form-to-different-location?forum=sharepointcustomization
    https://msdn.microsoft.com/en-us/library/office/gg575571.aspx?f=255&MSPPError=-2147217396
    Best Regards,
    Eric
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Data Source to upload plan data for CO_OM_CCA_: CC: Costs and Allocations

    Hi Guru's,
    We have Data source that which upload Actual data for CCA (0CO_OM_CCA_1 - Cost Centers:cost and allocations).  Every time it is full upload before loading the data deletion of previous load request will be done.
    One more information required that i have checked in the BW cube for plan data it is available in the info cube for one cost center and rest of the costcenter i don't have the data now the users are requesting to upload the plan data for rest of cost centers.
    Now as per the business requirement the users are requesting to upload the plan data in to the same i am not sure whether it will pull the plan data with actuals in to BW cube. Is there any alternate with the same data source or else is there any specific data source for uploading Costs and Allocations plan data
    Please suggest me how can i go a head with this requirement.
    Thanks in Advance.
    Ganni

    You can use the same datasource to load plan/budget data to the cube for all the costcenters. And regarding the actuals, you can use 0CO_OM_CCA_9 datasource to load to actuals cube and create a multi on top of both plan and actuals cube for reporting purposes.

  • UPLOAD MASTER DATA FROM SAP GL TO ACCOUNT DIMENSION

    hi
    how can i upload master data (chart of account) from BW 0GL account info object to BPC Account Dimension ?
    how can i upload the hierarchy, there is no hierarchy in ECC for the chart of account

    SAP offers free content + documentation in the form of rapid-deployment solutions (RDS). 
    In the Extended Financial Planning Rapid-deployment solution, there is a module called G/L Financial Planning which includes the full load of SAP-based account dimension from SAP ERP to BPC via BW. This content introduces BPC-based Package Links as a best practice way to load master data (including the account hierarchy and transaction data).  You can download the content and documentation from the highlighted page above or HERE.
    SAP also offers free training on the EPM rapid-deployment solutions in the EPM RDS Academy 2015 on SAP JAM. If the link to the Academy does not work, please register HERE and SAP will invite you.

Maybe you are looking for

  • Intel 7260 does not work on open networks/filtered ports

    Hi Everyone! I made sure to check if this was posted before and tried to fix everything I could before asking you guys. For the past few days, I have been using Android wifi tethering as I was unable to get the speed up above 1000 B/s at my school. T

  • Sometimes having trouble shutting down

    Sometimes, lately, when I shut my computer down, it freezes on the last blue screen. After I choose "Shut down..." from the apple menu and choose "OK" the computer starts shutting down. Then my desktop icons go away, and USUALLY, I get a blue screen

  • CSS not displaying in Dreamweaver Preview (from Template file)

    Greetings! I created a page in dreamweaver with attached styles which was working just fine. Took the page and turned it into a template - which was also working fine. Then applied the template to a page and styles are not showing at all. Looking at

  • # in query String

    Hi, I have a href which looks like this "href=https://someURL.html?erpc=alljobs#SearchJobs&priority=2 when I am clicking on this href it is giving me NumberformatException when I am trying to read priority going request.getParameter(). It is working

  • How to delete decimal values zeros

    Hi experts, i am using mseg-menge field ( lenth13 and decimals 3) in my alv grid report. eg: 2.3456.000 user wants only  2.3456 no decimals. how we can aviod decimals 0 s in report. thanks in advance. mahahe