Checking for existence of a record in csv file

Hey all, I have two csv files residing on the server that I will be processing using the UTL_FILE package. One of these files (File A) has only one column and the other one (File B) has over ten. The data in file A is the same as the one in column 2 of File B. File A is mainly there for a lookup purpose whereas File B is the one that has all the data that will be processed. The following example should describe better:
File A[b]
Number
"TR_56575"
"TY_76756"
etc
File B
Column1, Number, Column3, Column4
"Mine","TR_56575","uhsht","76744"
"Yours","TY_76756","nghdjd","45645"
What I have to do is check whether a Number in File B exists anywhere in File A. If it does then I just skip that record and move on to the next. So basically, I wanted to find out if there is any way to compare the two columns on the server side. I know there is a dbms_lob.fileexists function to check the existence of a file on a server, just wanted to see if there is an extension to that or something that checks the existence of a string in file. Any feedback would be appreciated. Thanks.

Yeah I thought about that. It would be the ideal way to go, however in this case, I already have a Pl/Sql procedure that grabs File B and just processes it from the server. It works fine and everything but now that this extra logic and file is added where I have to check the existence of a corresponding record in File A, I'm just looking for something to add in my code to just make the comparison on the fly and the rest would be the same.

Similar Messages

  • Check for existence of a record

    I have a table XX_TEMP. Let us say the columns are inventory_item, organization_id and description
    The values are:
    Inventory_item
    Organization
    Description
    200
    m1
    Sample
    200
    m2
    Not Sample
    400
    m4
    check
    700
    m5
    Test
    I just want to check the existence of an item in the table, I have written two queries and would like to know which one is better in terms of performance:
    Q1:
    select count(1) from xx_temp where inventory_item=200 and rownum=1;
    Q2:
    select count(1) from dual where exists (select 1 from xx_temp where inventory_item=200);
    Both Q1 and Q2 return the same result. In fact, I was surprised with the result from Q1 as I expected that the rownum would be evaluated after the where condition. I expected Q1 to return 2
    I thought that the below query:
    select count(1) from xx_temp where inventory_item=200;
    and Q1 would return the same result as rownum would be evaluated at end. In effect, I've 2 questions:
    1. Isn't rownum calculated at the end?
    2. What is the best way in terms of performance to check for an existence of record?

    Internally this is how it works:
    select count(*) from xx_temp where inventory_item=200 and rownum=1;
      COUNT(*)
             1
    1 row selected.
    Execution Plan
       0       SELECT STATEMENT Optimizer Mode=ALL_ROWS (Cost=4 Card=1 Bytes=13)
       1    0    SORT AGGREGATE (Card=1 Bytes=13)
       2    1      COUNT STOPKEY
       3    2        TABLE ACCESS FULL XX_TEMP (Cost=4 Card=2 Bytes=26)
    Statistics
              5  user calls
              0  physical read total multi block requests
              0  physical read total bytes
              0  cell physical IO interconnect bytes
              0  commit cleanout failures: block lost
              0  IMU commits
              0  IMU Flushes
              0  IMU contention
              0  IMU bind flushes
              0  IMU mbu flush
              1  rows processed
    Plan
    1 Every row in the table XX_TEMP  is read.
    2 Processing was stopped when the specified number of rows from step 1 were processed.
    3 The rows were sorted to support a group operation (MAX,MIN,AVERAGE, SUM, etc).
    4 Rows were returned by the SELECT statement.
    COUNT STOPKEY knows how many rows you want and will just keep calling its child function under it in the execution plan tree to get more and more rows, until the required amount of rows have been returned. Here it stopped at 1 iteration.
    And to answer your second question : as to which is the fastest way to to check  for an existence of record :
    Answer would be it depends on your requirement.  possible answers are :  Rowid --  fastest way to check for a row.   similar answers can be Index etc.. but all this is relative to what you work with.
    Cheers,
    Manik.

  • I had downloaded Mountain OX and installed it on my macbook air.  The notes app is now not working.  I get the following message erminating app due to uncaught exception 'MFSQLiteException', reason: 'checking for existence of object' abort() called termin

    i had downloaded Mountain OX and installed it on my macbook air.  The notes app is now not working.  I get the following message
    "Terminating app due to uncaught exception 'MFSQLiteException', reason: 'checking for existence of object'
    abort() called
    terminate called throwing an exception"
    Can someone help me with solving the problem.

    i had downloaded Mountain OX and installed it on my macbook air.  The notes app is now not working.  I get the following message
    "Terminating app due to uncaught exception 'MFSQLiteException', reason: 'checking for existence of object'
    abort() called
    terminate called throwing an exception"
    Can someone help me with solving the problem.

  • FM FOR CREATING NEW CONDITION RECORDS FROM INPUT FILE

    Hello vikas,
    I need to develop a interface program FOR CREATING NEW CONDITION RECORDS FROM INPUT FILE.
    Is there ay function module to update or create the condtion records,
    if u have any example interface program to update conditions records please send me.
    regards
    ram.

    This must be your compiler output.
    Basically, it is telling you two things that are wrong - in syntax.
    1. On line number 11 of the file RationalCollection1.java, the compiler expects a type identifier - that would be the object or return type such as int, String, boolean, etc.
    The reason it is doing this is probably due to your not ending a previous statement - like the "expected ';'" error statement. Check your code, make sure that methods (brackets) are closed correctly and there are no open statements (i.e. missing the semi-colen at the end).
    2. On line number 33 of the file RationalCollection1.java, the compiler expected the closing bracket. Thus, you didn't put the bracket where the compiler wants it.
    It appears that you have skipped some lines of code. Those lines are the problem, post them - post lines 30-36 and 9-15 so we can see what is happening around those error lines.

  • How to create  a datasource for 0COSTCENTER to load data in csv file  in BI

    how to create  a datasource for 0COSTCENTER to load data in csv file  in BI 7.0 system
    can you emil me the picture of the step about how to  loaded individual values of the hierarchy using CSV file
    thank you very much
    my emil is <Removed>
    allen

    Step 1: Load Required Master Data for 0CostCenter in to BI system
    Step 2: Enable Characteristics to support Hierarchy for this 0Cost Center and specify the External Characteristic(In the Lowest Node or Last Node) while creation of this Characteristic InfoObject
    Step 3: On Last Node of Hierarchy Structure in the InfoObject, Right Click and then Create Hierarchy MANUALLY by Inserting the Master Data Value as BI dosent Support the Hierarchy load directly you need to do it manually....
    Step 4: Mapping
    Create Text Node thats the first node (Root Node)
    Insert Characteristic Nodes
    Insert the Last Node of the Hierarchy
    Then you need to create a Open hub Destination for extracting data into the .csv file...
    Step1 : Create the Open Hub Destination give the Master Data table name and enter all the fields required....and create the transformations for this Open Hub connecting to the External file or excel file source...then give the location on to your local disk or path of the server in the first tab and request for the data...It should work alright let me know if you need anything else...
    Thanks,
    Sandhya

  • Count total no of records in csv file

    hello
    i made a function which count total no of records in csv file.
    but it always return 0 goes in the exception when no data found which
    it also display the total no of records in another parameter.
    code is here
    CREATE OR REPLACE FUNCTION COUNT_RECORDS_CSV (storeid1 number ) RETURN NUMBER
    IS
    wfile_handl UTL_FILE.FILE_TYPE;     
    v_file varchar(100);
    S VARCHAR2(32767);
    c number :=0;
    v_dir VARCHAR2 (50) := 'REPORTS';
    BEGIN
    v_file :='DATA_'||storeid1 ||'.CSV';
    DBMS_OUTPUT.PUT_LINE('V_FILE='||v_file);
    wfile_handl := UTL_FILE.FOPEN(v_dir,'DATA_5138.CSV','R');
    LOOP
    UTL_FILE.GET_LINE(wfile_handl,S);
    C := C + 1;
    END LOOP;
    UTL_FILE.FCLOSE(wfile_handl);
    RETURN C;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    RETURN 0;
    END COUNT_RECORDS_CSV;
    if i print the values of c it show me correct result but it always return 0 can any body told me why its happening.
    thanks

    The fact that you have written this:
    EXCEPTION
      WHEN NO_DATA_FOUND THEN
        RETURN 0;means you didn't bother to read this.

  • Check for existence of a node?

    What is the best way to check for the existence of a node (before attempting to delete it or perform other operation on it)? Maybe assign it an "id" then search for that id?

    If the node is in a Container you can use lookup(id: String): Node function.
    Documentation
    Or directly call it from the scene:
    Documentation
    Enjoy!

  • File adapter SyncRead Operation adds "???" to first record of csv file

    Hi All,
    One interface is reading one CSV file (containing two fields only) using SyncRead Operation of File Adapter. But I found, when file adapter parsed the data it appends "???" to first field of the first record which cause further data validation in the process.
    Test.csv file
    123456,159357
    147258,987654
    Trace of the FileAdapter:
    <messages>
    <Invoke_FILE_Inbound_InputVariable>
    <part  name="Empty">
    <empty/>  
    </part>
    </Invoke_FILE_Inbound_InputVariable>
    <Invoke_FILE_Inbound_OutputVariable>
    <part  name="body">
    <Root-Element>
    <TestElements>
    <Emplid>���123456</Emplid>  
    <SupId>159357</SupId>
    </TestElements>
    <HRRespIDElements>
    <Emplid>147258</Emplid>  
    <SupId>987654</SupId>
    </TestElements>
    </Root-Element>
    </part>
    </Invoke_FILE_Inbound_OutputVariable>
    </messages>
    Can anyone help me to understand , what is reason? Or I missed anything.
    Thanks & Regards,
    Sharmistha

    Unfortunately, this is documented bahaviour (solution/workaround anyone?!):
    Elapsed Time Exceeds:
    Specify a time which, when exceeded, causes a new outgoing file to be created.
    Note:
    The Elapsed Time Exceeds batching criteria is evaluated and a new outgoing file is created, only when an invocation happens.
    For example, if you specify that elapsed time exceeds 15 seconds, then the first message that is received is not written out, even after 15 seconds, as batching conditions are not valid. If a second message is received, then batching conditions become valid for the first one, and an output file is created when the elapsed time exceeds 15 seconds.

  • Duplicate record in CSV file

    Hi
    Needed your inputs to take forward this scenario
    It is an IDOC - CSV File scenario where WBS elements are sent across in the file to the legacy system
    9 fields are sent in the file and in those 2 fields are mapped with constants .
    Requirement here is to have a duplication of record in the file with only one constant changed  My CSV file should look like this for each IDOC occurence
         AAA,0123.45,Edgbaston,1234,WBS_Code1,,Airline,
         AAA,0123.45,Edgbaston,1234,WBS_Code2,,Airline,
    it would just be the duplication of record with only one field changed (WBS_Code1 and WBS_code2) so that each IDOC occurence would comprise one WBSelement information sent from the IDOC and the generated file  would have 2 lines of the same record
    Thanks
    Anusha

    Hi
    Unable to get you and I have my receiver strcuture as  mentioned below .And only last 2fields are getting populated from the IDOC and rest all mapped with the constants
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_WBSCodes xmlns:ns0="http://us.abc.com/PI/aaaat">
    <WBSFile> 0..unbounded
    <RecordTypeIdentifier>FIELDLISTVALUES</RecordTypeIdentifier>
    <CompanyID>UNIT_TOP</CompanyID>
    <CustomFieldID>CL_WBS_CODE_1</CustomFieldID>
    <CustomFieldValue1></CustomFieldValue1>
    <CustomFieldValue2></CustomFieldValue2>
    <Status></Status>
    </WBSFile>
    <WBSFile>0..unbounded
    <RecordTypeIdentifier>FIELDLISTVALUES</RecordTypeIdentifier>
    <CompanyID>UNIT_TOP</CompanyID>
    <CustomFieldID>CL_WBS_CODE_2</CustomFieldID>
    <CustomFieldValue1> - </CustomFieldValue1>
    <CustomFieldValue2></CustomFieldValue2>
    <Status></Status>
    </WBSFile>
    </ns0:MT_WBSCodes>
    Edited by: Anusha  Ramsiva on Sep 3, 2010 4:58 PM

  • Loading records from .csv file to SAP table via SAP Program

    Hi,
    I have a .csv file with 132,869 records and I am trying to load it to an SAP table with a customized SAP program.
    After executing the program, only 99,999 records are being loaded into the table.
    Is there some setting to define how many records can be loaded into a table? Or what else could be the problem?
    Pls advice.
    Thanks!!!

    hi Arun ,
    A datasource need a extract structure to fetch data .It is nothing but a temp table to hold data.
    First you need to create atable in SE11 with fields coming from CSV file.
    Then you need to write a report program to read you CSV file and populate your table in BW .
    Then you can create a datasource on top of this table .
    After that replicate and load data at PSA and use to upper flow.
    Regards,
    Jaya Tiwari

  • How to Query remote PC's registry by OU for 2 values and export to CSV file.

    I'm new to scripting and to Powershell but this is what I have managed to put together so far. Of course it fails. We have two custom entries in the registry that I want to query remote workstations for these values, Monitor 1 and Monitor 2. Output to a
    CSV along with the workstations name. Because of our AD structure I figured its just easier to input the OU individually as seen in the script. That portion of the script seems to work. I get the following error in bold when I run the script: I've Google'd
    and tinkered with this for a week now with no resolution and seem to be going in circles.  And yes, I had help to get this far.
    Exception calling "OpenRemoteBaseKey" with "2" argument(s): "The network path was not found.
    At C:\utils\RegMonitor2.ps1:33 char:5
    +     $regKey = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey($Hive,$result.pro ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
        + FullyQualifiedErrorId : IOException
    Exception calling "OpenRemoteBaseKey" with "2" argument(s): "The network path was not found.
    At C:\utils\RegMonitor2.ps1:33 char:5
    +     $regKey = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey($Hive,$result.pro ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
        + FullyQualifiedErrorId : IOException
    # 1) Searches Active Directory for all Computers under said OU
    # 2) Searches remote registry of those machines for the mentioned Monitor and Monitor2 subkeys.
    # 3) Exports CSV (Can be opened and saved as excel format later) with ordered columns Computername, Monitor1 value, monitor2 value.
    # ================================================================
    $SearchPath = "OU=XXX,OU=XXX,OU=XXX,DC=XXX,DC=XXX,DC=XXX"
    $objSearcher = New-Object System.DirectoryServices.DirectorySearcher
    $objSearcher.SearchRoot = New-Object System.DirectoryServices.DirectoryEntry("LDAP://$SearchPATH")
    $objSearcher.PageSize = 1000
    $objSearcher.Filter = "(objectClass=computer)"
    $objSearcher.SearchScope = "Subtree"
    $colProplist = "name"
    $colResults = $objSearcher.FindAll()
    $Store = @()
    $Hive = [Microsoft.Win32.RegistryHive]"LocalMachine";
    foreach ($result in $colResults)
    # Use $result.properties.name to retreive ComputerName
    $obj = New-Object PsObject
    $obj | Add-member -type noteproperty -name "Computername" -Value $result.properties.name
    $regKey = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey($Hive,$result.properties.name);
    $ref = $regKey.OpenSubKey("SYSTEM\CurrentcontrolSet\control\Session Manager\Environment");
    $obj | Add-member -type Noteproperty -name "Monitor1" -value $ref.OpenSubKey("Monitor")
    $obj | Add-member -type Noteproperty -name "Monitor2" -value $ref.OpenSubKey("Monitor2")
    $store += $obj
    $store | Select-Object Computername,Monitor1,Monitor2 | Export-CSV -noTypeInformation -Path "Pathtosave.csv"
    People are always promising the apocalypse. They never deliver.
    Ok, I have modified the end of the script a bit, and no more error: Instead I get an unexpected output.
    foreach ($result in $colResults)
        # Use $result.properties.name to retreive ComputerName
        $obj = New-Object PsObject
        $obj | Add-member -type noteproperty -name "Computername" -Value $result.properties.name
        $regKey = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey($Hive,$result.properties.name);
        $ref = $regKey.OpenSubKey("SYSTEM\CurrentcontrolSet\control\Session Manager\Environment");
        $obj | Add-member -type Noteproperty -name "Monitor1" -value $ref.OpenSubKey("Monitor")
        $obj | Add-member -type Noteproperty -name "Monitor2" -value $ref.OpenSubKey("Monitor2")
        $store += $obj
    $store | Select-Object Computername,Monitor1,Monitor2 | Export-CSV -noTypeInformation -Path "C:\Utils\Data.csv"
    Unexpected output:
    "Computername","Monitor1","Monitor2"
    "System.DirectoryServices.ResultPropertyValueCollection",,
    "System.DirectoryServices.ResultPropertyValueCollection",,
    "System.DirectoryServices.ResultPropertyValueCollection",,

    Hi,
    What do your registry values look like in the Monitor and Monitor2 subkeys?
    EDIT: This might help:
    # Retrieve list of computers using Get-ADComputer and process each
    Get-ADComputer -Filter * -SearchBase 'OU=Test PCs,DC=domain,DC=com' | ForEach {
    # Verify PC is alive
    If (Test-Connection $_.Name -Quiet -Count 1) {
    # Connect to registry
    $remoteHive = [Microsoft.Win32.RegistryHive]“LocalMachine”;
    $regKey = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey($remoteHive,$($_.Name))
    # Open the Environment key
    $ref = $regKey.OpenSubKey('SYSTEM\CurrentcontrolSet\control\Session Manager\Environment')
    # Create an ordered hashtable with the data from string values named 'String Value One/Two' in Monitor and Monitor2 subkeys
    # You'll need to adjust these values based on your actual data
    # If you are running v2, remove [ordered] below (so the line reads $props = @{)
    $props = [ordered]@{
    Computer=$_.Name
    Monitor =$ref.OpenSubKey('Monitor').GetValue('String Value One')
    Monitor2=$ref.OpenSubKey('Monitor2').GetValue('String Value Two')
    # Create a custom object based on the hashtable above
    New-Object PsObject -Property $props
    } | Sort-Object Computer | Export-Csv .\MonitorRegistryCheck.csv -NoTypeInformation
    # The line above sorts the output object by the computer name and then exports the object to a CSV file
    Don't retire TechNet! -
    (Don't give up yet - 12,575+ strong and growing)

  • Inserting Record into CSV file from BizTalk Orchestration

    Scenario:
    1.Receive file from Source system via RecvPipeline
    2.In Orchestration  extracting some values like ENO,Ename,Salary etc.these values to be added in to CSV file from Expression Shape.How to append/add emp records in to CSV with out overriding the rows.
    Ex:If we submitted 10 files then the CSV file should contain 10 rows in CSV.
    Let me know how to create CSV file from Orchestration and how to add rows into that csv value
    Regards BizTalkWorship

    Simple.
    Receive the message through a Receive Port/Location.
    Create a flat-file schema representing the CSV file structure. Ensure each row is delimited by “{CR}{LF}”. 
    This flat-file schema should only contain the element which you want to see in the destination CSV file like ENO,Ename,Salary etc.
    Have a map where the source schema should be the one which represents the received file and destination schema should be the one which is above created flat-file schema.
    Map the source schema to the destination schema mapping the filed 
    ENO,Ename,Salary etc.
    Have a custom send pipeline with flat-file assembler component it. Use this send pipeline in the send port.
    In send port, configure the send filter like “BTS.ReceivePortName == YourReceivePortName”. Configure the send port’s “Outbound Maps” to the map which you have created in
    above step
    Key Point. In your send port, set the “Copy Mode” property to “Append” from default “Create New”
    With your send port’s, “Copy Mode” property configured to “Append” this will append the value of the output to the existing file. Since in your flat-file schema, each record
    is delimited by “{CR}{LF}” and since you’re overwriting the output file you will have one file with records appended. So if 10 files received, instead of 10 output files, you will have 1 CVS file with 10 rows.
    If you want to construct the message in Orchestration as do, you do as opposed to map in send port at outbound map you can still do.
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • Restrict records in CSV file based on condition

    Greetings. I searched the forum for my issue and didn't find an answer or the right search terms. I am running APEX 4.1.1
    I have a report on a page. I am showing all records for a given SQL statement in my table, but in the "Export to CSV" I need to limit the output based on one of the fields. So for example, if I had a report like:
    SELECT x, y, Z
    FROM Table1
    I would like the Export to CSV for that table to limit the output such as:
    SELECT x, y, Z
    FROM Table1
    WHERE Z = 1
    Is that possible?
    Thanks!
    John

    Hi John,
    I have tested the login now and the above works for Interactive report only and for Classic report you need to do something like this because the request is set to different value
    SELECT x, y, Z
    FROM Table1
    WHERE ((Z = 1 and nvl(:REQUEST,'X') like 'FLOW_EXCEL_OUTPUT%') OR nvl(:REQUEST,'X') not like 'FLOW_EXCEL_OUTPUT%')See this working example http://apex.oracle.com/pls/apex/f?p=46417:25
    When you export to csv you will only get dept 10 records

  • Function module for move internal table records into MSexcel file

    Hi all,
    Tell me the function module which is used to
    move internal table records in to MSexcel file.
    Give the sample program...

    Please search the forum for FM  "GUI_DOWNLOAD" You will get tons of threads with sample code.
    Also take a look into SAP_CONVERT_TO_XLS_FORMAT
    Thanks

  • How to use GUI_upload for Uploading a CSV file in Microsoft Excel.

    Hi Guys,
                  can anybody tell me how to Upload the CSV format file in Microsoft excel sheet?
    Thanks,
    Gopi.

    Hi Gopi,
    u can use GUI_UPLOAD, TEXT_CONVERT_XLS_TO_SAP.
    Please check these codes.
    Uploading data from CSV file format into internal table using GUI_UPLOAD
    REPORT zupload MESSAGE-ID bd.
    DATA: w_tab TYPE ZTEST.
    DATA: i_tab TYPE STANDARD TABLE OF ZTEST.
    DATA: v_subrc(2),
    v_recswritten(6).
    PARAMETERS: p_file(80)
    DEFAULT 'C:\Temp\ZTEST.TXT'.
    DATA: filename TYPE string,
    w_ans(1) TYPE c.
    filename = p_file.
    CALL FUNCTION 'POPUP_TO_CONFIRM'
    EXPORTING
    titlebar = 'Upload Confirmation'
    * DIAGNOSE_OBJECT = ' '
    text_question = p_file
    text_button_1 = 'Yes'(001)
    * ICON_BUTTON_1 = ' '
    text_button_2 = 'No'(002)
    * ICON_BUTTON_2 = ' '
    default_button = '2'
    * DISPLAY_CANCEL_BUTTON = 'X'
    * USERDEFINED_F1_HELP = ' '
    * START_COLUMN = 25
    * START_ROW = 6
    * POPUP_TYPE =
    * IV_QUICKINFO_BUTTON_1 = ' '
    * IV_QUICKINFO_BUTTON_2 = ' '
    IMPORTING
    answer = w_ans
    * TABLES
    * PARAMETER =
    * EXCEPTIONS
    * TEXT_NOT_FOUND = 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.
    CHECK w_ans = 1.
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    filename = filename
    * FILETYPE = 'ASC
    has_field_separator = 'X'
    * HEADER_LENGTH = 0
    * READ_BY_LINE = 'X'
    * IMPORTING
    * FILELENGTH =
    * HEADER =
    TABLES
    data_tab = i_tab
    EXCEPTIONS
    file_open_error = 1
    file_read_error = 2
    no_batch = 3
    gui_refuse_filetransfer = 4
    invalid_type = 5
    no_authority = 6
    unknown_error = 7
    bad_data_format = 8
    header_not_allowed = 9
    separator_not_allowed = 10
    header_too_long = 11
    unknown_dp_error = 12
    access_denied = 13
    dp_out_of_memory = 14
    disk_full = 15
    dp_timeout = 16
    OTHERS = 17.
    * SYST FIELDS ARE NOT SET BY THIS FUNCTION SO DISPLAY THE ERROR CODE *
    IF sy-subrc <> 0.
    v_subrc = sy-subrc.
    MESSAGE e899 WITH 'File Open Error' v_subrc.
    ENDIF.
    INSERT ZTEST FROM TABLE i_tab.
    COMMIT WORK AND WAIT.
    MESSAGE i899 WITH sy-dbcnt 'Records Written to ZTEST'.
    Uploading data from Excel file format into internal table using TEXT_CONVERT_XLS_TO_SAP
    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.
    reward if helpful
    raam

Maybe you are looking for

  • GT70 Dominator Pro 2PE Freezing on Alt tab

    Hi there, first post just wondering if anyone can think of any fixes I haven't. Basically for about a little over a week now my laptop freezes whenever I alt tab out of a game. I can play fine, games will run great but as soon as I alt tab out and th

  • Where clause problem with sub-queries in forms 6i

    where is the best place to put a sub query?? I have been using the set block property, however when running a sub query an alternative method must be used. what are some other options?? I have tried to have the query directly in the data block proper

  • Sun DS 5.2 p3 with Solaris 10

    I've been trying to test out using LDAP to replace NIS. My setup is a Sun Sparc box with Solaris 10 running Sun One Directory 5.2 patch level 3. I have two x86_64 client machines; one running Red Hat 4 and the other Solaris 10. I have been able to au

  • Is it no longer possible to convert pdf file to Word free in Reader X (and later)?

    I really don't want to have to pay a subscription fee to be able to convert pdf files to Word documents.  In my work, this need comes up frequently with scanned & emailed documents, but since upgrading it appears that it is no longer a free feature. 

  • Computer won't go to sleep manually.

    When i try to put my mac to sleep from apple menu, it turns my monitor off, but fans and hard drive to not hibernate. When i try to awake, it does not. I have to then hold the power button down to turn off and restart. I have a belkin powered usb hub