Is it possible to write a routine on excel file while loading data?

Hi
I am trying to load data from csv file(Excel flat file) into ODS, while loading data in to ODS, I need to check a condition if one Info Object in ODS is match with column C field in flat file then only the data should load, otherwise reject the data.
any help is greatly appreciated.
Thank you
Harshan

Hi Harshan,
in your start routine:
data: wa_ods type <name of active data ods table>,
      l_index type sy-tabix.
loop at data_package.
l_index = sy-tabix.
select single * into wa_ods
from   <name of active data ods table>
where  <your condition>.
if wa_ods-<fieldname> = <your condition>.
continue.
else.
delete data_package index l_index.
endif.
endloop.
In case of bad performance it might be necessary to post the ods-data to a internal table first and read the internal table instead of doing select single.
Hope this helps!
regards
Siggi

Similar Messages

  • Is possible to use one column in Excel file as parameter to retrieve data ?

    I'm newbie to WEB ADI
    is possible to use one column (or worksheet) in Excel file to enter data as parameters and use Web ADI to retrieve data ?
    In example - user paste in one column list of items ID's - then press a button and in another columns get data such as description, primary UOM etc.

    Hi,
    I will say no. Oracle WebADI integrators are not meant for such purpose.
    HTH,
    Nitin jain

  • Is it possible to write a program to unzip files in pl/sql or sql ?

    Morning Experts,
    I have a zip file on my Host which contains a list of files(reports). Each of those files have a distinct name and i have already written the codes to retreive data from those files.
    My oracle is installed on a linux server
    Now my question is as follows:
    is it possible to write a program in sql to unzip those .zip files (located on my host) and stores its content in that same folder?
    Thanks

    You can use Java like this:CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED "Zipper"
    AS import java.io.ByteArrayInputStream;
    import java.io.IOException;
    import java.util.zip.ZipInputStream;
    import java.util.zip.ZipEntry;
    public class Zipper {
       public static String unzip(byte[] pBuf) throws IOException {
          ZipInputStream in = new ZipInputStream(new ByteArrayInputStream(pBuf));
          ZipEntry ze;
          byte[] buf = new byte[2048];
          StringBuffer stribu = new StringBuffer(pBuf.length * 5);
          while((ze = in.getNextEntry()) != null) {
             int bytesRead;
             while((bytesRead = in.read(buf, 0, 2048)) > 0) {
                for(int i = 0; i < bytesRead; i++) {
                   stribu.append((char)buf);
    in.closeEntry();
    in.close();
    return stribu.toString();
    CREATE OR REPLACE FUNCTION unzip(
    pData IN RAW)
    RETURN VARCHAR2
    AS
    LANGUAGE JAVA
    NAME 'Zipper.unzip(byte[]) return java.lang.String';
    In this example you can pass the content of a reltively small zip file and get the contents as VARCHAR2.
    It's just to show where to start.
    Hth, Urs                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Error while loading data from write optimized ODS to cube

    Hi All,
    I am loading data from a write optimized ODS to cube
    I have done Generate Export Datasource
    schedulled the info packge with 1 selection for full load
    then it gave me following error in Transfer IDOCs & TRFC
    Info IDOC 1: IDOC with errors added
    Info IDOC 2: IDOC with errors added
    Info IDOC 3: IDOC with errors added
    Info IDOC 4: IDOC with errors added
    Data packege 1 arrived in BW Processing : selected number does not agree with transferred number
    Processing below is green
    shows update of  4 new records to Datapackage 1.
    Please provide inputs for the resolution
    Thanks & Regards,
    Rashmi.

    please let me know, What more details you need?
    If I click F1 for error details i get following message
    Messages from source system
    see also Processing Steps Request
    These messages are sent by IDoc from the source system. Both the extractor itself as well as the service API can send messages. When errors occur, several messages are usually sent together.
    From the source system, there are several types of messages that can be differentiated by the so-called Info-IDoc-Status. The IDoc with status 2 plays a particular role here; it describes the number of records that have been extracted in a source system and sent to BI. The number of the records received in BI is checked against this information.
    Thanks & Regards,
    Rashmi.

  • Duplication Error while loading data in write optimized DSO

    Hi Experts,
    I have an issue.In BI7 I'm trying to load the data in a WRITE OPTIMIZED ODS from the controlling data source 0CO_OM_CCA_10. I'm getting the data properly in PSA, but while loading it into my WODSO i'm getting the duplication error although my keys fields and data fields are properly placed in my data target(WODSO).
    pls let me know what is the solution to load it successfully.
    Thanks in Advance.
    Amit

    Hi,
    thanks for your reply
    I'm getting this error message:
    Diagnosis
        During loading, there was a key violation. You tried to save more than
        one data record with the same semantic key.
        The problematic (newly loaded) data record has the following properties:
        o   DataStore object: GWFDSR02
        o   Request: DTPR_4BA3GF8JMQFVQ8YUENNZX3VG5
        o   Data package: 000006
        o   Data record number: 101
    Although i have selected the key fields which identifies unique record,then also i'm getting the duplication error.
    Even i have reffered to the BI content for this data source and found that it has the same key fields as of mine.
    Debjani: i need unique records without duplication and i'm doing a full load in DTP.
    What is to be done pls help
    Thanks in advance.
    Edited by: Amit Kotwani on Sep 26, 2008 10:56 AM

  • How do you save data into an excel file while myRIO is acquiring data? I tried saving it using "Write to file" but it doesn't work for some reason.

    I am acquiring cosine wave and a pulse wave as input and I want to store their peak to peak values into an excel file. "Write to File" is not working for it. Is there any other vi which can be used for data logging?
    Thank you for your help.

    Hi Ssheoran,
    Can you provide more detail when you say that the Write to File VI doesn't work? Is there an error given? Or can you just not find the file on your computer? Keep in mind using this file in a Real-Time VI on the myRIO will save files on the myRIO. You will then have to transfer to your PC. Please view the following video as a guide for saving files and transferring them to your computer: (http://www.youtube.com/watch?v=BuREWnD6Eno). Hope this helps.
    Best Regards,
    Roel F.
    Applications Engineer
    National Instruments

  • Is it possible in java to send a excel file (.xls) as a parameter ???????

    hey guyz iam new to java technology
    please tell me whether i ca send a EXCEL file(.xls) extention as a parameter to a method (later i have to create a backup file for that excel sheet) if any one know this method please give me suggestions !!!
    posting some code would be helpful
    thankyou
    bye n cheers
    harsha

    lol
    If all you want is to create a backup of some file you can do:public class Foo
        public static void main(String[] args) {
            Foo f = new Foo();
            f.createBackup("something.xls");
        public void createBackup(String inFile) {
            FileInputStream in = null;
            FileOutputStream out = null;
            try {
                in = new FileInputStream(inFile);
                out = new FileOutputStream(inFile + ".bak");
                int read;
                while ((read = in.read()) > -1) {
                    out.write(read);
                out.flush();
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
            } finally {
                if (in != null) {
                    try {
                        in.close();
                    } catch (IOException e) {
                        e.printStackTrace();
                if (out != null) {
                    try {
                        out.close();
                    } catch (IOException e) {
                        e.printStackTrace();
    }

  • Write Attributes for a Excel File

    Can I write Attributes like Comment, Title,... in an Excel File .
    I'm using JXL to write data in the file.

    see the documentation for that product. It will tell you what you can and cannot do.

  • How to write a routine in infopack to restrict a date range !!!!

    Hi
    I want to load the data for a speicific date range ,i.e , i want to load the data between created on some date range which is not in between the same range for changed on...so i want to restrict that date range for changed on....Please le tme know the routine logic to restrict a date range....
    regards...

    How to ... Write Infopackage selection Routine
    1.Create an Infopackage 2. Go to selections tab and choose Type: 6 u2013 ABAP Routine.You can see following available options(F4 Help).
    3. Give disruption, and hit enter, now you will move to following screen. 4. Write Code between begin of Routine and End of Routine.
    5. See below sample code to select date range from Previous 6 days to Current date.
    6. L_T_Range table is of Type structure RSSDLRANGE.
    a. RSSDLRANGE contains SIGN, OPTION, LOW, HIGH
    We need to populate these fields to pass range dynamically.
    Sample Code:
    ***$$ begin of routine - insert your code only below this line -
    Data: l_idx like sy-tabix.
    Data: date_low like sy-datum.
    Date_low = sy-datum u2013 6.u201D(To get 6 days back).
    read table l_t_range with key
    fieldname = 'CRDAT'.
    l_idx = sy-tabix.
    Pass Range values to L_T_Range Table.
    Move date_low to L_T_Range -Low.
    Move sy-datum to L_T_Range -High.
    L_T_Range -Sign = u2018Iu2019. *****(Here: I u2013 Include, E u2013 Exclude)
    L_T_Range -Option = u2018BTu2019.****( Here: BT u2013 Between )
    modify l_t_range index l_idx.
    p_subrc = 0.
    **$$ end of routine - insert your code only before this line -
    7. Syntax check and Save.
    Hope it Helps
    Srini

  • Is it possible to write a script for Excel Chart Conversion to an ai file?

    I tried to record a script and it didn’t work. I will attempt to explain what I am doing (and why) and maybe you guys can tell me if it can be done or not. We are working with Excel charts and we eventually put them into InDesign for a print magazine. Here are the steps as best as I can translate. We are using Illustrator CS6 Version 16.2.0.
    1. Copy Chart from Excel
    2. Paste into Illustrator
    3. Fit Art Board to Graphic
    4. Select All
    5. Change Kerning to 0
    6. Select the Background
    7. Select Same Fill Color
    8. Change Color to 5% Black
    9. Select the grid lines on the Chart
    10. Change the Stroke to 50% Black
    11. Save as an AI file
    There is also a scenario where there are multiple charts and we would like to make multiple art boards in the same file.
    I do this for a few reasons: Remove Rich Black, Adjust Kerning, Eliminate any Font Issues, Easier to Scale, and it chokes our rip because there is no link when they are copied and pasted directly from Excel to InDesign.
    Any guidance would be appreciated. 

    no can do, there's no access to mesh point with scripting, sorry about that.
    have you tried Mesh Tormentor? it is free!!!, but I don't know if it will help with your problem
    http://www.meshtormentor.com/

  • Duplicate Error while loading data to Write Optimized DSO

    Hi,
    When i do a dataload for Write Optimized DSO, I am getting an Error as "Duplicate Data Record Detected".  I have Sales Document Number, Fiscal Year Variant & Billing Item as Semantic Key in the DSO. 
    For this DSO, I am getting data from a Test ECC system, in which most of the Sales Document Number column is Blank for this Datasource.
    When i go into the Error Stack of the DSO, all the rows whichever has Sales Document number as Blank are displayed.  For all this rows, the Item Number is 10.
    Am i getting this Duplicate error as the Sales Document Number is Blank & Item number is 10 for all of them?  I read in Threads that Write Optimized DSO doesnt care about the Key Values, it loads the data even if the Key values are same.
    Any help is highly appreciated.
    Regards,
    Murali

    Hi Murali,
    Is the Item Number a key field ?
    When all the key fields are same then data gets aggreagted depending on the setting done in the transformation for the key figures. These 2 options for key figures are :
    1. Add up the key figures
    2. Replace the key figure
    Since the Sales Document No is blank and Item Number is same then their is a possibility that the key figures for these records might get added up or replaced and thus due to this property of SDSO it might not be throwing error.
    Check the KF value in the SDSO for that Sales Doc No and Item No. and try to find out what is the value for KF. It may have addition of all the common data fields or the KF value of last common record.
    Regards
    Raj Rai

  • Write several time in an excel file?

    Hi
    I'm using a excel file to take back data from GPIB device.
    so I need to create an excel file
    write the data and this several time in the same seet.
    WritableWorkbook workbook = Workbook.createWorkbook(new File(Fo));
             WritableSheet sheet = workbook.createSheet("First Sheet", 0);
           if(new_run==true && allowoverwrite==true){
             Label label = new Label(0, 2, "NEW RUN");
             sheet.addCell(label);
            new_run=false;
       Label label = new Label(0, ww, bonnevar);
             sheet.addCell(label);
              Number number = new Number(1,ww, bonnevalue);
             sheet.addCell(number);
             ww=ww+1;
            workbook.write();
            workbook.close();                          
              catch(Exception ex) {
                 JOptionPane.showMessageDialog(null, "Impossible de cr�er le fichier xls", "Erreur", JOptionPane.ERROR_MESSAGE);
               }if i had to write only one value in the excel file it is OK it works.
    but if i have to write 2 data and more (i mean i need to enter 2 times in the loop) the first data are deleted and replace by the new one.
    i'm affraid it comes from the fact i recreate each time a workbook and a sheet.
    but i don't know how to solve my issue.
    do you know if it is possible to open an excel file, write data , close the excel file , then reopen the same excel file and add data without erase the pervious one
    thanks a lot for your help
    BR

    bonjour
    et oui je suis francais :)
    my english is so bad isn't it :)
    so effectively there is no loop because the source code i have inserted is a small part of my entire code.
    but recursively i come on this part of the code that why i have spoke about a loop.
    and each time I want to write something on the excel file, the previous data are erased and replace by the new one....
    so if you have any idea so solve this it would be great...
    ciao

  • ActiveX Excel Prevent Open File While Writting

    I'm having some of the same problems with Excel and ActiveX found here:
    http://forums.ni.com/ni/board/message?board.id=170​&message.id=254019&view=by_date_ascending&page=1
    The last post from the above link gives an acceptable workaround (not ideal, but hey, what can you do?) to preventing the user from closing Excel when files are being written to with ActiveX through LabVIEW (since a user can open an Excel file while LV is writting to Excel files with ActiveX and all the files will share the same Excel application, instead of Excel opening a seperate application like one would hope).
    My question for this post: In the previous post Ben had a problem with the user opening a different Excel file than those being written to. My VI opens an exisiting Excel file (test.xls) and writes to it. If the user opens test.xls while LV is still writting test.xls, it will throw an error. Note that the error is not thrown if test.xls is open before the VI starts writting to it, only if the user opens it while its being written to by LV.
    Any ideas on how to lock the file so the user can't open it while it is being used by LV?
    Michael

    Thanks thols. Thats a great solution, I actually had tried it but gave it up since the user could close out of "their" Excel (closing the reference), then open a new spreadsheet which would open in "my" Excel (if done while my subVI was still writing to Excel). At the time, this was a possible scenario for my program, and since I was writing so slowly had happened. I just sped up the writing of the Excel file (I had all the data to write, but was writing with "Set Cell Value.vi", which wrote one cell at a time; instead I wrote whole ranges of data). If Excel was already open, I would set interactive to false and have my spreadsheet minimized while writing to it. If Excel wasn't open, I would just make it invisible. Since I cut the time down to about a second, this worked for my application.
    Michael

  • Is it possible to open up an excel file inside a Web Browser not IE?

    I'm trying to find out if it is possible to open up a pivot excel file inside the a web browser, but i don't want to use Internet Explorer for that i'd prefer firefox for that.
    I have a web application that uses an excel file for one of its reports but i don't want the user to have to download the file in order to view the report and that particular report has various ordering criteria so i don't want any of the funtionality of the file to be lost in the process, so is it possible to do it? what tools would help me acomplish that?

    I don't think this is possible.
    You may be able to make it display in Firefox if the file is defined as the XML Excel format and not the xls or xlsx formats. But that would require saving the file differently and you would most likely loose all/most functionality
    You may find some Excel translators in Java (most notably POI from Apache). But they would still require you to adapt them to web format and you would have to duplicate much of the Excel functionality yourself. So it would be a long term option.
    You could check out Google Docs. They have a spreadsheet application that I believe can convert Excel files to their format. You may be able to use it inside your web site with permissions.

  • How to open an Excel file and write data into it.

    Hi All,
    I have an excel template, which has graphs and some tables containing corresponding data. If i change the data in tables it changes the graphs. So, if i have a template in the server, is it possible for me to open this excel file and change the data in the tables to chanage the graphs. How can i go to different worksheets and go to different cells and change the values and save the file.
    Thanx in advance
    Cheers
    Pej

    You can setup an ODBC connection to the Excel file and update the file with JDBC, using the JDBC-ODBC bridge.
    Hope this helps

Maybe you are looking for

  • How can I use my time capsule to save files from my windows PC (Windows 8.1)?

    I have been to see the iStore close to where I live but I am frustrated to say that they are no help what so ever. The technical desk there freely admits that they do not how to do it and all they say is "apparently it is easy. Just follow the instru

  • How do i keep multiple phone seperate on 1 i tunes account

    I have multiple iphones and want to use same computer and 1 itunes account. how do i do this?

  • Black (blank) images in slideshow

    Hi All. Bit of a newbie here. I have selected a group of images (each thumbnail shows an image) and when I create a slideshow there are numerous images that show up blank. Is there anything i can do about this? If I hit the spacebar they also show up

  • Illustrator CS5 Instalation Problem on Mac OSX 10.5.8

    I have tried instaling this software multiple times and am getting errors in the program that reinstalling doesn't seem to fix. Here are the errors I'm getting: When opening a new document, I get the error: "Can't locate the Startup Profiles. Please

  • Datagrid combobox as itemrenderer problem.

    Hi All,      I have different problem. i have a datagrid with10-20 rows. Different item renderers in all columns(6 - 10 columns). In that a single column has combobox as item rederer.      I have to serve different dataprovider for each row's combobo