Problem in reading the excel file path in WINDOWs machine from UNIX environ

Hello friends,
My requirement is to read each row of the excel sheet and sent that row to the database. I have implemented it by using jxl and apache poi framework. locally in my WINDOWS machine it is working fine..
But when i deploy the code in UNIX machine. My application runs on a Unix server , trying to read the excel file in WINDOWS environment. I am not able to retrieve the file path. for ex : C:\Documents and Settings\sabbanik\My Documents\KARUNAKAR\excel.xls
I am getting error in this line
workbook = Workbook.getWorkbook(filepath)
Error message : input file not found.
Thanks in advance..

You said: I am getting error in this line workbook = Workbook.getWorkbook(filepath) >
Based on this, I will assume you are trying to use OLE to access information about the Excel file. As mentioned by Andreas, your code will be executing on the server (Unix) and since Excel isn't on the server (and cannot be) an error will result. OLE can only be used in Windows environments (client or server). To access client side OLE calls and content, you need a java bean and Excel installed on the client machine. Oracle provides WebUtil as an option to writing your own Java Bean. To use this, you will need to be running Forms 10.1.2 or newer. Details can be found here along with a demo:
http://www.oracle.com/technetwork/developer-tools/forms/webutil-090641.htm

Similar Messages

  • How can I read the EXCEL file while Program is running in background.

    Hi all Expert,
    How can I read the EXCEL file while Program is running in background.
    Thanks

    you need to place ur excel file on application server and follow this thread: Reading an Excel file from the application server?
    loots of information if you can search forum.. thanks

  • Problem while opening the excel files

    Hi
    In my system , i have excel reports in my server disk . And i am opening the excel files through an action class like /viewReport.do?id=23 .....and thus from the action class i open my excel file .
    After opening one excel file , i try to open another excel by clicking that link , then my system often hangs else excel shows an error saying "a report with name viewReport.do is already open " even though both of these files are different on the server
    How can i avoid this ??
    The reason why i am opening the excel file through an action class is , i need to perform some operations before opening that excel report
    i tried by setting the
    response.setHeader("Content-disposition","attachment; filename=myWorksheet.xls");
    and i kept on changing the names but that doesnt work
    Can any one let me know how to go abt this ??

    Hi Sir,
    I found you posted the issue in the
    APS.NET forum, and you seems use some code to open the file. Have you tried the last link in the thread?
    Then, let's do some test to narrow down the issue.
    I notice that you are using Office 2010, does the issue occur only with 'Reachlocal.xlsx' or every existed file?
    If every Excel file has the issue, please try the following methods:
    Open the file in
    safe mode.
    Repair Office 2010.
    On the other hand, this problem might be caused by malware on the affected machine. There are now two known variants of malware which causes this problem: Win32/Crilock.A and
    Win32/Buma!rts. They have both been identified as a new family of
    ransomware.  
    http://blogs.technet.com/b/the_microsoft_excel_support_team_blog/archive/2013/09/07/quot-cannot-open-the-file-because-the-file-format-or-extension-is-invalid-quot-opening-office-files.aspx                                   
    If you have any further assistance about code/program, I recommend you post the question to MSDN forum:
    http://social.msdn.microsoft.com/Forums/en-US/home?forum=exceldev&filter=alltypes&sort=lastpostdesc
    Regards,
    George Zhao
    TechNet Community Support

  • How to read the excel file using webdynpro abap?

    Hi,
    how to read and modify excel file using webdynpro abap?
    Regards,
    Pavani

    For reading excel file follow the steps :
    1. Use a File upload UI element and bind it with xstring.
    2. Now your excel will be uploaded and stored in Xstring.
    3. Convert Xstring to String data using FM 'HR_KR_XSTRING_TO_STRING'.
    4. Now split the string at new line so as to make an internal table .
      Ex . SPLIT l_string  AT cl_abap_char_utilities=>newline INTO TABLE it_table.
      here it_table is type table of string.
    5.now loop at the internal table and separate the content of this table separated by tab.
      Ex. SPLIT wa_table AT cl_abap_char_utilities=>horizontal_tab INTO TABLE it_new.
    it_new type string_table.
    6. For more info , refer this thread :
    Re: How to upload excel file in Webdynpro application using ABAP

  • My java program can't read the EXCEL file generated by BI Publisher

    I have a program that generates excel file and another program that reads the previously generated file.
    I'm getting this error when my code reads the file using the "HSSFWorkbook" object:
    Exception in thread "main" java.io.IOException: Invalid header signature; read 3271134372600964429, expected -2226271756974174256
         at org.apache.poi.poifs.storage.HeaderBlockReader.<init>(HeaderBlockReader.java:112)
         at org.apache.poi.poifs.filesystem.POIFSFileSystem.<init>(POIFSFileSystem.java:151)
         at org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:298)
    Edited by: user1900500 on Mar 11, 2011 3:37 PM

    If you're using JDK 5 or later, you could use the Scanner class for input information. See below:
    try {
                   Scanner reader = new Scanner(new File("C:\\boot.ini"));
                   StringBuilder sb = new StringBuilder();
                   while (reader.hasNextLine()) {
                        sb.append(reader.nextLine());
                        sb.append(System.getProperty("line.separator"));
                   System.out.println(sb.toString());
              } catch (FileNotFoundException e) {
                   e.printStackTrace();
              }

  • Take Source file path in sender adapter from an environment variable .

    Hi,
    Is it possible to take source file path(half file path) dynamically in sender file adapter.
    Please suggest any alternative to this.

    Hi,
    One option, use Dynamic Configuration and set the values in the Mapping.
    By the ways, the File Directory and the Filename are taken runtime in the file adapters after transportation.
    Only if you are using FTP will you need to key in the FTP addess user id password etc.
    Refer -- same way try for File adapter
    Dynamic Configuration of Some Communication Channel Parameters using Message Mapping
    Ps Note : I have personally never tried it to use the Dynamic Configuration for file path. But you can try.
    Thanks
    Swarup

  • IDOC to File Port on Windows Server from Unix SAP System

    Hi All:
    I want to use an IDOC to create a text file on a Windows server. The SAP system runs on Unix. I have no problem creating the text file on the same Unix server running the SAP instance but I can not figure out how to write the file to a share or UNC path on a Windows server. I tried to create a logical file path using transaction FILE and then create a logical port in WE21. The IDOC failed because it is still looking on the Unix server to write the file. Any ideas from the community would be greatly appreciated.

    Hmmm, there are probably lots of ways to skin this cat.
    To make the process asynchronous you probably want to be along the lines of either updating a table or placing a file on the Windows machine, and then having a database process or Windows program to watch for the file or database table entry and triggering your bat file when it appears.

  • Read Excel file path in WD

    Hi,
    We want to read a excel file. For that we are using file upload UI element and HSSF POI to read excel file. The code to read the excel file is working fine in standalone. In standalone we are hardcoding the file path. But in WD application, we are not hard coding it.
    We are using following code to supply the file name to HSSF code through  file upload UI:
    try
             InputStream in = new FileInputStream(wdContext.currentContextElement  
                                               ().getFileResource());
             wdComponentAPI.getMessageManager().reportSuccess("IN "+in);
             HSSFWorkbook wb  = new HSSFWorkbook(in);
    catch (Exception e)
         wdComponentAPI.getMessageManager().reportSuccess("ERROR in HSSF");
    Where FileResource is a context variable binded with property "data" of FileUpload UI element.
    Now, the problem is that the excel file is not getting read. We are getting ERROR in HSSF message.
    Please help in reading the file path.
    Regards,
    Vaibhav

    Hi,
       Try this:
    InputStream in = wdContext.currentContextElement().getFileResource().read(false);
    Regards,
    Satyajit.

  • In Vista,  Applet isn�t able to read the property files

    I�m working on internationalization; the Applet which I�m using wasn�t able to read the property files properly in windows Vista machine. But if I create a jar which contains all the classes and property files, Applet works fine.
    This problem is only in Vista machine ,In XP the JVM is smart enough to read plain .property files and its works well without creating the jar
    Is that related to any security enhancemence of vista over XP?
    Below is a link about The Java Security Model break on Windows Vista
    http://bugs.sun.com/view_bug.do?bug_id=6548078
    I tried a simple ResourceBundle.getBundle() in my Applet in different ways but nothing work fine for me. It isn�t an issue related to path, I guess because I tried several ways like.
    ResourceBundle labels = ResourceBundle.getBundle("LabelsBundle");
    ResourceBundle labels = ResourceBundle.getBundle("LabelsBundle",currentLocale);
    ResourceBundle labels = ResourceBundle.getBundle("com.test.LabelsBundle");
    ResourceBundle labels = ResourceBundle.getBundle("com.test.LabelsBundle",currentLocale);The exception got in java console is
    CONFIG: [2008-05-13 15:54:57.909]:(com.satm.insite.InsiteApplet$2@1696e4c):InisiteApplet: Exception:  java.util.MissingResourceException: Can't find bundle for base name LabelsBundle, locale en
    java.util.MissingResourceException: Can't find bundle for base name LabelsBundle, locale en
                at java.util.ResourceBundle.throwMissingResourceException(Unknown Source)
                at java.util.ResourceBundle.getBundleImpl(Unknown Source)
                at java.util.ResourceBundle.getBundle(Unknown Source)
                at com.satm.insite.InsiteApplet.displayValue(InsiteApplet.java:261)
                at com.satm.insite.InsiteApplet.callme(InsiteApplet.java:296)
                at com.satm.insite.InsiteApplet.initialize(InsiteApplet.java:327)
                at com.satm.insite.InsiteApplet$2.run(InsiteApplet.java:235)
                at com.satm.tools.languageTools.ThreadPool$ExceptionCatchingThread.run(ThreadPool.java:226)Is there any way to make it work in Windows Vista machine�? This could be a great help for me.
    Thanks
    Robert

    Crossposted:
    http://forum.java.sun.com/thread.jspa?threadID=5295743&messageID=10250558#10250558
    http://forum.java.sun.com/thread.jspa?threadID=5295742&messageID=10250556#10250556

  • How to make SSIS Read an Excel File?

    I’ve been trying for a while now (won’t say how long), to get BIDS to read a very simple Excel file. 
    I’m talking SIMPLE!!  No matter what I don, SSIS keeps throwing an error, and of course it doesn’t say what the error is, so I can’t really debug it. 
    I’ve tried this at least 20x with flat files, and it works perfect each time. 
    I’ve done Data Conversions, Sorting, Union All, and several other Transformations; all work perfect. 
    Trying to used Excel as a data source, is proving to be a mind numbing experience. 
    Of over 20 different attempts, it hasn’t worked even once. 
    I can make it as simple as you can possibly imagine, and SSIS, refuses to even perform the first step (I’m not even trying to create a table in SQL Server anymore). 
    I have the Excel file path (very simple)
    I have the Excel version (very simple)
    I have the Connection Manager (very simple)
    I have the Sheet name (very simple)
    All I can do is see a preview of the Excel sheet before the process runs.  As soon as I het F5, I get an instant error, for no reason whatsoever, and no debugging options, whatsoever.
    Is there some secret trick I need to know about? 
    I can't show a snap shot, because MSFT won't allow pictures to be loaded now.

    I have this from the Output window:
    SSIS package "Package.dtsx" starting.
    Information: 0x4004300A at Data Flow Task, SSIS.Pipeline: Validation phase is beginning.
    Error: 0xC00F9304 at Package, Connection manager "Excel Connection Manager 1": SSIS Error Code DTS_E_OLEDB_EXCEL_NOT_SUPPORTED: The Excel Connection Manager is not supported in the 64-bit version of SSIS, as no OLE DB provider is available.
    Error: 0xC020801C at Data Flow Task, Excel Source [114]: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.  The AcquireConnection method call to the connection manager "Excel Connection Manager 1" failed with error code 0xC00F9304. 
    There may be error messages posted before this with more information on why the AcquireConnection method call failed.
    Error: 0xC0047017 at Data Flow Task, SSIS.Pipeline: component "Excel Source" (114) failed validation and returned error code 0xC020801C.
    Error: 0xC004700C at Data Flow Task, SSIS.Pipeline: One or more component failed validation.
    Error: 0xC0024107 at Data Flow Task: There were errors during task validation.
    SSIS package "Package.dtsx" finished: Failure.
    I have this from the Progress window:
    some stuff . . . doesn't seem very relevant
    [Excel Source [114]] Error: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.  The AcquireConnection method call to the connection manager "Excel Connection Manager 1" failed with error code 0xC00F9304.  There may be error messages
    posted before this with more information on why the AcquireConnection method call failed.
    [Connection manager "Excel Connection Manager 1"] Error: SSIS Error Code DTS_E_OLEDB_EXCEL_NOT_SUPPORTED: The Excel Connection Manager is not supported in the 64-bit version of SSIS, as no OLE DB provider is available.
    some stuff . . . doesn't seem very relevant

  • Read an excel file using JSP in MII 12.1

    Hi,
    I want to read an excel file using jsp page. I dont want to use the UDS or ODBC for connecting to excel.
    I am trying to use org.apache.poi to read the excel file in jsp page.
    While running, its showing a compilation error "package org.apache.poi.hssf.usermodel does not exist"
    I have the jar files for it, where do we need to upload it so that jsp page works.
    Thanks a lot
    Regards,
    Neha Maheshwari

    The user doesn't want to save the excel file in server.
    I want to upload file and save its contents in database.
    I have the code to read and save excel data in database but not able to get the location to deploy the jar file.
    In general, if we are creating a jsp page in MII workbench which is using some jar file.
    Whats the location to upload this jar file so that the jsp page works correctly?

  • Reading an EXCEL file from Oracle PL/SQL (HP-Unix server)

    Hi,
    I have the following requirement:
    1. Get the EXCEL file from the remote FTP location
    2. Read the EXCEL file and convert it into the CSV file format.
    3. Put the CSV file into another FTP location.
    I need to get all these points done using Oracle PL/SQL procedure.
    I am using the Oracle 9i installed in HP-Unix environment.
    Please help me in getting this done.
    Thanks

    Ok, setting up Excel as an External Database connection....
    1- Go to Control Panel>Administrative Tools>Data Sources (ODBC)>System DSN and create a data source with appropriate driver. Name it EXCL.
    2- In %ORACLE_HOME%\Network\Admin\Tnsnames.ora fie add entry:
    EXCL =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 10.12.0.24)(PORT = 1521))
    (CONNECT_DATA =
    (SID = EXCL)
    (HS = OK)
    Here SID is the name of data source that you have just created.
    3- In %ORACLE_HOME%\Network\Admin\Listener.ora file add:
    (SID_DESC =
    (PROGRAM = hsodbc)
    (SID_NAME = <hs_sid>)
    (ORACLE_HOME = <oracle home>)
    under SID_LIST_LISTENER like:
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = d:\ORA9DB)
    (PROGRAM = extproc)
    (SID_DESC =
    (GLOBAL_DBNAME = ORA9DB)
    (ORACLE_HOME = d:\ORA9DB)
    (SID_NAME = ORA9DB)
    (SID_DESC =
    (PROGRAM = hsodbc)
    (SID_NAME = EXCL)
    (ORACLE_HOME = D:\ora9db)
    Dont forget to reload the listener
    c:\> lsnrctl reload
    4- In %ORACLE_HOME%\hs\admin create init<HS_SID>.ora. For our sid EXCL we create file initexcl.ora.
    In this file set following two parameters:
    HS_FDS_CONNECT_INFO = excl
    HS_FDS_TRACE_LEVEL = 0
    5- Now connect to Oracle database and create database link with following command:
    SQL> CREATE DATABASE LINK excl
    2 USING 'excl'
    3 /
    Database link created.
    Now you can perform query against this database like you would for any remote database.
    SQL> SELECT table_name FROM all_tables@excl;
    TABLE_NAME
    DEPT
    EMP
    But you're limited to Windows based servers for this.
    As for converting Excel to CSV and doing it yourself. I hope you know the internal format of MS Excel files cos you're gonna need to know it. It would be far easier if the "user" creating the Excel file could save a copy out in CSV format for you and then it's just a case of FTP'ing the file and using external tables to read the data.

  • Read an excel file and convert to a 1-D array of long, 32-bit integer?

    My vi right now reads an column of numbers as a 1-D array, but I need to input the numbers manually, and for what I'm trying to do, there could be anywhere between 100 to 500 numbers to input. I want the vi to be able to read the excel file and use that column of numbers for the rest, which the data type is long (32-bit integer).
    I have an example vi that is able to get excel values, but the output data type is double (64-bit real).
    I need to either be able to convert double(64-bit real) data to long (32-bit integer), or find another way to get the values from the excel file.

    Just to expand on what GerdW is saying.  There are many programs that hold exclusive access to a file.  So if a file is opened in Excel, the LabVIEW cannot access the file.
    What is the exact error code?  Different error codes will point to different issues.
    Make sure the csv file is exactly where you think it is and LabVIEW is pointing to the right place.  (I'm just going through stupid things I have done)
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Download read only excel file

    Hi Experts,
    How to download a READ ONLY excel file to workstation (local Machine).

    Hi kaleemullah,
    Steps to create a BDC program.
    1. Create an internal table with fields same as Excel sheet fields.
    2. Declare an internal table with BDCDATA table to store the BDC recording.
    3. Declare an internal table with BDCMSGCOL to store the error messages after
    the execution of the BDC.
    4. Write the code using the fun. module ALSM_EXCEL_TO_INTERNAL_TABLE
    to upload the data from the excel sheet.
    5. loop that internal table and write the Subroutines to fill the internal table
    BDCDATA with the recording of a specified Transaction Code.
    6. Using Call Transaction execute the BDC recording.
    7. Check Sy-subrc = 0 and store the error messages in the internal table.
    8. If you want you can pass those error records to a session using the SESSION method.
    Here is an example of a BDC program, but this program is from a text file. Change the function module WS_UPLOAD with ALSM_EXCEL_TO_INTERNAL_TABLE
    to upload an excel and write the program with your BDC recording. You can do recording using t-code SHDB.
    Sample Program:
    REPORT ZRAJ_DATASET_XD01 NO STANDARD PAGE HEADING LINE-SIZE 132
    LINE-COUNT 60
    MESSAGE-ID Z00.
    Table/Structure declarations. *
    TABLES : KNA1. "Customer master
    Constants declarations. *
    CONSTANTS : C_MODE VALUE 'N',
    C_UPDATE VALUE 'S',
    C_X VALUE 'X',
    C_SESS TYPE APQI-GROUPID VALUE 'ZCUSTOMER', "Session Name
    C_XD01 LIKE TSTC-TCODE VALUE 'XD01'.
    Variable declarations. *
    DATA : V_FNAME(15) VALUE SPACE, " Name of file to be created
    V_FAILREC TYPE I, " No of failed records
    V_MSG(255), " Message Text
    V_ERRREC TYPE I, " No of failed records
    V_LINES TYPE I. " No of records
    *-- FLAG DECLARATIONS
    DATA : FG_DATA_EXIST VALUE 'X', " Check for data
    FG_SESSION_OPEN VALUE ' '. " Check for Session Open
    Structures / Internal table declarations *
    *-- Structure to hold BDC data
    TYPES : BEGIN OF T_BDCTABLE.
    INCLUDE STRUCTURE BDCDATA.
    TYPES END OF T_BDCTABLE.
    *-- Structure to trap BDC messages
    TYPES : BEGIN OF T_MSG.
    INCLUDE STRUCTURE BDCMSGCOLL.
    TYPES : END OF T_MSG.
    *-- Structure to trap ERROR messages
    TYPES : BEGIN OF T_ERR_MSG,
    MESSAGE(255),
    END OF T_ERR_MSG.
    *--Internal table to store flat file data
    DATA:BEGIN OF IT_KNA1 OCCURS 0,
    KUNNR LIKE KNA1-KUNNR,
    KTOKD LIKE T077D-KTOKD,
    NAME1 LIKE KNA1-NAME1,
    SORTL LIKE KNA1-SORTL,
    ORT01 LIKE KNA1-ORT01,
    PSTLZ LIKE KNA1-PSTLZ,
    LAND1 LIKE KNA1-LAND1,
    SPRAS LIKE KNA1-SPRAS,
    LZONE LIKE KNA1-LZONE,
    END OF IT_KNA1.
    *-- Internal table to hold BDC data
    DATA: IT_BDCDATA TYPE STANDARD TABLE OF T_BDCTABLE WITH HEADER LINE,
    *-- Internal Table to store ALL messages
    IT_MSG TYPE STANDARD TABLE OF T_MSG WITH HEADER LINE,
    *-- Internal Table to store error messages
    IT_ERR_MSG TYPE STANDARD TABLE OF T_ERR_MSG WITH HEADER LINE.
    Selection Screen. *
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    PARAMETERS : P_FLNAME(15) OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS : R_LIST RADIOBUTTON GROUP GRP1.
    SELECTION-SCREEN COMMENT 5(20) TEXT-003.
    PARAMETERS : R_SESS RADIOBUTTON GROUP GRP1.
    SELECTION-SCREEN COMMENT 30(20) TEXT-004.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK B2.
    Event:Initialization *
    INITIALIZATION.
    AT Selection Screen. *
    AT SELECTION-SCREEN.
    Event: Start-of-Selection *
    START-OF-SELECTION.
    V_FNAME = P_FLNAME.
    PERFORM GET_DATA.
    PERFORM GENERATE_DATASET.
    Event: End-of-Selection *
    END-OF-SELECTION.
    IF FG_DATA_EXIST = ' '.
    MESSAGE I010 WITH TEXT-009.
    EXIT.
    ENDIF.
    PERFORM GENERATE_BDCDATA.
    PERFORM DISPLAY_ERR_RECS.
    Event: top-of-page
    TOP-OF-PAGE.
    FORM DEFINITIONS *
    *& Form get_data
    Subroutine to get the data from mard
    --> p1 text
    <-- p2 text
    FORM GET_DATA.
    CALL FUNCTION 'UPLOAD'
    EXPORTING
    CODEPAGE = ' '
    FILENAME = 'C:\XD01.TXT'
    FILETYPE = 'DAT'
    ITEM = ' '
    FILEMASK_MASK = ' '
    FILEMASK_TEXT = ' '
    FILETYPE_NO_CHANGE = ' '
    FILEMASK_ALL = ' '
    FILETYPE_NO_SHOW = ' '
    LINE_EXIT = ' '
    USER_FORM = ' '
    USER_PROG = ' '
    SILENT = 'S'
    IMPORTING
    FILESIZE =
    CANCEL =
    ACT_FILENAME =
    ACT_FILETYPE =
    TABLES
    DATA_TAB = IT_KNA1
    EXCEPTIONS
    CONVERSION_ERROR = 1
    INVALID_TABLE_WIDTH = 2
    INVALID_TYPE = 3
    NO_BATCH = 4
    UNKNOWN_ERROR = 5
    GUI_REFUSE_FILETRANSFER = 6
    OTHERS = 7
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    IF IT_KNA1[] IS INITIAL.
    FG_DATA_EXIST = ' '.
    ENDIF.
    ENDFORM. " get_data
    *& Form GENERATE_DATASET
    text
    --> p1 text
    <-- p2 text
    FORM GENERATE_DATASET.
    MESSAGE I010 WITH 'OPENING FILE IN APPLICATION SERVER'.
    **--Creating a data set in application server
    OPEN DATASET V_FNAME FOR OUTPUT IN TEXT MODE.
    **---Transfering data from internal table to dataset
    MESSAGE I010 WITH 'TRANSFERING DATA FROM INETERAL TABLE TO THE FILE'.
    LOOP AT IT_KNA1.
    TRANSFER IT_KNA1 TO V_FNAME.
    ENDLOOP.
    **--Closing the dataset
    MESSAGE I010 WITH 'CLOSING THE FILE'.
    CLOSE DATASET V_FNAME.
    ENDFORM. " GENERATE_DATASET
    *& Form BDC_DYNPRO
    text
    -->P_0467 text
    -->P_0468 text
    FORM BDC_DYNPRO USING PROGRAM DYNPRO.
    CLEAR IT_BDCDATA.
    IT_BDCDATA-PROGRAM = PROGRAM.
    IT_BDCDATA-DYNPRO = DYNPRO.
    IT_BDCDATA-DYNBEGIN = 'X'.
    APPEND IT_BDCDATA.
    ENDFORM.
    *& Form BDC_FIELD
    text
    -->P_0472 text
    -->P_0473 text
    FORM BDC_FIELD USING FNAM FVAL.
    IF NOT FVAL IS INITIAL.
    CLEAR IT_BDCDATA.
    IT_BDCDATA-FNAM = FNAM.
    IT_BDCDATA-FVAL = FVAL.
    APPEND IT_BDCDATA.
    ENDIF.
    ENDFORM.
    *& Form GENERATE_BDCDATA
    text
    --> p1 text
    <-- p2 text
    FORM GENERATE_BDCDATA.
    REFRESH IT_KNA1.
    Opening dataset for reading
    OPEN DATASET V_FNAME FOR INPUT IN TEXT MODE.
    Reading the file from application server
    DO.
    CLEAR: IT_KNA1,IT_BDCDATA.
    REFRESH IT_BDCDATA.
    READ DATASET V_FNAME INTO IT_KNA1.
    IF SY-SUBRC <> 0.
    EXIT.
    ELSE.
    Populate BDC Data for Initial Screen
    PERFORM : BDC_DYNPRO USING 'SAPMF02D' '0100',
    BDC_FIELD USING 'BDC_CURSOR' 'RF02D-KUNNR',
    BDC_FIELD USING 'BDC_OKCODE' '/00',
    BDC_FIELD USING 'RF02D-KUNNR' IT_KNA1-KUNNR,
    BDC_FIELD USING 'RF02D-KTOKD' IT_KNA1-KTOKD.
    Populate BDC Data for Second Screen
    PERFORM : BDC_DYNPRO USING 'SAPMF02D' '0110',
    BDC_FIELD USING 'BDC_CURSOR' 'KNA1-NAME1',
    BDC_FIELD USING 'BDC_OKCODE' '/00',
    BDC_FIELD USING 'KNA1-NAME1' IT_KNA1-NAME1,
    BDC_FIELD USING 'KNA1-SORTL' IT_KNA1-SORTL,
    BDC_FIELD USING 'KNA1-ORT01' IT_KNA1-ORT01,
    BDC_FIELD USING 'KNA1-PSTLZ' IT_KNA1-PSTLZ,
    BDC_FIELD USING 'KNA1-LAND1' IT_KNA1-LAND1,
    BDC_FIELD USING 'KNA1-SPRAS' IT_KNA1-SPRAS.
    Populate BDC Data for Third Screen
    PERFORM : BDC_DYNPRO USING 'SAPMF02D' '0120',
    BDC_FIELD USING 'BDC_CURSOR' 'KNA1-LZONE',
    BDC_FIELD USING 'BDC_OKCODE' '=UPDA',
    BDC_FIELD USING 'KNA1-LZONE' IT_KNA1-LZONE.
    CALL TRANSACTION C_XD01 USING IT_BDCDATA
    MODE C_MODE
    UPDATE C_UPDATE
    MESSAGES INTO IT_MSG.
    IF SY-SUBRC <> 0.
    *--In case of error list display
    IF R_LIST = C_X.
    V_ERRREC = V_ERRREC + 1.
    PERFORM FORMAT_MESSAGE.
    IT_ERR_MSG-MESSAGE = V_MSG.
    APPEND IT_ERR_MSG.
    CLEAR : V_MSG,IT_ERR_MSG.
    ENDIF.
    *--In case of session log
    IF R_SESS = C_X.
    *-- In case of transaction fails.
    IF FG_SESSION_OPEN = ' '.
    FG_SESSION_OPEN = C_X.
    PERFORM BDC_OPEN_GROUP.
    ENDIF. " IF FG_SESSION_OPEN = ' '.
    *-- Insert BDC Data..
    PERFORM BDC_INSERT_DATA.
    ENDIF. " IF R_SESS = C_X.
    ENDIF. " IF SY-SUBRC <> 0.
    ENDIF. " IF SY-SUBRC <> 0.
    ENDDO.
    Closing the dataset
    CLOSE DATASET V_FNAME.
    *-- Close the session if opened
    IF FG_SESSION_OPEN = C_X.
    PERFORM BDC_CLOSE_GROUP.
    CALL TRANSACTION 'SM35'.
    ENDIF.
    ENDFORM. " GENERATE_BDCDATA
    *& Form BDC_OPEN_GROUP
    text
    --> p1 text
    <-- p2 text
    FORM BDC_OPEN_GROUP.
    CALL FUNCTION 'BDC_OPEN_GROUP'
    EXPORTING
    CLIENT = SY-MANDT
    DEST = FILLER8
    GROUP = C_SESS
    HOLDDATE = FILLER8
    KEEP = C_X
    USER = SY-UNAME
    RECORD = FILLER1
    IMPORTING
    QID =
    EXCEPTIONS
    CLIENT_INVALID = 1
    DESTINATION_INVALID = 2
    GROUP_INVALID = 3
    GROUP_IS_LOCKED = 4
    HOLDDATE_INVALID = 5
    INTERNAL_ERROR = 6
    QUEUE_ERROR = 7
    RUNNING = 8
    SYSTEM_LOCK_ERROR = 9
    USER_INVALID = 10
    OTHERS = 11
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM. " BDC_OPEN_GROUP
    *& Form BDC_INSERT_DATA
    text
    --> p1 text
    <-- p2 text
    FORM BDC_INSERT_DATA.
    CALL FUNCTION 'BDC_INSERT'
    EXPORTING
    TCODE = C_XD01
    POST_LOCAL = NOVBLOCAL
    PRINTING = NOPRINT
    TABLES
    DYNPROTAB = IT_BDCDATA
    EXCEPTIONS
    INTERNAL_ERROR = 1
    NOT_OPEN = 2
    QUEUE_ERROR = 3
    TCODE_INVALID = 4
    PRINTING_INVALID = 5
    POSTING_INVALID = 6
    OTHERS = 7
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM. " BDC_INSERT_DATA
    *& Form BDC_CLOSE_GROUP
    text
    --> p1 text
    <-- p2 text
    FORM BDC_CLOSE_GROUP.
    CALL FUNCTION 'BDC_CLOSE_GROUP'
    EXCEPTIONS
    NOT_OPEN = 1
    QUEUE_ERROR = 2
    OTHERS = 3
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM. " BDC_CLOSE_GROUP
    *& Form FORMAT_MESSAGE
    text
    --> p1 text
    <-- p2 text
    FORM FORMAT_MESSAGE.
    CLEAR V_LINES.
    DESCRIBE TABLE IT_MSG LINES V_LINES.
    READ TABLE IT_MSG INDEX V_LINES.
    CLEAR V_MSG.
    CALL FUNCTION 'FORMAT_MESSAGE'
    EXPORTING
    ID = IT_MSG-MSGID
    LANG = IT_MSG-MSGSPRA
    NO = IT_MSG-MSGNR
    V1 = IT_MSG-MSGV1
    V2 = IT_MSG-MSGV2
    V3 = IT_MSG-MSGV3
    V4 = IT_MSG-MSGV4
    IMPORTING
    MSG = V_MSG
    EXCEPTIONS
    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.
    ENDFORM. " FORMAT_MESSAGE
    *& Form DISPLAY_ERR_RECS
    text
    --> p1 text
    <-- p2 text
    FORM DISPLAY_ERR_RECS.
    LOOP AT IT_ERR_MSG.
    WRITE: / IT_ERR_MSG-MESSAGE.
    ENDLOOP.
    ENDFORM. " DISPLAY_ERR_RECS
    Hope this resolves your query.
    Reward all the helpful answers.
    Regards

  • How can I read a Excel file?

    How can I read an Excel file and compare if the cells type are numeric or not??
    i hope you can can give me a hand..
    thanks

    If you want to use plsql try utl_file supplied package to read the excel file -> http://psoug.org/reference/utl_file.html
    And you can use a function like this to understand if the column is number or not ;
    CREATE OR REPLACE FUNCTION is_number (
    char_in VARCHAR2)
    RETURN BOOLEAN
    IS
    n NUMBER;
    BEGIN
    n := TO_NUMBER(char_in);
    RETURN TRUE;
    EXCEPTION
    WHEN OTHERS THEN
    RETURN FALSE;
    END is_number;
    DECLARE
    x BOOLEAN;
    BEGIN
    IF is_number('ABC') THEN
    dbms_output.put_line('TRUE');
    ELSE
    dbms_output.put_line('FALSE');
    END IF;
    END;
    /

Maybe you are looking for

  • Best practices to share 4 printers on small network running Server 2008 R2 Standard (service pack 1)

    Hello,  I'm a new IT admin at a small company (10-12 PCs running Windows 7 or 8) which has 4 printers. I'd like to install the printers either connected to the server or as wireless printers (1 is old enough to require a USB connection to a PC, no ne

  • Error message in PL/SQL

    Hi, I've created a PL/SQL process source (on load - before header) which counts the records of a table. If the number of records is 1 or less the values of the table are to be inserted in the text fields of my HTML form. If there is more than one rec

  • Access problem in bpel console

    I have bpel pm 10.1.2 and os is win2k. My problem is te list of domains is empty, and with no domain I am not able to login. I read some threads that said to install oracle db, but I am using mysql, and don't need a oracle database. Should I install

  • Fundamental j2ee classpath question

    hi folks -- I have a j2ee project with - a WAR (which has among other things a servlet in it) - a ejb project (which has a stateless session bean in it) I need to call the session bean from the servlet and my servlet code gets a reference to the bean

  • Is it normal that the DataSource field is blank when opening a master data

    Is it normal that the DataSource field is blank when opening a master data which is also an InfoSouce in InfoSource page. Just locate an InfoSource which is also a master data or data target where next to which is a green triangle picture icon in Inf