BEx Analyzer 7.0: Uploading txt-file

Hello experts,
when I start a query and want to upload a txt-file for variable selection, it takes minutes and hours (depending on how many entries are in the txt-file).
e.g. when using this BEx Analyzer 3.x and uploading txt-file with 60.000 entries for variable selection it takes just a few seconds. When using BEx Anlayzer 7.0 (selection upload) it takes 30 minutes an more.
Is there any solution for this?
Thanks in advance

Dear Toni,
Functionality has changed litle bit in BEx 7.0
From Clipboard:
1. After clicking on the "Select from List" click on the "More >>" button.
2. Click on the right box to set the focus.
3. Past (Ctrl + V).
From txt file:
1. After clicking on the "Select from List" click on the "More >>" button.
2. Right click on the right box and choose "Upload selections" option.
3. Select the txt file you want to import.
Regards,
Arvind

Similar Messages

  • CREATE BANK STATEMENT UPLOAD TXT FILE SAPBYD

    Hi,
    I implemented bank statement upload TXT FILE and loading the file format MT940 UK, load the file with status CONFIRMED but does not perform any bank statement in the list of BANK STATEMENT just seems like INBOUND FILES with status FINISHED but not as financial status.
    Anyone have a UK model MT940, and knows that the next step has to be performed after loading INBOUND FILE
    Email: [email protected]
    PD: Attached my MT940 UK inbound file to review in case .
    Regards

    goto to the user exit where u will find import & export parameters...Now create a project and implement this enhancement...Inside the FM u will find Zprogram which needs to be created. Now write ur code in this by importing data and check routinues and export back to variables....When u run actual transaction, this user exit automatically triggers...

  • Uploading .txt file to z table

    Hai Friends,
    I want to upload a .txt file to Z table which contains around 27 fields. but .txt file contains data in two lines by as follows.
    4.5  2.36  21.56 25  36.14  47.00  145.3  1247.6
    10.2  4.6  23.5 589.1  20.1  45.6
    Is it possible to upload the .txt file.

    Hi,
      It is possible to upload txt file to ztable. You need to write small program for that.
       Please see the example code below. Here from excel they are converting to internal table, use 'GUI_UPLOAD' to convert text file data to internal table and use this internal table to upload data into ztable. use MODIFY ZTABLE FROM TABLE ITAB.
    Also maintain the internal table structure and structure of the ZTABLE should match.
    **& Report  Z_DEMO_FILL_TABLE
    report  z_demo_fill_table no standard page heading line-size 255.
    selection-screen begin of block b1 with frame title text-003.
    selection-screen skip.
    *File Name
    selection-screen begin of line.
    selection-screen comment 5(28) text-001 for field p_file.
    parameters: p_file type  rlgrap-filename.
    selection-screen end of line.
    selection-screen skip.
    selection-screen end of block b1.
    data declarations.
    *data: get_po_header type standard table of BAPIEKKOC,
         get_PO_HEADER_ADD_DATA type standard table of BAPIEKKOA,
         get_PO_ITEMS type standard table of BAPIEKPOC,
         get_PO_ITEM_ADD_DATA type standard table of BAPIEKPOA,
    data:   get_poheader type standard table of bapimepoheader,
            get_poitem type standard table of bapimepoitem,
            it_data type table of alsmex_tabline initial size 0.
    data: wa_poheader like line of get_poheader,
          wa_poitem like line of get_poitem,
          wa_data like line of it_data,
    *tables used for catching messages returned by bapi
          gt_return   type standard table of bapiret2,
          gt_return1   type standard table of bapiret2.
    types: begin of x_po_tab,
      doc_date type bapimepoheader-doc_date,
      comp_code type bapimepoheader-comp_code,
      purch_org type bapimepoheader-purch_org,
      pur_group type bapimepoheader-pur_group,
      vendor type bapimepoheader-vendor,
      po_number type bapimepoheader-po_number,
      pmnttrms type bapimepoheader-pmnttrms,
      po_item type bapimepoitem-po_item,
      material type bapimepoitem-material,
      plant type bapimepoitem-plant,
      stge_loc type bapimepoitem-stge_loc,
      tax_code type bapimepoitem-tax_code,
    end of x_po_tab.
                    Search help for file                                 *
    at selection-screen on value-request for p_file.
      call function 'F4_FILENAME'
       exporting
      PROGRAM_NAME        = SYST-CPROG
      DYNPRO_NUMBER       = SYST-DYNNR
         field_name          = 'P_FILE'
       importing
         file_name           = p_file.
                    START-OF-SELECTION                                   *
    start-of-selection.
    perform for uploading Excel file
      perform upload_file_path.
    perform for transfering Excel data to Internal table
      perform excel_to_itab.
      perform int_process.
    *&      Form  upload_file_path
          text
    -->  p1        text
    <--  p2        text
    form upload_file_path .
      call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
        exporting
          filename                = p_file
          i_begin_col             = 1
          i_begin_row             = 1
          i_end_col               = 12
          i_end_row               = 5000
        tables
          intern                  = it_data
        exceptions
          inconsistent_parameters = 1
          upload_ole              = 2
          others                  = 3.
      if sy-subrc <> 0.
        message e000(zdbm) with 'Error in getting filename'.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    endform.                    " upload_file_path
    *&      Form  excel_to_itab
          text
    -->  p1        text
    <--  p2        text
    form excel_to_itab .
      loop at it_data into wa_data.
        at new row.
          clear: wa_poheader, wa_poitem.
        endat.
        case wa_data-col.
          when '001'.
            move wa_data-value to wa_poheader-doc_date.
          when '002'.
            move wa_data-value to wa_poheader-comp_code.
          when '003'.
            move wa_data-value to wa_poheader-purch_org.
          when '004'.
            move wa_data-value to wa_poheader-pur_group.
          when '005'.
            move wa_data-value to wa_poheader-vendor.
          when '006'.
            move wa_data-value to wa_poheader-po_number.
          when '007'.
            move wa_data-value to wa_poheader-pmnttrms.
          when '008'.
            move wa_data-value to wa_poitem-po_item.
          when '009'.
            move wa_data-value to wa_poitem-material.
          when '010'.
            move wa_data-value to wa_poitem-plant.
          when '011'.
            move wa_data-value to wa_poitem-stge_loc.
          when '012'.
            move wa_data-value to wa_poitem-tax_code.
        endcase.
        at end of row.
          append wa_poheader to get_poheader.
          append wa_poitem to get_poitem.
        endat.
        clear: wa_data.
      endloop.
    endform.                    " excel_to_itab
    *&      Form  Int_process
          text
    -->  p1        text
    <--  p2        text
    form int_process .
      loop at get_poheader into wa_poheader.
        read table get_poitem into wa_poitem index 1.
    call function 'BAPI_PO_CREATE1'
      exporting
        poheader                     = wa_poheader
      POHEADERX                    =
      POADDRVENDOR                 =
      TESTRUN                      =
      MEMORY_UNCOMPLETE            =
      MEMORY_COMPLETE              =
      POEXPIMPHEADER               =
      POEXPIMPHEADERX              =
      VERSIONS                     =
      NO_MESSAGING                 =
      NO_MESSAGE_REQ               =
      NO_AUTHORITY                 =
      NO_PRICE_FROM_PO             =
    IMPORTING
      EXPPURCHASEORDER             =
      EXPHEADER                    =
      EXPPOEXPIMPHEADER            =
    tables
      RETURN                       =
       poitem                       = get_poitem
      POITEMX                      =
      POADDRDELIVERY               =
      POSCHEDULE                   =
      POSCHEDULEX                  =
      POACCOUNT                    =
      POACCOUNTPROFITSEGMENT       =
      POACCOUNTX                   =
      POCONDHEADER                 =
      POCONDHEADERX                =
      POCOND                       =
      POCONDX                      =
      POLIMITS                     =
      POCONTRACTLIMITS             =
      POSERVICES                   =
      POSRVACCESSVALUES            =
      POSERVICESTEXT               =
      EXTENSIONIN                  =
      EXTENSIONOUT                 =
      POEXPIMPITEM                 =
      POEXPIMPITEMX                =
      POTEXTHEADER                 =
      POTEXTITEM                   =
      ALLVERSIONS                  =
      POPARTNER                    =
      POCOMPONENTS                 =
      POCOMPONENTSX                =
      POSHIPPING                   =
      POSHIPPINGX                  =
      POSHIPPINGEXP                =
      endloop.
    endform.                    " Int_process

  • Unable to upload txt file when creating new message

    Hi Expert,
    We installed SolMan 7.1, but we are not able to upload txt file when
    create a new message, detailed steps as below:
    1. Click on “New
      Message” under “Common Tasks” in the left side
    2. Click on
      “Attachment” under “Create Message”
    3. Click on “Add”
      under “Attachment”
    4. Select file and
      click on “OK”
    5. But as the result, it says “No attachments. Select Add to
      upload a new attachment.”
    Could you please help advise the reason and solution?
    BR
    Takashi

    Hi Vikram,
    Thanks for your reply.
    I have tried again and found that, it seems if the file size is 0, it can't be uploaed; if the size if bigger than 0, then it can be uploaded.
    So I close this discussion now. Thank you!
    BR
    Takashi

  • A critical program error has occurred. BEx Analyzer. Cannot find trace file

    I have now spent about 20 hours trying to resolve this issue.  I receive the following error message when attempting to open any BEx Query: u201CA critical program error has occurred.  The program will now terminate.  Please refer to the trace for further information()u201D.  Iu2019ve provided a video example of the scenario (couple minutes long): http://www.altnetwork.net/misc/Analyzer%20Critical%20Error.html
    I cannot find the trace file in the standard C:\DOCUME1\BaldwiJE\LOCALS1\Temp\BexAnalyzerTrace.txt path.  I cannot set/change the path/name of the trace file because the Trace File Name text box is grayed out (disabled) in BEx Analyzer > Global Options (see the above flash video link).  I know that I am using the same Business Explorer and GUI build as my colleagues and I am able to login with my ID on their machines and not receive an error.  We are using SAP BW 7.01 and I am using Excel 2007.  I have entirely reinstalled Microsoft Excel, and the SAP Frontend including Business Explorer and SAP GUI.  Iu2019ve monitored using both windows process monitor and windows process explorer but nothing is readily apparent as an issue (glad to share the process information if someone thinks it might help).  No relevant event logs in the Windows event viewer.
    Per the sapbexc.xla file, my system configuration is as follows:
    Computer Name:      DEN-SSI-SYS-L61
    File Location:      C:\DOCUME1\BaldwiJE\LOCALS1\Temp\sapBEX_PC_0614_103147.xls
    Check done on:      6/14/2011   10:31:47 AM
    Excel Version:      Excel 2007 (12.0.6535.5002)
    Windows Version:      Windows 2000  (2195)  Theme: %SystemRoot%\resources\Themes\Windows Classic.theme
    Default Browser:      Internet Explorer (7.0.6000.17093)
    SAP GUI:      720 Patch 1

    Resolved!  It actually seemed to be related to my windows profile.  I notice that if a co-worker logged into windows on my machine that he was able to run the same BEx queries that I couldn't.  I renamed my profile folder at c:\documents and settings\<myaccountname> to ...<myaccountname.bak>.  I did this using a local administrator account on my computer.  Then I logged back in to windows using my AD credentials.  A new profile was created and then I was able to use BEx Analyzer again.
    I also went back and tried to reload everything from my .bak profile into the newly created folder under documents and settings and hoped that I could isolate what specifically was causing the issue.  However, even after moving everything over to my newly created profile I could not get the error to generate again.  Sorry.
    Highly recommend to anyone with the same issue that you confirm that a new profile works by a) having someone else login to your computer who has not already logged in before b) if that works, replace your c:\documents and settings\<myaccountname> folder.
    Thanks to all who offered support.
    Jerimiah

  • Problem when I upload txt files to the server

    Hi, I have a problem when I try to upload files to the server, and I can't understand the fail.
    My case is:
    I have a jsp page where a from is.
    This form is sended to a servlet that proccess its content and upload the attach file to the server.
    It works correctly (it uploads the files, txt, xls and csv), the problem is when I try to upload a txt file like this, for example:
    Depth     Age
    0     0,1
    2     0,9
    3     2
    5     6
    6     9
    8     12
    34     25
    56     39
    101     40When I verify the uploaded file, this one has a character extra of return of line (a small square). This character prevents me from working then correctly with the file, on having detected a column of more.
    Which can be the problem?
    The code I use to uploaded the file is:
    try
        MyConnection Objconnection = new MyConnection();
        boolean isMultipart = FileUpload.isMultipartContent(req);
        // Create a factory for disk-based file items
        FileItemFactory factory = new DiskFileItemFactory();
         // Create a new file upload handler
        ServletFileUpload upload = new ServletFileUpload(factory);
        // Set overall request size constraint
        upload.setSizeMax(1024*512); //524288 Bytes (512 KB)
         // Parse the request
        List items = upload.parseRequest(req);
        // Process the uploaded items
        Iterator iter = items.iterator();
        String dat = new String();
        String typeFile = new String();
        while (iter.hasNext())
            FileItem item = (FileItem) iter.next();
            if (item.getFieldName().equals("typeFile") )
                typeFile = item.getString();
            if (!item.isFormField())
            String fieldName = item.getFieldName();
            String fileName = item.getName();
            String contentType = item.getContentType();
            boolean isInMemory = item.isInMemory();
            long sizeInBytes = item.getSize();
            int numbers=0;
            for(int i=fileName.length();(i=fileName.lastIndexOf('\\',i-1))>=0;)
                 numbers++;
            String stringFile[] = fileName.split("\\\\");
            HttpSession session = req.getSession(true);
            String loginSesion = (String)session.getAttribute("UserLogin");
            String newUserFolder = loginSesion;
            File createFile = new File("/usr/local/tomcat/webapps/Usuarios/FilesUp/"+newUserFolder);
            if ("AgeModel".equals(typeFile))
                createFile = new File("/usr/local/tomcat/webapps/Usuarios/FilesUp/AgeModels/"+newUserFolder);
            if (!createFile.exists())
                createFile.mkdir();
            fileName = stringFile[numbers];
            File uploadedFile = new File("/usr/local/tomcat/webapps/Usuarios/FilesUp/"+newUserFolder+"/"+fileName);
            if ("AgeModel".equals(typeFile) )
                uploadedFile = new File("/usr/local/tomcat/webapps/Usuarios/FilesUp/AgeModels/"+newUserFolder+"/"+fileName);
            existe = Objconnection.existFile(fileName, typeFile, loginSesion);
            if ( true == existe )
                 exito = false;
            else
                item.write(uploadedFile);
                ....// NOW REGISTER THE FILE IN TH DATA BASE
        } // if (!item.isFormField())
    } // WHILE ( iter.hasNext() )
                catch(Exception e) {
                out.println("Error de Aplicaci�n " + e.getMessage());
                return exito;
    ...THANKS

    Hi,
    Sorry I am aware this question was posted way back, but I am having similar problem and haven't been able to find the fix yet.
    So please let me known if you have got any ideas.
    My problem is same that I have to upload a CSV file from Client Machine (Windows) to Unix Application Server.
    I am using JSP method post and multipart/form-data (as in http://www.roseindia.net/jsp/file_upload/Sinle_upload.xhtml.shtml).
    The file is uploaded fine but the problem is it displays carraige Return (^M) a square boxes on Unix file.
    I can't ask user to convert file to Unox format before uploading. They just convert excel file to CSV and upload.
    Is there any way I can get rid of these characters as I have to use this file further.
    Sorry, I can't use any paid utility or tool for it.
    I would appreciate if you could please help.
    Thanks,
    SW

  • How to extract the content of a user uploaded txt file in web dynpro?

    Hi,
    I'm working on a java web dynpro component. This component consists of document upload field, where users should be able to upload .txt documents. These uploaded text documents should then be somehow read, and thir content displayed. I am already able to upload documents using the upload field, and store it in the context, but I'm still not able to extract the content of these text documents for displaying.
    Does anyone have any suggestions of how I could do this?
    Any help will be greatly appreciated!
    Thanks!

    Hi Alain,
        You can do through this document on how to upload/download files in Webdynpro.
    [https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/202a850a-58e0-2910-eeb3-bfc3e081257f]
    Once you have the uploaded file in your context if you are storing it as a byte array then convert it to a string using the String constructor String(byte[] bytes)  and then you can store this string in an attribute of type String which could be bound to a UI element (TextArea) to display the contents.
    If you are using an IWDResource then you will get an inputstream from which you can read the data and convert it to a string for display as mentioned above.
    Hope this helps.
    Sanyev

  • Upload .txt file into Database Table

    Hi,
    I was wondering if someone could please point me in the right direction. I've been looking around the forum but can't find anything to help me achieve the following.
    I would like to be able to upload a .txt file using a webpage. Then store the information inside this file into database tables.
    eg. contents of mytextfile.txt:
    richard
    10 anywhere street, anytown, somewhere
    111 222 333 444
    joe
    9 somestreet, elsewhere
    999 888 777 666
    peter
    214 nearby lane, overhere
    555 555 555 555
    I would like to insert this data into a table.
    eg. table name = CONTACTS
    userid = primary key (using sequence)
    username = (line 1 - richard, joe, peter)
    address = (line 2)
    phone_no = (line 3)
    As you can see the records will appear 1 at a time and will have a blank line between records. Is there anyway for me to upload a file like this and have it placed into tables?
    I have seen http://otn.oracle.com/products/database/htmldb/howtos/howto_file_upload.html but this seems to be for uploading a whole file and downloading the same file, rather than extracting data from the file.
    I hope I have managed to explain my problem.
    Many thanks,
    Richard.

    Richard,
    HTML DB allows you to upload CSV files via the Data Workshop. That data would then be parsed and inserted into a specific table. Alternatively, if you have your data in an Excel spreadsheet, and it is less than 32k, you can copy & paste the data directly into HTML DB's Data Workshop, which will then parse and import it into the Oracle database.
    The one obstacle you may have to overcome is converting your data from the format you outlined to CSV format. Specifically, you would have to make this:
    richard
    10 anywhere street, anytown, somewhere
    111 222 333 444
    Look something like this:
    "richard","10 anywhere street, anytown, somewhere","111 222 333 444"
    Hope this helps,
    - Scott -

  • Error!! uploading .txt file using WS_upload

    Hi Friends,
       I am trying to upload a .txt file with 5 fields into a ztable using WS_upload. In debug mode i see that the internal table itab has all the fields clustered together seperated by a # symbol. How do i remove this # symbol so that i can upload it into ztable properly .
    For eg the error i m getting is
    ibm#1042#krj#04-19-2006#PS. All these 5 fields get clustered under material column and not in their respective columns.
    Your opinion and advice is greatly appreciated .
    Thank you

    Suppose you have the data from the file in i_text and i_vendor is a structure similar to the database, then you use the following logic to split the text with hash as delimiter.
    loop at i_text.
    split i_text-text at '#' into i_vendor-lifnr
                                  i_vendor-ekorg
                                  i_vendor-ktokd
                                  i_vendor-name1
                                  i_vendor-sortl
                                  i_vendor-land1
                                  i_vendor-spras
                                  i_vendor-waers.
    append i_vendor.
    clear :i_vendor,
           i_text.
    endloop.
    Let me send you a sample code. Let me know if this helps.
    Award points if the answer helped you !
    Session Method: ( Batch Input)
    3 Function Modules are there.
    1)     BDC_OPEN_GROUP
    2)     BDC_INSERT
    3)     BDC_CLOSE_GROUP
    Instead of all the Call Transactions we use the Function modules here.
    1)     Go for MK01
    2)     Go for recording.  M4567,0001,0001 enter; test1, abcd, us, en, enter; usdollars; save.
    3)     Save and come back.
    4)     Select Vendor and Click on PROGRAM button . Stest_01
    5)     Select Transfer from recording button.
    6)     Save as local object
    7)     Copy the code into a Report program and execute it.
    Example:
    1) Create a text field having the following entries
    t3456,0001,0001,testt3456,abcd123,US,E,USD and save the entries for 4-5 lines of these type.
    2) Create a Program.
    Report ZBDC_MK01.
    *& Report  ZBDC_MK01
    REPORT  ZBDC_MK01.
    * Internal table for file
    data : begin of i_text occurs 0,
           text(255) type c,
           end of i_text.
    * Internal table for MK01 Transaction
    data : begin of i_vendor occurs 0,
           lifnr(10) type c,
           ekorg(4) type c,
           ktokd(4) type c,
           name1(40) type c,
           sortl(10) type c,
           land1(3) type c,
           spras(1) type c,
           waers(3) type c,
           end of i_vendor.
    * Internal table for BDCDATA
    data i_bdcdata like bdcdata occurs 0 with header line.
    data : v_repid like sy-repid.
    parameters p_file like rlgrap-filename.
    INITIALIZATION.
    v_repid = sy-repid.
    at selection-screen on value-request for p_file.
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
       PROGRAM_NAME        = v_repid
    *   *   DYNPRO_NUMBER       = SYST-DYNNR
    *   FIELD_NAME          = ' '
    IMPORTING
       FILE_NAME           = p_file
    start-of-selection.
    * Get the data from file to internal table
    perform get_data.
    * Open the session
    perform open_session.
    * Process the bdcdata
    perform process_bdcdata.
    * Call the close_group
    perform close_group.
    *&      Form  get_data
    *       WS_UPLOAD FM
    FORM get_data .
    CALL FUNCTION 'WS_UPLOAD'
    EXPORTING
    *   CODEPAGE                      = ' '
       FILENAME                      = p_file
       FILETYPE                      = 'ASC'
    *   HEADLEN                       = ' '
    *   LINE_EXIT                     = ' '
    *   TRUNCLEN                      = ' '
    *   USER_FORM                     = ' '
    *   USER_PROG                     = ' '
    *   DAT_D_FORMAT                  = ' '
    * IMPORTING
    *   FILELENGTH                    =
      TABLES
        DATA_TAB                      = i_text
    EXCEPTIONS
       CONVERSION_ERROR              = 1
       FILE_OPEN_ERROR               = 2
       FILE_READ_ERROR               = 3
       INVALID_TYPE                  = 4
       NO_BATCH                      = 5
       UNKNOWN_ERROR                 = 6
       INVALID_TABLE_WIDTH           = 7
       GUI_REFUSE_FILETRANSFER       = 8
       CUSTOMER_ERROR                = 9
       NO_AUTHORITY                  = 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.
    else.
    loop at i_text.
    split i_text-text at ',' into i_vendor-lifnr
                                  i_vendor-ekorg
                                  i_vendor-ktokd
                                  i_vendor-name1
                                  i_vendor-sortl
                                  i_vendor-land1
                                  i_vendor-spras
                                  i_vendor-waers.
    append i_vendor.
    clear :i_vendor,
           i_text.
    endloop.
    endif.
    free: i_text.
    ENDFORM.                    " get_data
    *&      Form  open_session
    *       text
    FORM open_session .
    CALL FUNCTION 'BDC_OPEN_GROUP'
    EXPORTING
       CLIENT                    = SY-MANDT
    *   DEST                      = FILLER8
       GROUP                     = 'VENDOR_MK01'
    *   HOLDDATE                  = FILLER8
       KEEP                      = 'X'
       USER                      = sy-uname
    *   RECORD                    = FILLER1
    *   PROG                      = SY-CPROG
    * 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.                    " open_session
    *&      Form  process_bdcdata
    *       BDCDATA
    FORM process_bdcdata .
    loop at i_vendor.
    perform bdc_dynpro      using 'SAPMF02K' '0107'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF02K-KTOKK'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'RF02K-LIFNR'
                                  i_vendor-lifnr.
    perform bdc_field       using 'RF02K-EKORG'
                                   i_vendor-ekorg.
    perform bdc_field       using 'RF02K-KTOKK'
                                  i_vendor-ktokd.
    perform bdc_dynpro      using 'SAPMF02K' '0110'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFA1-SPRAS'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'LFA1-NAME1'
                                 i_vendor-name1.
    perform bdc_field       using 'LFA1-SORTL'
                                  i_vendor-sortl.
    perform bdc_field       using 'LFA1-LAND1'
                                  i_vendor-land1.
    perform bdc_field       using 'LFA1-SPRAS'
                                    i_vendor-spras.
    perform bdc_dynpro      using 'SAPMF02K' '0120'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFA1-KUNNR'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_dynpro      using 'SAPMF02K' '0130'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFBK-BANKS(01)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTR'.
    perform bdc_dynpro      using 'SAPMF02K' '0310'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'LFM1-WAERS'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'LFM1-WAERS'
                                  i_vendor-waers.
    perform bdc_dynpro      using 'SAPMF02K' '0320'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RF02K-LIFNR'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTR'.
    perform bdc_dynpro      using 'SAPLSPO1' '0300'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=YES'.
    * Call the transaction code.
    perform bdc_insert.
    refresh i_bdcdata.
    endloop.
    ENDFORM.                    " process_bdcdata
    *&      Form  bdc_dynpro
    *       text
    *      -->P_0264   text
    *      -->P_0265   text
    FORM bdc_dynpro  USING    p_prog
                              p_scrn.
    clear i_bdcdata.
    i_bdcdata-program = p_prog.
    i_bdcdata-dynpro = p_scrn.
    i_bdcdata-dynbegin = 'X'.
    append i_bdcdata.
    ENDFORM.                    " bdc_dynpro
    *&      Form  bdc_field
    *       text
    FORM bdc_field  USING    p_fnam
                             p_fval.
    clear i_bdcdata.
    i_bdcdata-fnam = p_fnam.
    i_bdcdata-fval = p_fval.
    append i_bdcdata.
    ENDFORM.                    " bdc_field
    *&      Form  bdc_insert
    *       text
    FORM bdc_insert .
    CALL FUNCTION 'BDC_INSERT'
    EXPORTING
       TCODE                  = 'MK01'
    *   POST_LOCAL             = NOVBLOCAL
    *   PRINTING               = NOPRINT
    *   SIMUBATCH              = ' '
    *   CTUPARAMS              = ' '
      TABLES
        DYNPROTAB              = i_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
    *&      Form  close_group
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM 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.                    " close_group
    4)     Save and activate.
    5)     Go to SM35 and see the session created. Vendor_MK01 (group name which was given)
    6)     Need to go to SM35. Select the Session name and Click on Process. Select BACKGROUND.
    7)     Click on PROCESSED Tab.
    8)     For seeing the log file select the session and click on LOG. Click on Display.
    Difference between Call Transaction and Sessions Method.:
    1) In CT if mode is ¡¥A¡¦ then there wont be log messages. In sessions method we can get log messages in Foreground and Background too.
    2) In session method until and unless session Is created it wont update the data. But in CT data is updated immediately.
    3) In CT for log messages have to write BDCMSGCOLL structure and Format_Messages function module. Logs are created automatically in Session method.
    4) Data UPDATION in CT is Asynchronous. In Session method its Synchronous.
    5) In CT we have to split the file. In Session method we need not split the file.
    6) In CT we use BEND in Session we have to use END
    Real time most of the times its SESSION Method.
    Use CT method when: 
    a)     Run time Validation.  Example: We are creating a sales order. Here we are validating when selecting Payment Terms etc.
    DIRECT INPUT Method:
    If anything modified in SAP transaction don¡¦t use DI method. Updation is very fast.
    There is no Restart mechanism in DI method.
    Ex: have 10 records. 6,7 are error. In session method we needent go to the file. We have to go to BI and process again. Process in Foreground and during this time change at run time.
    We need to go for the file. Delete the first files, last files and then upload the data and run again.
    Main Transaction Code for DI is SXDB
    1)     Click on GoTo-----„³ DX Tools
    2)     Object type---Select G/L Account ; Task type: Load Data; Program type: Batch Input; Program: RFBISA00 .
    Q) How to copy files from SAP server to local?
    Ans) Bcos we don¡¦t get authorization for AL11 transaction. If we know file directory and File name. We can see structure.
    In SXDB.
    1)     Click on GoTo-----„³ DX Tools
    2)     Object type---Select G/L Account (BUS 3006) ; Task type: Load Data; Program type: Batch Input; Program: RFBISA00 .
    Go for Copy file. Give the Application Server file name and also he presentation server name and location.
    *& Report  ZBDC_MM01
    REPORT  ZBDC_MM01.
    * Constants
    constants : c_x type c value 'X'.
    * Internal table for file
    data : begin of i_text occurs 0,
           text(255) type c,
           end of i_text.
    * iNTERNAL TABLE FOR MATERIAL LOAD
    DATA : BEGIN OF I_MATERIAL OCCURS 0,
           MATNR(18) TYPE C,
           MBRSH(1) TYPE C,
           MTART(4) TYPE C,
           MAKTX(40) TYPE C,
           MEINS(3) TYPE C,
           MAKTL(3) TYPE C,
           END OF I_MATERIAL.
    * INTERNAL TABLE FOR BDCDATA
    DATA I_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
    * internal table for for logs
    data i_bdcmsg like bdcmsgcoll occurs 0 with header line.
    * Report id
    data : v_repid like sy-repid,
           v_msg(255) type c.
    * Internal tabel for log records
    data : begin of i_log occurs 0,
           text(255) type c,
           end of i_log.
    * Selection-screen
    selection-screen : begin of block blk with frame title text-001.
    parameter p_file like rlgrap-filename.
    selection-screen : end of block blk.
    * fill the defaut value
    INITIALIZATION.
    v_repid = sy-repid.
    * F4 value for File
    at selection-screen on value-request for p_file.
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
       PROGRAM_NAME        = v_repid
    *   DYNPRO_NUMBER       = SYST-DYNNR
    *   FIELD_NAME          = ' '
    IMPORTING
       FILE_NAME           = p_file
    start-of-selection.
    * get the data from file to internal table
    perform get_data_itab.
    * tO PROCEESS BDCDATA
    PERFORM PROCESS_BDCDATA.
    end-of-selection.
    * Process the data into file
    perform download_file.
    *&      Form  get_data_itab
    *    ws_upload
    FORM get_data_itab .
    CALL FUNCTION 'WS_UPLOAD'
    EXPORTING
    *   CODEPAGE                      = ' '
       FILENAME                      = P_FILE
       FILETYPE                      = 'ASC'
    *   HEADLEN                       = ' '
    *   LINE_EXIT                     = ' '
    *   TRUNCLEN                      = ' '
    *   USER_FORM                     = ' '
    *   USER_PROG                     = ' '
    *   DAT_D_FORMAT                  = ' '
    * IMPORTING
    *   FILELENGTH                    =
      TABLES
        DATA_TAB                      = I_TEXT
    EXCEPTIONS
       CONVERSION_ERROR              = 1
       FILE_OPEN_ERROR               = 2
       FILE_READ_ERROR               = 3
       INVALID_TYPE                  = 4
       NO_BATCH                      = 5
       UNKNOWN_ERROR                 = 6
       INVALID_TABLE_WIDTH           = 7
       GUI_REFUSE_FILETRANSFER       = 8
       CUSTOMER_ERROR                = 9
       NO_AUTHORITY                  = 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.
    ELSE.
    LOOP AT I_TEXT.
    SPLIT I_TEXT-TEXT AT ',' INTO I_MATERIAL-MATNR
                                  I_MATERIAL-MBRSH
                                  I_MATERIAL-MTART
                                  I_MATERIAL-MAKTX
                                  I_MATERIAL-MEINS
                                  I_MATERIAL-MAKTL.
    APPEND I_MATERIAL.
    CLEAR : I_MATERIAL,
            I_TEXT.
    ENDLOOP.
    ENDIF.
    ENDFORM.                    " get_data_itab
    *&      Form  PROCESS_BDCDATA
    *      bdcdata
    FORM PROCESS_BDCDATA .
    LOOP AT I_MATERIAL.
    * First Screen
    perform f_get_program using 'SAPLMGMM' '0060'.
    perform f_get_field   using 'BDC_CURSOR' 'RMMG1-MATNR'.
    perform f_get_field  using 'BDC_OKCODE' '=AUSW'.
    perform f_get_field  using 'RMMG1-MATNR' i_material-matnr.
    perform f_get_field  using 'RMMG1-MBRSH' i_material-mbrsh.
    perform f_get_field  using 'RMMG1-MTART' i_material-mtart.
    * Second screen
    perform f_get_program using 'SAPLMGMM' '0070'.
    perform f_get_field   using 'BDC_CURSOR' 'MSICHTAUSW-DYTXT(01)'.
    perform f_get_field  using 'BDC_OKCODE' '=ENTR'.
    perform f_get_field  using 'MSICHTAUSW-KZSEL(01)' c_x.
    * third screen
    perform f_get_program using 'SAPLMGMM' '4004'.
    perform f_get_field   using 'BDC_CURSOR' 'MAKT-MAKTX'.
    perform f_get_field  using 'BDC_OKCODE' '=BU'.
    perform f_get_field  using 'MAKT-MAKTX' i_material-maktx.
    perform f_get_field  using 'MARA-MEINS' i_material-meins.
    perform f_get_field  using 'MARA-MATKL' i_material-maktl.
    ** call transaction
    call transaction 'MM01'
         using i_bdcdata
         mode 'N'
         messages into i_bdcmsg.
    refresh i_bdcdata.
    * Log message
    CALL FUNCTION 'FORMAT_MESSAGE'
    EXPORTING
       ID              = SY-MSGID
       LANG            = '-E'
       NO              = SY-MSGNO
       V1              = SY-MSGV1
       V2              = SY-MSGV2
       V3              = SY-MSGV3
       V4              = SY-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.
    i_log-text = v_msg.
    append i_log.
    clear: i_log,
           v_msg.
    ENDLOOP.
    ENDFORM.                    " PROCESS_BDCDATA
    *&      Form  f_get_program
    *       Program ,Screen no, Dynbegin
    *      -->P_0206   text
    *      -->P_0207   text
    FORM f_get_program  USING   p_prog
                                p_scrn.
    clear : i_bdcdata.
    i_bdcdata-program = p_prog.
    i_bdcdata-dynpro = p_scrn.
    i_bdcdata-dynbegin = c_x.
    append i_bdcdata.
    ENDFORM.                    " f_get_program
    *&      Form  f_get_field
    *      field name ,field value
    *      -->P_0217   text
    *      -->P_0218   text
    FORM f_get_field  USING   p_fnam
                              p_fval.
    clear i_bdcdata.
    i_bdcdata-fnam = p_fnam.
    i_bdcdata-fval = p_fval.
    append i_bdcdata.
    ENDFORM.                    " f_get_field
    *&      Form  download_file
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM download_file .
    CALL FUNCTION 'WS_DOWNLOAD'
    EXPORTING
    *   BIN_FILESIZE                  = ' '
    *   CODEPAGE                      = ' '
       FILENAME                      =
       'C:Documents and SettingsAdministratorDesktoplog.txt'
       FILETYPE                      = 'ASC'
    *   MODE                          = ' '
    *   WK1_N_FORMAT                  = ' '
    *   WK1_N_SIZE                    = ' '
    *   WK1_T_FORMAT                  = ' '
    *   WK1_T_SIZE                    = ' '
    *   COL_SELECT                    = ' '
    *   COL_SELECTMASK                = ' '
    *   NO_AUTH_CHECK                 = ' '
    * IMPORTING
    *   FILELENGTH                    =
      TABLES
        DATA_TAB                      = i_log
    *   FIELDNAMES                    =
    EXCEPTIONS
       FILE_OPEN_ERROR               = 1
       FILE_WRITE_ERROR              = 2
       INVALID_FILESIZE              = 3
       INVALID_TYPE                  = 4
       NO_BATCH                      = 5
       UNKNOWN_ERROR                 = 6
       INVALID_TABLE_WIDTH           = 7
       GUI_REFUSE_FILETRANSFER       = 8
       CUSTOMER_ERROR                = 9
       NO_AUTHORITY                  = 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.                    " download_file

  • How to upload (.txt) file by using GUI Upload?

    I tried to upload .csv file in using GUI upload and it works.
    THIS IS MY SAMPLE CODE.
    CLEAR w_rawfile.
      DESCRIBE TABLE i_rawfile LINES v_read.     "Counter for records read
      Condense w_rawfile-field.
    Separate header record from detail records
      LOOP AT i_rawfile INTO w_rawfile.
        IF sy-tabix = 1.           "header is always the first record
          SPLIT w_rawfile-field AT ' ' INTO
            w_header_file-name1
            w_header_file-name2
            w_header_file-name3
            w_header_file-cntry
            w_header_file-address1
            w_header_file-address2.
      APPEND w_header_file TO i_header_file.
          CLEAR: w_header_file.
        ELSE.            "succeeding records are detail records
          SPLIT w_rawfile-field AT ',' INTO
                 w_inputfile-nachn
                 w_inputfile-vorna
                 w_inputfile-nach2
                 w_inputfile-land1
                 w_inputfile-stras
    APPEND w_inputfile TO i_inputfile.
    ENDIF.
    IF i try to replace my file into a .txt format. An error occurs. Please kindly give me the code to do this correctlt. ThanX!

    Reading Data from Presentation Server (Dialog)
    To read data from the presentation server into an internal table with a user dialog, use the function module UPLOAD. The most important parameters are listed below. For more information, refer to the function module documentation in the Function Builder (Transaction SE37).
    Important Import Parameters
    Parameters
    Function
    CODEPAGE
    Only for upload under DOS: Value IBM
    FILENAME
    Filename (default value for user dialog)
    FILETYPE
    File type (default value for user dialog)
    ITEM
    Title for dialog box
    Use the FILETYPE parameter to specify the transfer mode. Possible values:
    BIN
    Binary files
    ASC
    ASCII files: Text files with end of line markers.
    DAT
    Excel files, saved as text files with columns separated by tabs and lines separated by line breaks.
    WK1
    Excel and Lotus files saved as WK1 spreadsheets.
    Important Export Parameters
    Parameters
    Function
    FILESIZE
    Number of bytes transferred
    ACT_FILENAME
    Filename (as entered in the user dialog)
    ACT_FILETYPE
    File type (as entered in the user dialog)
    Tables Parameters
    Parameters
    Function
    DATA_TAB
    Internal table (target for the import)
    Exceptions Parameters
    Parameters
    Function
    CONVERSION_ERROR
    Error converting data
    INVALID_TABLE_WIDTH
    Invalid table structure
    INVALID_TYPE
    Incorrect FILETYPE parameter
    Suppose the presentation server is running under Windows NT, and contains the following Excel file:
    If this table is saved as a text file "D:\temp\mytable.txt" with tabs between the columns, the following program can read the table:
    PROGRAM SAPMZTST.
    DATA: FNAME(128), FTYPE(3), FSIZE TYPE I.
    TYPES: BEGIN OF LINE,
             COL1(10) TYPE C,
             COL2(10) TYPE C,
             COL3(10) TYPE C,
           END OF LINE.
    TYPES  ITAB TYPE LINE OCCURS 10.
    DATA: LIN TYPE LINE,
          TAB TYPE ITAB.
    CALL FUNCTION 'UPLOAD'
         EXPORTING
              CODEPAGE            = 'IBM'
              FILENAME            = 'd:\temp\mytable.txt'
              FILETYPE            = 'DAT'
              ITEM                = 'Read Test for Excel File'
         IMPORTING
              FILESIZE            =  FSIZE
              ACT_FILENAME        =  FNAME
              ACT_FILETYPE        =  FTYPE
         TABLES
              DATA_TAB            =  TAB
         EXCEPTIONS
              CONVERSION_ERROR    = 1
              INVALID_TABLE_WIDTH = 2
              INVALID_TYPE        = 3.
    WRITE: 'SY-SUBRC:', SY-SUBRC,
         / 'Name    :', (60) FNAME,
         / 'Type    :', FTYPE,
         / 'Size    :', FSIZE.
    SKIP.
    LOOP AT TAB INTO LIN.
       WRITE: / LIN-COL1, LIN-COL2, LIN-COL3.
    ENDLOOP.
    The program displays the following dialog box:
    Here, the user can change the default values. When the user chooses Transfer, the system imports the data from the file D:\temp\mytable.txt into the internal table TAB.
    The output appears as follows:
    SY-SUBRC: 0
    Name : d:\temp\mytable.txt
    Type : DAT
    Size : 69
    Billy the Kid
    My Fair Lady
    Herman the German
    Conan the Barbarian
    The contents of the internal table TAB are exactly the same as the contents of the original Excel table.

  • Can't seem to upload .TXT files to my iPod with Color Display 80GB

    Hello - I've enabled disk use, but the iPod keeps rejecting any .txt files that I try and put on it. It says in the manual drop it into the 'Notes' folder, but on my Mac, in iTunes, the only folders showing up are Music, Movies, Videos, Podcasts, and then a list of playlists. How do I add notes to this iPod, or can I?
    Thank you for any help you can give.

    Follow the instructions in this article and then add the notes through the Finder.
    (37306)

  • Upload .txt file to database in coldfusion

    Hi i need to know how  to upload text file in to database using coldfusion and the file does not have any column names. Can anyone help me in this.
    The sample of data in file is:
    00012009032216001111039289000005.9900100000000000000.00

    You can start by using list functions.  After uploading and reading the file, you can treat the resulting variable as a list delimited by chr(10) & chr(13).  As far as processing each line goes, you have to know it's structure.

  • Analyze test result from txt file

    I need some suggestions from experts. I saved test result in txt file with following format(See attachment). With this test result, I need draw waveform of 'DNBr' based on different OPmode(ADSL2P, VDSL2-8a...). The X-axis will be the value from 'DLS'.  I can creat a complicate VI to do that. But I want to if Labview has any subvi can do this job easier.
    Attachments:
    AW All in One_485847_102744SAV 5T 2h15 PM.txt ‏10 KB

    Hi Tambrook,
    read 3 (header) lines, then read the remaining data lines using "Read spreadsheet file".
    Now you have to select rows by your OPmode as there's no subVI made for your data...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Can TXT file with separater ',' be upload to internal TBL using GUI_UPLOAD?

    hello, experts,
    I have a problem with data transfer. I need to upload TXT file to SAP internal table, data in TXT file are separated by ',' and more than one line records are contained in the file. I tried to use FM GUI_UPLOAD as below to upload the file and transfer the data to internal table, however it comes out error. SY-SUBRC is UNKNOW ERROR, error message shows: Cannot interpret date in file.
          CALL FUNCTION 'GUI_UPLOAD'
               EXPORTING
                    FILENAME                = FILEPATH
                    FILETYPE                = 'DAT'
                    HAS_FIELD_SEPARATOR     = ','
                    READ_BY_LINE            = 'X'
               TABLES
                    DATA_TAB                = TAB_X3
               EXCEPTIONS
                    CONVERSION_ERROR        = 1
                    FILE_OPEN_ERROR         = 2
                    FILE_READ_ERROR         = 3
                    INVALID_TYPE            = 4
                    NO_BATCH                = 5
                    UNKNOWN_ERROR           = 6
                    INVALID_TABLE_WIDTH     = 7
                    GUI_REFUSE_FILETRANSFER = 8
                    CUSTOMER_ERROR          = 9
                    OTHERS                  = 10.
    Thank you.

    HAS_field_separator can have only SPACE or X.
    upload the file using GUI_UPLOAD and then in the program you split the lines by comma.
    Data: begin of itab occurs 0,
          rec(1000) type c,
          end of itab.
    DATA: begin of itab1 occurs 0, 
              matnr type mara-matnr
          werks type marc-werks
          lgort type marc-lgort,
          end of itab1.
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    FILENAME = FILEPATH
    FILETYPE = 'DAT'
    HAS_FIELD_SEPARATOR = 'X'
    READ_BY_LINE = 'X'
    TABLES
    DATA_TAB = TAB_X3
    EXCEPTIONS
    CONVERSION_ERROR = 1
    FILE_OPEN_ERROR = 2
    FILE_READ_ERROR = 3
    INVALID_TYPE = 4
    NO_BATCH = 5
    UNKNOWN_ERROR = 6
    INVALID_TABLE_WIDTH = 7
    GUI_REFUSE_FILETRANSFER = 8
    CUSTOMER_ERROR = 9
    OTHERS = 10.
    loop at itab.
    split itab-rec at ',' into itab1-matnr itab1-werks itab1-lgort.
    append itab1.
    endloop.

  • Problem exporting '.txt' file size 23 KB and '.zip' file size 4 MB

    I am using Apex 3.0 version screen to upload '.txt' file and '.zip' file containing images.
    I can successfully export '.txt' file and '.zip' file containing images as long as '.txt' file size is < 23 KB and '.zip' file size < 4 MB from database table 'TBL_upload_file' to the OS directory on the server.
    processing of Larger files (sizes 35 KB and 6 MB) produce following Error Message.
    ‘ORA-21560: argument 2 is null, invalid or out of range’ error.
    Here is my code:
    I am using following code to export Documents from database table 'TBL_upload_file' to the OS directory on the server.
    create or replace procedure "PROC_LOAD_FILES_TO_FLDR_BYTES"
    (pchr_text_file IN VARCHAR2,
    pchr_zip_file IN VARCHAR2)
    is
    lzipfile varchar(100);
    lzipname varchar(100);
    sseq varchar(1000);
    ldocname varchar(100);
    lfile varchar(100);
    -- loaddoc (p_file in number) as
    l_file UTL_FILE.FILE_TYPE;
    l_buffer RAW(32000);
    l_amount NUMBER := 32000;
    l_pos NUMBER := 1;
    l_blob BLOB;
    l_blob_len NUMBER;
    l_file_name varchar(200);
    l_doc_name varchar(200);
    a_file_name varchar (200);
    end_pos NUMBER;
    begin
    -- Get LOB locator
    SELECT blob_content,doc_name
    INTO l_blob,l_file_name
    FROM tbl_upload_file
    WHERE DOC_NAME = pchr_text_file;
    --get length of blob
    l_blob_len := DBMS_LOB.getlength(l_blob);
    -- save blob length to determine end position
    end_pos:= l_blob_len;
    -- Open the destination file.
    -- l_file := UTL_FILE.fopen('BLOBS','MyImage.gif','w', 32767);
    l_file := UTL_FILE.fopen('BLOBS',l_file_name,'WB', 32760); --use write byte option supported in 10G
    -- if small enough for a single write
    IF l_blob_len < 32760 THEN
    utl_file.put_raw(l_file,l_blob);
    utl_file.fflush(l_file);
    ELSE -- write in pieces
    -- Read chunks of the BLOB and write them to the file
    -- until complete.
    WHILE l_pos < l_blob_len LOOP
    DBMS_LOB.read(l_blob, l_amount, l_pos, l_buffer);
    UTL_FILE.put_raw(l_file, l_buffer);
    utl_file.fflush(l_file); --flush pending data and write to the file
    -- set the start position for the next cut
    l_pos := l_pos + l_amount;
    -- set the end position if less than 32000 bytes, here end_pos captures length of the document
    end_pos := end_pos - l_amount;
    IF end_pos < 32000 THEN
    l_amount := end_pos;
    END IF;
    END LOOP;
    END IF;
    --- zip file
    -- Get LOB locator to locate zip file
    SELECT blob_content,doc_name
    INTO l_blob,l_doc_name
    FROM tbl_upload_file
    WHERE DOC_NAME = pchr_zip_file;
    l_blob_len := DBMS_LOB.getlength(l_blob);
    -- save blob length to determine end position
    end_pos:= l_blob_len;
    -- Open the destination file.
    -- l_file := UTL_FILE.fopen('BLOBS','MyImage.gif','w', 32767);
    l_file := UTL_FILE.fopen('BLOBS',l_doc_name,'WB', 32760); --use write byte option supported in 10G
    -- if small enough for a single write
    IF l_blob_len < 32760 THEN
    utl_file.put_raw(l_file,l_blob);
    utl_file.fflush(l_file); --flush out pending data to the file
    ELSE -- write in pieces
    -- Read chunks of the BLOB and write them to the file
    -- until complete.
    l_pos:=1;
    WHILE l_pos < l_blob_len LOOP
    DBMS_LOB.read(l_blob, l_amount, l_pos, l_buffer);
    UTL_FILE.put_raw(l_file, l_buffer);
    UTL_FILE.fflush(l_file); --flush pending data and write to the file
    l_pos := l_pos + l_amount;
    -- set the end position if less than 32000 bytes, here end_pos contains length of the document
    end_pos := end_pos - l_amount;
    IF end_pos < 32000 THEN
    l_amount := end_pos;
    END IF;
    END LOOP;
    END IF;
    -- Close the file.
    IF UTL_FILE.is_open(l_file) THEN
    UTL_FILE.fclose(l_file);
    END IF;
    exception
    WHEN NO_DATA_FOUND THEN
    RAISE_APPLICATION_ERROR(-20214,'Screen fields cannot be blank, Proc_Load_Files_To_Fldr_BYTES.');
    WHEN TOO_MANY_ROWS THEN
    RAISE_APPLICATION_ERROR(-20215,'More than one record exist in the tbl_load_file table, Proc_Load_Files_To_Fldr_BYTES.');
    WHEN OTHERS THEN
    -- Close the file if something goes wrong.
    IF UTL_FILE.is_open(l_file) THEN
    UTL_FILE.fclose(l_file);
    END IF;
    RAISE_APPLICATION_ERROR(-20216,'Some other errors occurred, Proc_Load_Files_To_Fldr_BYTES.');
    end;
    I am new to the Oracle.
    Any help to modify this scipt and resolve this problem will be greatly appreciated.
    Thank you.

    Ask this question in the Apex forums. See Oracle Application Express (APEX)
    Regards Nigel

Maybe you are looking for

  • Regarding module :SALES AND DISTRIBUTION

    experts,   concerned tables : VBAP,VBAK,VBEP,CDHDR,CDPOS.        fields:              VBELN,POSNR,ETENR,NETPR.    when ever i change NETPR (field of table VBAP)  of a particular item using TCODE : VA02 , the changes will be reflected as follows:     

  • Insert or overwrite inserts BLANK in the timeline

    Hi, I am trying to do a basic 3 point edit. Open the clip in Source monitor, set I, O and then when i use the shortcuts "," or "." it just inserts a BLANK GAP??? If i drag the clip, it works just fine. ANy idea why? I use Premiere CS6. Thanks.

  • Why it is popular applications are not included in the official repo?

    Why it is very popular applications like yaourt (GPL), pacman-color (GPL) and many other free programs are not included in the official repositories? Why not create an official "non-free" repository for popular non-free software?

  • More than one iTunes for one computer.

    I have a brother and a sister, and we all have iPods, but only one computer. We have a windows XP so, several different accounts. I already have iTunes set up, but my brother and sister don't. Is it possible to have 3 separate iTunes for each of us?

  • What determines my identity when I visit a web site? How can I change or use multiple identities?

    Often, when I visit an internet site, the site identifies me automatically, without my having specifically provided an identity. The identity seems to partially correspond with one of my email addresses. How can I use multiple identities and change i