BADI implementation for importing values from excel

Hi All,
This is my first ever post in this forum and I am a newbie in ABAP. I have this doubt rather I would say I am stuck while implementing a BADI for importing Excel values.
We have a BADI for 'Upload flow rate' button which is built on PLM frame work on webdynpro.
The requirement is that after clicking the ' 'Upload flow rate'  button it should prompt for selecting the excel file and after selecting that file, the values should get loaded to the internal table.
what I have tried till now is that
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           = 'C:\abcdl\book1.xlsx'
   TABLES
     I_TAB_CONVERTED_DATA = lt_result
   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.
endmethod.   
I tried hard coding the xls file but it gives error as 'CNTL_error' which I guess is a known issue when we use this function module in webdynpro.
So how can I get the values from excel without using datasource and just by hard coding the file name?
Regards,
Anand
Anand

There is no solution to this - SAP have said they will re-introduce this functionality, but they havent said when (as far as I am aware).
However, we have developed a workaround (for Web reports anyway), let me know if you are interested.
Patrick

Similar Messages

  • How do I create a series of text frames using values from Excel list?

    First of all, this is the very first script I'm attempting to write from scratch. I'm completely green at scripting, and I've picked up a few snippets from Adobe's ID scripting guide, but nothing has really stuck yet relating to this particular objective.
    My supervisor keeps a master list of ad spaces, with the name of the account, how wide the space is, and how tall the space is, all in an Excel sheet. These spaces can number in the hundreds, and I am stuck manually drawing one rectangle for every space, which takes a very long time.
    I'd like to create/have help creating a script that will take these values and "automagically" draw these spaces in the form of text frames, with the width (in columns) and the height (in inches) defined by the values in the master list, as well as the name of each account appearing in the subsequent text frames.
    The script doesn't necessarily need to be able to pull the values straight from the Excel sheet; I can transfer the values to a support text file if needed, or directly into the script, changing it as I need it. A big thing (if it is not able to pull right from an Excel sheet) is that the number of spaces changes weekly, and so do the accounts, and the width and the height. Accordingly, it would be ideal if the values from the sheet could be changed easily, so as to create a new set of spaces as needed.
    Positioning for each space is not crucial, only height and width. If they all appear on top of each other on the same page, that will be a result for me. The main idea is to not have to draw them all manually, one by one.
    To me, this sounds like a tall order, but hopefully some experienced scripters out there can assist me, as I wish to become experienced as well.
    So, the TL;DR version:
    - Script needs to draw a series of text frames.
    - Text frames dimensions need to be defined by width and height values from Excel sheet.
    - Text frames must have account name as contents (from account names in Excel sheet).
    - Accounts, width and height change every week in the Excel sheet, so must be relatively easy to exchange all of the values.
    - The width values are on the Excel sheet as columns. It would be ideal if the script could convert those numbers into multiples of columns as needed.
    - (Optional) Script can pull values directly from Excel sheet.
    - (Optional) Script can define text frame fill color as gray. (If it works as I think it will, I could just select all the resulting text frames myself and set them all to gray at once... I'm not that lazy )
    Thanks in advance to whomever can assist in any possible way, even if it is just a push in the right direction. This script will save 1-2 hours of tedium every week.

    Sound like the perfect thing for InDesign Scripting.
    I would copy the Excel contents into a text file, to get a format that is easily read from InDesign, and there will automatically be a TAB for each "cell" just using copy/paste.
    Here is a piece of code, that you perhaps could go on with (adding variable to change pages and location on page, and other stuff).
    The readFileLineByLine function, can be easily re-used with any function using "callback". You simply supply the function to it, that you want to be executed for every line of text that is read:
    const COLUMN_WIDTH = 2; // Define the column width in inch
    var pageIndex;
    var textFramesExported; // not implemented.
    // Add a new dokument. Set myDoc to app.activeDocument to use
    // the current document instead of creating a new one.
    var myDoc = app.documents.add();
    // The doSomethingWithTextRow function is called upon for every line of text read.
    readFileLineByLine('c:\\test.txt', doSomethingWithTextRow);
    function doSomethingWithTextRow(row){
        // We expect the text line to be TAB separated (\t = TAB). We get that from just copying the contents of an
        // excel file into a text document.
        var cells = row.split('\t');
        var companyName = cells[0]; // The Company name in the first slot of the array
        var width = COLUMN_WIDTH * cells[1];
        var height = cells[2];
        // Create a new text frame for every row handled
        if (pageIndex==undefined) pageIndex = 0; // Count up when you have exported a number of texts, I leave this for you to do.
        var newTextFrame = myDoc.pages[pageIndex].textFrames.add();
        newTextFrame.contents = companyName;
        // The text frame is created in the top left corner.
        newTextFrame.geometricBounds = [0, 0, height + ' in', width + ' in']; // Top, Left, Bottom, Right
        // You might want to move the textframes to other positions, keeping track of how many you put out per page.
        newTextFrame.move( [10, 10] );
    function readFileLineByLine(path, callbackFn){
        var myFileIn = new File(path);
        if (File.fs == 'Windows'){
            // This was probably added to recognize UTF-8 (even without its start marker?)
            myFileIn.encoding = 'UTF-8';
        myFileIn.open('r');
        var myEncoding = myFileIn.encoding;
        try{
            if (!myFileIn.exists){
                throw('Missing file: ' + myFileIn.fsName)
            var ln = '';
            while(!myFileIn.eof){
                // Read the lines from the file, until an empty line is found [now as a remark].
                ln = myFileIn.readln()
                // if(ln !='' && ln!='\n'){
                   // Call the function supplied as argument
                   callbackFn(ln);
        }catch(e){
            alert(e);
            gCancel = true;
        finally{
            myFileIn.close();
    The file in C:\ in my example was saved as UTF-8 and looks like this (showing hidden characters):
    Message was edited by: Andreas Jansson

  • Import data from excel/csv file in web dynpro

    Hi All,
    I need to populate a WD table by first importing a excel/CSV file thru web dynpro screen and then reading thru the file.Am using FileUpload element from NW04s.
    How can I read/import data from excel / csv file in web dynpro table context?
    Any help is appreciated.
    Thanks a lot
    Aakash

    Hi,
    Here are the basic steps needed to read data from excel spreadsheet using the Java Excel API(jExcel API).
    jExcel API can read a spreadsheet from a file stored on the local file system or from some input stream, ideally the following should be the steps while reading:
    Create a workbook from a file on the local file system, as illustrated in the following code fragment:
              import java.io.File;
              import java.util.Date;
              import jxl.*;
             Workbook workbook = Workbook.getWorkbook(new File("test.xls"));
    On getting access to the worksheet, once can use the following code piece to access  individual sheets. These are zero indexed - the first sheet being 0, the  second sheet being 1, and so on. (You can also use the API to retrieve a sheet by name).
              Sheet sheet = workbook.getSheet(0);
    After getting the sheet, you can retrieve the cell's contents as a string by using the convenience method getContents(). In the example code below, A1 is a text cell, B2 is numerical value and C2 is a date. The contents of these cells may be accessed as follows
    Cell a1 = sheet.getCell(0,0);
    Cell b2 = sheet.getCell(1,1);
    Cell c2 = sheet.getCell(2,1);
    String a1 = a1.getContents();
    String b2 = b2.getContents();
    String c2 = c2.getContents();
    // perform operations on strings
    However in case we need to access the cell's contents as the exact data type ie. as a numerical value or as a date, then the retrieved Cell must be cast to the correct type and the appropriate methods called. The code piece given below illustrates how JExcelApi may be used to retrieve a genuine java double and java.util.Date object from an Excel spreadsheet. For completeness the label is also cast to it's correct type. The code snippet also illustrates how to verify that cell is of the expected type - this can be useful when performing validations on the spreadsheet for presence of correct datatypes in the spreadsheet.
      String a1 = null;
      Double b2 = 0;
      Date c2 = null;
                        Cell a1 = sheet.getCell(0,0);
                        Cell b2 = sheet.getCell(1,1);
                        Cell c2 = sheet.getCell(2,1);
                        if (a1.getType() == CellType.LABEL)
                           LabelCell lc = (LabelCell) a1;
                           stringa1 = lc.getString();
                         if (b2.getType() == CellType.NUMBER)
                           NumberCell nc = (NumberCell) b2;
                           numberb2 = nc.getValue();
                          if (c2.getType() == CellType.DATE)
                            DateCell dc = (DateCell) c2;
                            datec2 = dc.getDate();
                           // operate on dates and doubles
    It is recommended to, use the close()  method (as in the code piece below)   when you are done with processing all the cells.This frees up any allocated memory used when reading spreadsheets and is particularly important when reading large spreadsheets.              
              // Finished - close the workbook and free up memory
              workbook.close();
    The API class files are availble in the 'jxl.jar', which is available for download.
    Regards
    Raghu

  • Import data from excel

    Hi, I am using Jdeveloper 11g 11.1.1.5.0 and I want to import data from excel in my table through the jsf page and commit it to database. How can I implement it. Its urgent please help me!!!!!!!!!!!!!!!!!!!!!

    Unless you are importing Excel data to save a dying patient in the operating theatre, it's not, by definition, urgent!!!!!!!!!!!!!!!!!!!!!! (and I must be right, because I used 22 exclamation points, where you only used 21).
    Have you looked at ADF Desktop Integration to see if that would work for you? If not, you could:
    1). Use an af:inputFile to upload the Excel file
    2). Using something like Apache POI to read the file
    3). Create rows, set the attributes, insert them, and commit them (if you're using ADF BC, you'd use a View Object to do this)
    John

  • Import data from excel file - best practice in the CQ?

    Hi,
    I have question related to importing data from excel file and creates from those data a table in the CQ page. Is inside CQ some OOTB component which provides this kind of functionalities? Maybe somebody implement this kind of functionality or there is best practice to do this kind of functionalities?
    Thanks in advance for any answer,
    Regards
    kasq

    You can check a working example package [1] (use your Adobe ID to log in)
    After installing it, go to [2] for immediate example.
    Unfortunately it only supports the old OLE-2 Excel format (.xls and not .xlsx)
    [1] - http://dev.day.com/content/packageshare/packages/public/day/cq540/demo/xlstable.html
    [2] - http://localhost:4502/cf#/content/geometrixx/en/company/news/pressreleases/my_personal_bes ts.html

  • Multiple active implementations for filter value EXEC_METHODCALL_PPF

    Hi,
    I have created an implementation for the EXEC_METHODCALL_PPF badi which is triggered from an action in a transaction.It is working fine in the development system but while transporting it to the quality system I am getting the following error.
    Multiple active implementations for filter value EXEC_METHODCALL_PPF definition
    Errors occurred during post-handling AFTER_IMP_SXCI for SXCI L
    AFTER_IMP_SXCI belongs to package SECE
    The errors affect the following components:
    BC-DWB-CEX (Customer Enhancements)
    When i refer to the documentation of the error message it says....
    Multiple active implementations for filter value EXEC_METHODCALL_PPF definition
    Message no. ENHANCEMENT474
    Diagnosis
    There are multiple active implementations of the same business add-in definition, even though this is not allowed.
    System Response
    This is not correct and should not occur.
    Procedure
    Deactivate the implementations active for this BAdI definition one by one until there is only one active implementation left.
    You should use transaction SE18 (Utilities -> Adjustment -> Multiple-use interfaces) to solve these conflicts systematically.
    But I am apprehensive if deactivating all the standard implemenatations of the badi will create any problem.Please can any one suggest as to how to resolve this issue....
    Any help would be highly appreciated.

    Hello,
    Please check the following suggestions
    a) go to se18 -> enter your definition name and see if "Multiple" call check box is ticked in Quality
    b)compare your transports since some objects in development may not have found it's way to the quality server
    c)Please see if for the same definition,for different filter values...implementations are done...if so,is multiple checkbox marked? in quality also?if you have multiple implementations with the check box not marked..the message conveys u cannot have multiple implementations of the same badi....
    d)also check if the filter being passed to the BADI is ok
    Hope it was useful in some way
    Reward if helpful
    Regards
    Byju

  • Importing objects from excel into drop down menu

    Hi!
    I have tried to copy objects from excel while constructing a drop menu in forms central. Sadly, my 500+ objects appear as one choice instead of uniqe items. 
    Is it possible to import values from an excel column to be shown as single items in a drop down menu?
    /Martin

    Hej
    I have the opportunity to choose Acrobat Forms as an alternative form for this survey.
    Do you know if there is possible to get the 500+ into a list in a more elegant way than manual input?
    Hope you have an "elegant" solution for me even if the Forum is not all correct for this question.
    Martin

  • Pass Value from Excel to custom program

    Hello,
    I want to pass value from Excel to Custom Program being called in the Custom Integrator and i am using the Import in the Importer section but it is not getting passed.
    Please advise and i am on R12.1.3.
    Thanks

    Pl do not post duplicates - Concurrent Program Parameter

  • Import data from excel explanation

    Running SAP B1 2007 A PL49.
    In the import data from excel functionality, using items.  There are 2 checkboxes that appear:
    update existing records
    update accounts in existing items
    can anyone explain what each checkbox means?
    Thanks,
    Rich

    hi Rich,
    Update Existing Records
    The system overwrites the data in the corresponding fields of the existing master records.
    The numbers of the master records for business partners or items cannot be overwritten.
    The type of a business partner cannot be changed once business transactions have been entered for that partner.
    Update Accts in Existing Items
    When importing item data, you can also update the information for the expense and revenue accounts.
    To overwrite the respective item master data record
    regards,
    Fidel

  • Import data from excel file

    Hello.
    Is anybody can help how to import data from excel file to the form created with designer 7.0. Originally there is a script inside the form to populate drop down list and depending from data selected in the ID number drop down list, there will be filled out the description and the prices text fields. But now I have to modify this form with data from excel file, which has more than 30000 lines and put all this data to script is too much.
    So, can somebody know how can I after filling the ID number field , populate the description and price text fields with data from excel file corresponding to this ID number ?
    This form is used in Adobe reader.
    Any comments are welcome.
    Regards,
    Aivar

    Hi
    That's what i said in my prev. Post to clear cache... :)
    disable your cache from nqsconfig.ini
    In cache section of NQSConfig file,
    you find
    ENABLE     =     YES;
    set to NO
    OR
    if you are using data ware house as the source for OBIEE,
    you know that when ETL is done, so just create iBot to purge cache automatically at that particular intervals,
    So that report runs freshly at that time
    And what happened to your View Selector question?
    Edited by: Kishore Guggilla on Jul 3, 2009 3:52 PM

  • I am creating a catalog and need a way to mass import tables from excel into indesign.  Any ideas?

    I am creating a catalog and need a way to mass import tables from excel into indesign.  Any ideas?

    Third-party plugins for InDesign can automate the process. Here's a thread from InDesignSecrets.com forums:
    http://indesignsecrets.com/topic/plugins-for-automating-catalog-production

  • How to import data from excel or csv files to Oracle table

    hello everybody,
    I am new here and new in Oracle. I would like to know the steps how to import data from excel or csv files to Oracle table.
    Let say I already have table inside the Oracle. Then my user give me the sets of data inside the Excel Worksheet.
    So, how can I import the excel data into Oracle table.
    Thank you in advance.
    cheers,
    shima

    Even easier. Download JDeveloper 11G from this site.
    Set up the database connection, right click on the table, select Import->Excel and specify your file to load it. On the import pop-up, you must view and update each tab indicating Columns, Data Types, and DML.
    Columns -- move the selected columns that you want to load to the box on the right
    Data Types -- select column name from second column to which the data for each column of the import file should load
    DML -- click this tab to generate the INSERT SQL
    Once done click 'Insert'

  • Giving dynamic sheet name while importing data from Excel in OPENROWSET query

    I want to import data from Excel to table in SQL server. Sheets in Excel file can have any name. I want to get data from first sheet of the excel file. 
    CREATE PROC CopyExcelDataToTempTable
    @ExcelPath VARCHAR(1000)
    AS
    BEGIN
    EXEC sp_configure 'show advanced options', 1;
    RECONFIGURE;
    EXEC sp_configure 'ad hoc distributed queries', 1;
    RECONFIGURE;
    EXEC master.dbo.sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.12.0', N'AllowInProcess', 1;
    EXEC master.dbo.sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.12.0', N'DynamicParameters', 1;
    INSERT INTO TempData
    SELECT *
    FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0',
    SELECT CONCAT('Excel 12.0 Xml;HDR=YES;Database=', @ExcelPath),
    'SELECT * FROM [Sheet1$]');
    END;
    Currently I am giving Sheet1 as static name in Select statement. But my sheet name is not fixed. I want to create a dynamic query. If getting Sheet name is not possible then can we put sheet with its index in Select query? There is no front end. Whatever I
    want to do is in SQL server 2012. Is there any solution for this problem?

    Hi Ajinkya,
    To get the sheet names from an excel, you can use the Stored Procedure
    SP_TABLES_EX. See the below code.
    EXEC sp_addlinkedserver 'ExcelSource', '',
    'Microsoft.ACE.OLEDB.12.0',
    'c:\worksheet.xls',
    NULL,
    'Excel 8.0'
    EXEC sp_addlinkedsrvlogin 'ExcelSource', 'false'
    GO
    EXECUTE SP_TABLES_EX 'ExcelSource'
    the names in the worksheet.xls and execute result are like below.
    Table name
    a
    b
    c
    d
    Regarding your description, you need the first sheet of your excel. As the result shows, the sheet names are sorted, so there’s no guarantee to get the first one. The SP can work as a workaround when there’s only one sheet in your excel or the required sheet’s
    name is customized to be sorted at the top first.
    If you have any question, feel free to let me know.
    Best regards,
    Eric Zhang

  • Importing data from Excel using SDK!

    Hi All,
    Can we do a Goods Receipt and Goods Issue via SDK.
    IF so any code available for the same!Secondly can we
    Import data from Excel using SDK!
    Thnx in advance

    Hi Vinayak
    4 your 2nd issue: you can easily use Excel.Application COM-object. In C# exporting from Excel can be:
    Excel.Application     oXL;
    Excel._Workbook     oWB;
    Excel._Worksheet     oSheet;
    string          strTemplatePath;
    strTemplatePath = Application.StartupPath + "WHRequestList.xlt";
    try
         oXL = new Excel.Application();
         oWB     = (Excel._Workbook)(oXL.Workbooks.Add(strTemplatePath));
         oSheet     = (Excel._Worksheet)oWB.ActiveSheet;
         SAPbouiCOM.Item     edDocNum;
         SAPbouiCOM.IEditText specEdDocNum;
         edDocNum = SBOApp.Forms.Item(FormUID).Items.Item("8");
         specEdDocNum = (SAPbouiCOM.IEditText)edDocNum.Specific;
         SAPbouiCOM.Item     edDocDate;
         SAPbouiCOM.IEditText specEdDocDate;
         edDocDate = SBOApp.Forms.Item(FormUID).Items.Item("10");
         specEdDocDate = (SAPbouiCOM.IEditText)edDocDate.Specific;
         oSheet.Cells[2, "F"] = "¹ " + specEdDocNum.String + " îò " + specEdDocDate.String;
         oXL.Visible = true;
         oXL.UserControl = true;
    BTW, don't forget to add Excel object in ProjectReferences
    For sure, importing  (reading) from Excel is the same
    HTH

  • Importing data from excel  ... when clicking finish button nothing happens

    Version 3.1/32bit version ... I am trying to import data from excel but when i clicki finish button nothing happens. any idea. this used to work fine on the older version?

    Hi,
    Generally speaking, the data import from an xls or xlsx format Excel file works. You need to provide more information about your environment and the Excel file itself -- size, data types of the columns, number of worksheets, etc.
    I recommend running sqldeveloper.exe (not sqldeveloperW.exe) from a command line window. Repeat your import test and see if any stack trace appears in the console. For example, trying to open a 0 byte xls file results in a stack trace like this:
    java.lang.NullPointerException
            at oracle.dbtools.raptor.data.readers.XLSReader.openFile(XLSReader.java: 524)
    ...Regards,
    Gary
    SQL Developer Team

Maybe you are looking for

  • How to print PDF file content from ABAP in background?

    Hi, Is it possible to print PDF file content from ABAP in background? I have some PDF content which I need to print it, these PDF files are generated outside the SAP. Please have you any suggestions? Thank you Tomas

  • How do I install Fonts in FM12?

    Hello everyone, I've got the following problem: A customer has updated his PC to Windows 7. So he reinstalled FM12 on his new system. After that he wanted to install his fonts he had before on his old pc. I dont know how I could help him, so I would

  • I cannot find the location services in the general settings

    After the forced change over to IOS 6 it asked during the setup which apps would be used for location services.  I checked only the Maps as I do not like all the different programs watching me.  I went to use several that I pick and choose the locato

  • Hp Pavillion dv7 Entertainment i7 dual hd

    Hello, I just finished upgrading my laptop, from 4 to 8g memory, main hd to 256 ssd, OS to windows 7 Pro. The laptop runs like a rocket  ship, when pluged into the battery charger. Slows to a snails pace a minute or so after  I unplug the charger. Th

  • Sun.awt.windows.WToolkit$ModalityListenerList

    Everytime I try to start a java program, the java program freeze. I tryed java -verbose -jar FileChooserDemo.jar (which comes with the java development kit. (1.3.02) ) It freezes when it comes to : [Loaded sun.awt.windows.ModalityListener from C:\Pro