Downloading BLOB from a table.

Hello,
First I want to say thatnks for such a great tool like HTMLDB.
Question is:
How do I download BLOB from a table. What I am trying to do is. I am uploading files to a default HTMLDB location (wwv_flow_file_objects$) and moving the records to different table (delete file from wwv_file_objects$). Then I would like to be able to download that blobs from a DB by following some link. And I need it to be secure, user have to authenticate to do it. I got to the point where I created process (before header) to download the file. But I am having hard time passing some variables to that process in URL. Can some one advice me on the best practice of doing it. And also if it is a right thing to use before header process to put my own header and start uploading blob in html db. The main reason I do not whant to use DAD for that is simple security issue and ability of storing of the BLOBs only in one table. I prefer to upload it to a temporary location and then move it to other table(s). Then I need to be able to retriev the files back from those tables without moving them around.
Any help is greatly appriciated

i think i see what you're asking, but i'll step through the pieces just to make sure i cover your issue:
it sounds as if you have a procedure that successfully calls wpg_docload.download_file to get your blob out of your images table. for this explanation, lets just say your images table has the same table structure as wwv_flow_files created with something like...
create table myfiles as select * from wwv_flow_files where rownum < 3;
....and let's say your download proc that passed the blob from your myfiles table to wpg_docload.download_file looked something like...
create or replace procedure getmyfile(
p_id in varchar2,
p_mime_type in varchar2 default null)
as
l_lob blob;
l_mimetype varchar2(48);
l_mime_charset varchar2(255);
l_filename varchar2(400);
begin
select mime_type, blob_content, filename, file_charset
into l_mimetype, l_lob, l_filename, l_mime_charset
from myfiles
where id = p_id;
if l_mime_charset is not null then
owa_util.mime_header( l_mimetype, FALSE, l_mime_charset );
else
owa_util.mime_header( l_mimetype, FALSE );
end if;
htp.p('Content-length: ' || dbms_lob.getlength( l_lob ));
htp.p('Content-Disposition: attachment; filename="' ||
wwv_flow_utilities.escape_url( p_url => l_filename, p_url_charset => 'utf-8') || '"');
owa_util.http_header_close;
wpg_docload.download_file( l_lob );
end;
...then it sounds as if this is where you start running into issues. to be able to call this procedure from the url, you'd have to grant execute on your getmyfile proc to the db user that your modplsql DAD uses to access your db. once that user was given access to run getmyfile, you could access your files in myfiles by calling a URL like...
http://myserver.com/pls/mydad/myschema.getmyfile?p_id=1005529367869246
...where p_id is the unique id associated with your blob in getmyfiles (you could, of course, use whatever method you want to uniquely identify that file and adjust your select-into statement w/in your getmyfile procedure). so that's all fine and dandy, but it sounds as if you want users to have to authenticate into your html db application before they can access a blob in your images table. it also sounds as if you're on the right track to do so by putting your procedure call in a before_header html db process. you could quite easily call your getmyfile procedure in such an html db pl/sql before_header process with something like...
begin
getmyfile (p_id => 1008411584930314);
end;
...which would cause your page to just show the blob associated with the id you passed to getmyfile. because you're now accessing your blob table through html db parsing as your application schema owner, you'd no longer need to grant execute on getmyfile to your modplsql DAD's db user. that eliminates most of the security hole to which you were referring. now that you're calling getmyfile from w/in an html db process, you can take advantage of all the other html db perks such as applying conditions and an authorization scheme to the html db process to really lock things down. finally, you asked about firing your process before_header versus other firing points. before_header is a good way to go, but if you really wanted to execute other procedural logic on your page before showing the blob (and you didn't want to implement that code as before_header processes that fire sequentially before your getmyfile call),you could just throw an htp.init in right before your getmyfile call to clear out your http buffer like so...
begin
htp.init;
getmyfile (p_id => 1008411584930314);
end;
...hope this helps,
raj

Similar Messages

  • Downloading data from internal table to xls file leading zeros are not disp

    Hai abap gurus,
    when i am downloading data from internal table to excle file. some field values in a column are with leading zeros and some others dont have leading zeros.but in the output it is showing without leading zeros. then how to get with exact values.
    Ex:
    <b>ECC Code.</b>
    045234
      88567
    098456 
    but output is giving like this:
    45234
    88567
    98456
    how to get the actual values.....
    plz help me in this matter.

    Dear Kiran,
    Those field in the internal table having Leading Zeroes, make those fields' datatype as character.
    Then use the function module to download the content of the internal table to the excel file.
    Regards,
    Abir
    Don't forget to Reward Points  *

  • How to move BLOBs from one table to another ??

    Hi All,
    I am trying to move blobs from one table to another, however my insert statement is not working. What i mean is its running, but records are not being inserted into the table.
    This is my first time moving blobs, so please bear with me.
    here is my insert statement:
    INSERT INTO CASES.FILESTORAGE
    SELECT      DID,
              DRENDITIONID,
              DLASTMODIFIED,
              DFILESIZE,
              DISDELETED,
              BFILEDATA       // this attribute is the BLOB
    FROM      USSC_CASES_TMP.FILESTORAGE
    WHERE      DID NOT IN (SELECT DID FROM CASES.FILESTORAGE);here is the DDL for the table.
    CREATE TABLE "USSC_CASES_TMP"."FILESTORAGE"
        "DID"          NUMBER(*,0) NOT NULL ,
        "DRENDITIONID" VARCHAR2(30 CHAR) NOT NULL ,
        "DLASTMODIFIED" TIMESTAMP (6),
        "DFILESIZE"  NUMBER(*,0),
        "DISDELETED" VARCHAR2(1 CHAR),
        "BFILEDATA" BLOB,
        CONSTRAINT "PK_FILESTORAGE" PRIMARY KEY ("DID", "DRENDITIONID")
      );CASES.FILESTORAGE table has the same DDL, but in a different schema.
    Thanks in advance.

    If this seems rather straight forward. If the schema are exact simply execute:
    inset into [destination] select * from [source] ;if something is amiss you should be throwing errors someplace* but try this:
    create table [scratch table name] as select * from [source table] where [place some limit here] ;If this does not work then something someplace is very wrong and if you are not the DBA you need to get this persons attention, fairly quickly. I would do the above from sqlplus and then after each statement would:
    commit;then check to see if it succeeded.

  • BLOBs from different tables on one report

    Hi,
    I think the declarative BLOB support enhancement in 3.1 is really great. I am running into a problem with a report that joins two tables that both have BLOB columns. I have a Letters table and a Response table. The Response table has a FK linkage to the Letters table with the Letters table being the referenced table. I have a report that joins the Letters & Response tables and provides download links for the BLOBs in both tables. However on the report, only one of the link works at a given point in time. Both the links work fine in isolation (if the other link is commented out in the query).
    I am using the APEX_UTIL.GET_BLOB_FILE_SRC function to download the files. Has anyone tried using this function to download files from two different tables in a single report?
    TIA,
    Ramesh

    Ramesh,
    Is this application on apex.oracle.com by any chance? I just went to test there and am having all sorts of trouble with declarative display of BLOBs in a report but on our dev box, two works fine (except that the link for both is the default rather than what I selected).
    -- Sharon

  • Error while downloading data from internal table into XML file

    hi all,
    i developed a program to download data from into internal table to xml file like this.
    tables: mara.
    parameters: p_matnr like mara-matnr.
    data: begin of itab_mara occurs 0,
                matnr like mara-matnr,
                ernam like mara-ernam,
                aenam like mara-aenam,
                vpsta like mara-vpsta,
          end of itab_mara.
    data: lv_field_seperator type c,     " value 'X',
          lv_xml_doc_name(30) type c,    " string value ‘my xml file’,
          lv_result type i.
          lv_field_seperator = 'x'.
          lv_xml_doc_name = 'my xml file'.
    types: begin of truxs_xml_line,
              data(256) type x,
          end of truxs_xml_line.
    types:truxs_xml_table type table of truxs_xml_line.
    data:lv_tab_converted_data type truxs_xml_line,
         lt_tab_converted_data type truxs_xml_table.
    data: lv_xml_file type rlgrap-filename value 'c:\simp.xml'.
    select matnr ernam aenam vpsta from mara into table itab_mara up to 5
           rows where matnr = p_matnr.
    CALL FUNCTION 'SAP_CONVERT_TO_XML_FORMAT'
    EXPORTING
       I_FIELD_SEPERATOR          = lv_field_seperator
      I_LINE_HEADER              =
      I_FILENAME                 =
      I_APPL_KEEP                = ' '
       I_XML_DOC_NAME             = lv_xml_doc_name
    IMPORTING
       PE_BIN_FILESIZE            = lv_result
      TABLES
        I_TAB_SAP_DATA             = itab_mara
    CHANGING
       I_TAB_CONVERTED_DATA       = lt_tab_converted_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.
    open dataset lv_xml_file for output in binary mode.
    loop at lt_tab_converted_data into lv_tab_converted_data.
    transfer lv_tab_converted_data to lv_xml_file.
    endloop.
    close dataset lv_xml_file.
    this program is syntactically correct and getting executed, but when i open the target xml file it is showing the following error.
    The XML page cannot be displayed
    Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
    XML document must have a top level element. Error processing resource 'file:///C:/simp.xml'.
    will anyone show me the possible solution to rectify this error
    thanks and regards,
    anil.

    Hi,
    Here is a small sample program to convert data in an internal table into XML format and display it.
    DATA: itab  TYPE TABLE OF spfli,
          l_xml TYPE REF TO cl_xml_document.
    * Read data into a ITAB
    SELECT * FROM spfli INTO TABLE itab.
    * Create the XML Object
    CREATE OBJECT l_xml.
    * Convert data in ITAB to XML
    CALL METHOD l_xml->create_with_data( name = 'Test1'
                                         dataobject = t_goal[] ).
    * Display XML Document
    CALL METHOD l_xml->display.
    Here are some other sample SAP programs to handle XML in ABAP:
    BCCIIXMLT1, BCCIIXMLT2, and BCCIIXMLT3.
    Hope this helps,
    Sumant.

  • Download data from internal table to flat file.

    I need to download the data from Internal table to Flat file. can any one suggest how to do it? i suppose WS_Download OR GUI_DOWNLOAD.
    but if it is please guide me how to use this.
    is thre any other F.M. please provide the information.
    Thanks in advance

    Hi,
    Try this,
    * File download, uses older techniques but achieves a perfectly
    * acceptable solution which also allows the user to append data to
    * an existing file.
      PARAMETERS: p_file like rlgrap-filename.
    * Internal table to store export data  
      DATA: begin of it_excelfile occurs 0,
       row(500) type c,
       end of it_excelfile.
      DATA: rc TYPE sy-ucomm,
            ld_answer TYPE c.
      CALL FUNCTION 'WS_QUERY'
           EXPORTING
                query    = 'FE'  "File Exist?
                filename = p_file
           IMPORTING
                return   = rc.
      IF rc NE 0.                       "If File alread exists
        CALL FUNCTION 'POPUP_TO_CONFIRM'
          EXPORTING
    *          TITLEBAR              = ' '
    *          DIAGNOSE_OBJECT       = ' '
               text_question         = 'File Already exists!!'
               text_button_1         = 'Replace'
    *          ICON_BUTTON_1         = ' '
               text_button_2         = 'New name'
    *          ICON_BUTTON_2         = ' '
    *          DEFAULT_BUTTON        = '1'
    *          DISPLAY_CANCEL_BUTTON = 'X'
    *          USERDEFINED_F1_HELP   = ' '
    *          START_COLUMN          = 25
    *          START_ROW             = 6
    *          POPUP_TYPE            =
          IMPORTING
               answer                = ld_answer
    *     TABLES
    *         PARAMETER              =
          EXCEPTIONS
              text_not_found         = 1
              OTHERS                 = 2.
    * Option 1: Overwrite
        IF ld_answer EQ '1'.
          CALL FUNCTION 'GUI_DOWNLOAD'
            EXPORTING
    *            BIN_FILESIZE            =
                 filename                = p_file        "File Name
                 filetype                = 'ASC'
    *       IMPORTING
    *            FILELENGTH              =
            TABLES
                data_tab                = it_excelfile   "Data table
            EXCEPTIONS
                file_write_error        = 1
                no_batch                = 2
                gui_refuse_filetransfer = 3
                invalid_type            = 4
                OTHERS                  = 5.
          IF sy-subrc <> 0.
            MESSAGE i003(zp) WITH
                     'There was an error during Excel file creation'(200).
            exit. "Causes short dump if removed and excel document was open 
          ENDIF.
    * Option 2: New name.
        ELSEIF ld_answer EQ '2'.
          CALL FUNCTION 'DOWNLOAD'
            EXPORTING
                 filename            = p_file          "File name
                 filetype            = 'ASC'           "File type
    *             col_select          = 'X'            "COL_SELECT
    *             col_selectmask      = 'XXXXXXXXXXXXXXXXXXXXXXXXXX'
    *                                                   "COL_SELECTMASK
                 filetype_no_show    = 'X'     "Show file type selection?
    *       IMPORTING
    *             act_filename        = filename_dat
            TABLES
                 data_tab            = it_excelfile    "Data table
    *            fieldnames          =
            EXCEPTIONS
                 file_open_error     = 01
                 file_write_error    = 02
                 invalid_filesize    = 03
                 invalid_table_width = 04
                 invalid_type        = 05
                 no_batch            = 06
                 unknown_error       = 07.
        ENDIF.
      ELSE.                               "File does not alread exist.
        CALL FUNCTION 'GUI_DOWNLOAD'
          EXPORTING
    *          BIN_FILESIZE            =
               filename                = p_file         "File name
               filetype                = 'ASC'          "File type
    *     IMPORTING
    *          FILELENGTH              =
          TABLES
               data_tab                = it_excelfile   "Data table
          EXCEPTIONS
               file_write_error        = 1
               no_batch                = 2
               gui_refuse_filetransfer = 3
               invalid_type            = 4
               OTHERS                  = 5.
        IF sy-subrc <> 0.
          MESSAGE i003(zp) WITH
                   'There was an error during Excel file creation'(200).
          exit. "Causes short dump if removed and excel document was open 
        ENDIF.
      ENDIF.
    Regards,
    Raghav

  • Download BLOB from report

    Hi,
    I would like to add a download link into a report for each row so that the user can download a BLOB. I have created a column in which to add a column link which when clicked will provide a popup which gives the user a choice of whether to save or open the file.
    I can get this to work on a static file by adding "p?n=7101305566584499" to the URL field in the column link section or the report column, but cannot get it to work on a dynamically-created file. I have written a procedure to create a file of the BLOB and can get the BLOB to be opened in the browser if I add to the URL field: "#OWNER#.fossilapp_pkg.download_image_jpeg?p_image_id=#Download#" - I know, therefore, that both the file-generating procedure and the reference to it work. However, I don't want the image to be opened in the browser, but instead would like a popup to appear asking the user to save or open the file.
    If I put "p?n=#OWNER#.fossilapp_pkg.download_image_jpeg?p_image_id=#Download#" into the URL field I get the following error when I click on the column link: "The requested URL /pls/apex/p was not found on this server."
    Any ideas?
    Thanks,
    Lucy

    Hi,
    I have found the problem - very simple really! I copied and modified a custom download procedure from somewhere on the forum and I have just noticed that 'Content-Disposition' was incorrectly spelled as 'Content-desposition'. Correcting this error means it now works!
    Thanks for your help - yes, what you had on your website was exactly what I required. Sorry for adding random stats into it, though it was nice to 'win' £100,000! I couldn't find an obvious way to delete the stats I had added, but feel free to delete them and my profile (username=Lucy).
    Cheers,
    Lucy

  • Problem while downloading file from custom table

    Hi All,
    Im trying to download the file from the custom table where i have stored the uploaded files through apex.
    I have created the download procedure as mentioned in the oracle docs ,
    And given the execute grant for public user.
    and calling that procedure by calling the URL -- #OWNER#.download_my_file?p_file=#ID#
    But im getting the below error
    Forbidden
    You don't have permission to access /pls/apex/owner.download_my_file on this server.
    Oracle-Application-Server-10g/10.1.2.0.2 Oracle-HTTP-Server Server at servername Port number
    Can any one tell whats the problem here.
    Thanks in advance
    regards,
    Arumugam KR

    Your function apex_util.get_blob_file_src under region, the first argument must be the name of page item anywhere in your application that is of type "file browse." So if your form for uploading the blob content is on page 11 and the file browse item is "P11_FILE_NAME" then your query would look like below:
    SELECT FILE_ID
         , FILE_NAME
          , CASE WHEN NVL(dbms_lob.getlength(BLOB_CONTENT),0) = 0
           THEN NULL
            ELSE
                  CASE WHEN attach_mimetype like 'image%'
                THEN '<img src="'||apex_util.get_blob_file_src('P11_FILE_NAME',id)||'" />'
                ELSE
                     '<a href="'||apex_util.get_blob_file_src('P11_FILE_NAME',id)||'">Download</a>'
               end
           END new_img
        FROM TABLE_NAME
    GET_BLOB_FILE_SRC FunctionAs an alternative to using the built-in methods of providing a download link, you can use the APEX_UTIL.GET_BLOB_FILE_SRC function. One advantage of this approach, is the ability to more specifically format the display of the image (with height and width tags). Please note that this approach is only valid if called from a valid Oracle Application Express session. Also, this method requires that the parameters that describe the BLOB to be listed as the format of a valid item within the application. That item is then referenced by the function.>
    [url http://docs.oracle.com/cd/E14373_01/apirefs.32/e13369/apex_util.htm]GET_BLOB_FILE_SRC

  • Download problem from 'Z' table

    Hi
    I am facing very strange problem ,
    I have created a 'Z' table and now it has 2800 records but when i download from data base it only get the 1627 records
    What might me the problem ???
    Technical Settings  :
    Data class         APPL0   Master data, transparent tables
    Size category      3       Data records expected: 7.700 to 31.000
    then i tried other standard table to download from data base save as local file....which contains 5000 records so it get all the 5000 records
    so in thisw case wat can be done ?
    pls help me on this
    regards
    rajan

    DATA : IT_TAB TYPE STANDARD TABLE OF ZMM_OPENSEZ.
      SELECT * FROM ZMM_OPENSEZ INTO TABLE IT_TAB .
      DATA: LOC_FILENAME TYPE STRING.
      LOC_FILENAME = P_FILE.
    *  CONCATENATE P_FILE '.XLS' INTO LOC_FILENAME.
      CLEAR IT_FIELDNAMES.
      REFRESH IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'Client'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'Start Date of Period'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'Last Date of Period'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'Plant'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'Project Definition'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'Material Number'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'Valuation Type'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'Valution Type Description'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'SerialNo'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'ITEM GROUP LONG TEXT'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'ANNEXURE NO'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'POST1'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'Number of Material Document'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'Posting Date in the Document'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'Movement Type (Inventory Management)'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'Material Description (Short Text)'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'Account Number of Vendor or Creditor'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'NAME'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'Unit of Entry'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'Purchasing Document Number'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'Unit Rate'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'Opening Proj Qty'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'Opening Proj Amt'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'Opening CS01 Qty'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'Opening CS01 Amt'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'RECEIPT QTY'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'RECEIPT AMT'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'ISSUE QTY'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'ISSUE AMT'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'TRANSFER QTY'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'TRANSFER AMT'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'Consumed Return Qty'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'Consumed Return Amt'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'Contractor Return Qty'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'Contractor Return Amt'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'CS01 Consump. Qty'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'CS01 Consump. Amt'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'CS01 Consump.  Ret Qty'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'CS01 Consump. Ret Amt'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'Work in Progress Qty'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'Work in Progress Amt'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'Closing Stock with APL'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'Total Closing Stock'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'Total Closing Stock Amt'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'FINALUPDATE'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'Modified By'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      IT_FIELDNAMES-STRING = 'Modified on'.
      APPEND IT_FIELDNAMES.CLEAR IT_FIELDNAMES.
      FILE_NAME = P_FILE.
      CALL FUNCTION 'GUI_DOWNLOAD'
         EXPORTING
    *     BIN_FILESIZE                    =
           FILENAME                       = FILE_NAME
           FILETYPE                       = 'ASC'
    *     APPEND                          = ' '
         WRITE_FIELD_SEPARATOR            = 'X'
    *     HEADER                          = '00'
    *     TRUNC_TRAILING_BLANKS           = ' '
    *     WRITE_LF                        = 'X'
    *     COL_SELECT                      = ' '
    *     COL_SELECT_MASK                 = ' '
    *     DAT_MODE                         = 'X'
    *     CONFIRM_OVERWRITE               = ' '
    *     NO_AUTH_CHECK                   = ' '
    *     CODEPAGE                        = ' '
    *     IGNORE_CERR                     = ABAP_TRUE
    *     REPLACEMENT                     = '#'
    *     WRITE_BOM                       = ' '
    *     TRUNC_TRAILING_BLANKS_EOL       = 'X'
    *     WK1_N_FORMAT                    = ' '
    *     WK1_N_SIZE                      = ' '
    *     WK1_T_FORMAT                    = ' '
    *     WK1_T_SIZE                      = ' '
    *     WRITE_LF_AFTER_LAST_LINE        = ABAP_TRUE
    *     SHOW_TRANSFER_STATUS            = ABAP_TRUE
    *   IMPORTING
    *     FILELENGTH                      =
         TABLES
           DATA_TAB                        = IT_TAB
           FIELDNAMES                      = IT_FIELDNAMES
    *   EXCEPTIONS
    *     FILE_WRITE_ERROR                = 1
    *     NO_BATCH                        = 2
    *     GUI_REFUSE_FILETRANSFER         = 3
    *     INVALID_TYPE                    = 4
    *     NO_AUTHORITY                    = 5
    *     UNKNOWN_ERROR                   = 6
    *     HEADER_NOT_ALLOWED              = 7
    *     SEPARATOR_NOT_ALLOWED           = 8
    *     FILESIZE_NOT_ALLOWED            = 9
    *     HEADER_TOO_LONG                 = 10
    *     DP_ERROR_CREATE                 = 11
    *     DP_ERROR_SEND                   = 12
    *     DP_ERROR_WRITE                  = 13
    *     UNKNOWN_DP_ERROR                = 14
    *     ACCESS_DENIED                   = 15
    *     DP_OUT_OF_MEMORY                = 16
    *     DISK_FULL                       = 17
    *     DP_TIMEOUT                      = 18
    *     FILE_NOT_FOUND                  = 19
    *     DATAPROVIDER_EXCEPTION          = 20
    *     CONTROL_FLUSH_ERROR             = 21
    *     OTHERS                          = 22
      IF SY-SUBRC = 0.
        MESSAGE S229(ZMM).
      ELSE.
        MESSAGE S230(ZMM).
      ENDIF.
    it_tab contains 2800 records ..
    Regards

  • Patching: HTTP errors when downloading blobs from proxy controller to agent

    Hi all,
    I have a persistent issue which I can't figure out. Oracle support aren't much help.
    When applying a Recommended Baseline patchset to our managed Solaris 10 servers, I have observed that blobs are downloaded to the target servers at a rate of 1-2 blobs per minute. I consider this to be quite slow, but that's not my main problem.
    At some point during the blob downloads, http errors start appearing in /var/scn/update-agent/logs/error.log on the target server....
    HTTP request failed. Reason: Moved temporarily.
    HTTP request failed. Reason: Bad gateway.
    Eventually, the blob download job fails completely...
    118099456 Download aborted.
    Our servers are quite a way behind in their patching levels. Consequently, we often need to apply as many as 200 patches to a single server. We are lucky to download 100 patches (blobs) before the http errors begin.
    The errors would seem to indicate that the http servers on the proxy controllers are refusing any further connections midway through the blob downloads. I have tried tweaking the httpd.conf file on the proxy controllers - increased the number of httpd processes running and increased MaxClients to 100. None of this has helped.
    The proxy controllers have interfaces on the same subnet as the target servers. Network performance between proxy and asset is good.
    Has anyone else experienced similar issues with patching ?
    Does anyone have any suggestions for httpd.conf settings on the Proxy Controllers ?
    Cheers,
    Graham

    So I have figured out the issue and as Eddie mentioned it is because the email attribute is not synced.  For some reason when I go into Manage User Profiles I am unable to edit anything, i.e. I cannot add the email address.  
    I am able to create a whole new user, which I did (already existed in AD) and of course included the email attribute.  When I sign into sharepoint with this user I am then able to view IRM protected documents.
    I cannot figure out why the email attribute is not synced to SP.  As mentioned above it seems the UPS does not work in a standalone SP install, but my undesrtanding is that when i sign into SP it is going to AD to autheticate, so why then does it not
    also retrieve the email attribute as well?
    I created an SharePoint Active Directory Import job, it runs successfully, it imports all my users from AD, but again without the eamil attribute!  Very strange.  If anyone has any clues I am all ears.

  • How to extract blob from a table and save it as  a file?

    Dear All
    i have table employee (emp_id number , emp_name varchar2(60) emp_image blob)
    1 - i want to extract the emp_image of every employee into a operating system folder c:\images
    2 - the file name should be emp_id.gif or emp_id.jpg
    How can i do that?
    Thanks a lot in advance for your co-operation
    Regards
    Mohamed Hammed

    I want to put an XML in a table's column using BLOBs.
    I tried the following ways:
    Created a table:
    CREATE TABLE lob_table (id NUMBER, doc BLOB);
    Created a directory:
    create or replace directory XML_DIR as '\app\granite\rnd';
    Created a PL/SQL procedure:
    CREATE OR REPLACE
    PROCEDURE BLOB_PROCEDURE AS
    src_lob BFILE := BFILENAME('XML_DIR', '1.xml');
    dest_lob BLOB;
    BEGIN
    DBMS_OUTPUT.PUT_LINE('1');
    INSERT INTO lob_table VALUES(1, EMPTY_BLOB())
    RETURNING doc INTO dest_lob;
    DBMS_OUTPUT.PUT_LINE('2');
    DBMS_LOB.OPEN(src_lob, DBMS_LOB.LOB_READONLY);
    DBMS_OUTPUT.PUT_LINE('3');
    DBMS_LOB.LoadFromFile( DEST_LOB => dest_lob,
    SRC_LOB => src_lob,
    AMOUNT => DBMS_LOB.GETLENGTH(src_lob) );
    DBMS_OUTPUT.PUT_LINE('Done');
    DBMS_LOB.CLOSE(src_lob);
    Exception
    when others then
    DBMS_OUTPUT.PUT_LINE('Exception');
    COMMIT;
    END BLOB_PROCEDURE;
    I am using Oracle SQL Developer.
    When I try to run the above procedure, it says:
    "Source does not have a runnable target."
    When I use Toad, the procedure executes properly, but there is no blob data in the table.
    Kindly help me in this regard.

  • Downloading BLOB from DB to local filesystem

    We have a requiremnt to provide a JSP page that allows user to select a file that is stored as a BLOB in an Oracle 9 DB and download to local machine.
    We have the listing of files working, but not 100% sure how to go about the actual file download code. Can anyone point us in the right direction? Sample code?
    Oracle 9i DB
    JDev 9.052
    Java 1.4
    Thanks,
    Mike

    Thanks, Francois.
    Is there another way?
    Basically, what our users want is to open pdf document stored as a blob column.
    My idea was to save document to AS and then open it using web.show_document().
    I would like to avoid saving file to clients PC and reduce network traffic.
    Mario
    Message was edited by:
    MarioK

  • Download data from internal table to excel sheet from the background

    Hello Experts,
    I have written a code where the data is stored in the internal table . Now when i run this code in the background i want this internal table data to get downloaded in the excel sheet. The function module GUI_DOWNLAOD is not supported in the background. So is there any other function module that can be used or is there any other way to do this
    Thanks in advance

    Hi Aditya,
    I would provide you 2 advice:
    1. save the file on the application server as text file and the fileds in it separated by TAB,you can download the file whenever you want and open it with excel.
    2.generate excel files and send it to the email address whatever you specify in the selection-screen.
    Thanks,
    Sam

  • Create root node and child nodes while downloading data from internal table

    Hi all,
    i have to down load the details of three materials present in the internal table into
    a  XML file, the material number must be the root node, ERNAM,AENAM,VPSTA
    fields must be its child nodes. in this way i have to display details of three
    materials like material1,material2,material3.
    how can i do that in 4.6c version.
    Thanks,
    satish.

    Hi Satish,
    Please look into the following programs. These are sample SAP programs to deal with XML in 46c.
    BCCIIXMLT1
    BCCIIXMLT2
    BCCIIXMLT3
    Hope these will helps,
    Sumant.

  • Download file from button

    Hi Guys,
    I followed thread 214709 (download blob from table) and had similar code in my Portal app. I have a stored procedure with almost identical code. My page has a drop down list which shows the last 12 sales files a customer can download. Behind it I have a Download Button.
    The procedure gets executed but the download window does not show up. If I put the call in a before header it actually works so nothing is wrong with the code. Where do I have to put the call and do I have create an additional branch. After download theu user should stay on that page. I actually have 3 sections with 3 buttons to download or request a file to be emailed.
    So my last question is what is best practice in this situation.

    the thread you followed...
    Downloading BLOB from a table.
    ...showed you how to make a procedure similar to our P procedure that's used to fetch blobs out of a document table. once your file download procedure works, you can call it from the web in one of three main ways:
    1) using an image tag as shown in File Upload ( again! )
    2) using an anchor tag as shown at the top of File download-upload
    3) directly calling it from the URL. this is effectively the same thing as clicking on a link from an anchor tag in number 2, above.
    it sounds as if your download procedure's working because you said it works if you call it before_header. i'm gathering from your post that you are currently trying to call your download procedure in some kind of after submit process. you're finding that your procedure's executing, but you don't see your file. i just set up a test case for this and found that if my page didn't have a branch on it, my after_submit process did render my image correctly. it doesn't sound as if this is what you're shooting for, though. it sounds as if you just want a select list that allows users to select a particular doc. after selecting a doc and clicking a button on your page, the user is allowed to download the doc while still being left on your original page. if so, how about creating a button that calls a javascript procedure that checks the value of your select list and returns a rendering of that image? if that's what you're after, you could do it by adding javascript like...
    <script language="JavaScript" type="text/javascript">
    function viewSelImage (theItem)
    var selVal = document.getElementById(theItem).value;
    var url;
    url = 'getmyfile?p_id=' + selVal;
    location.href=url;
    </script>
    ...which, of course, assumes your document download procedure is publicly executable and named "getmydoc". it also assumes that getmydoc accepts p_id which corresponds to your document table. then, assuming your select list item is called P1_MY_IMAGE_IDS, you could add a button to your page that has a URL target of...
    javascript:viewSelImage('P1_MY_IMAGE_IDS');
    ...and that would popup a call to your document download procedure while leaving the user on the same page... which i believe is what you're after.
    hope this helps,
    raj

Maybe you are looking for

  • RFE: Some issues with the Pre/WebOS coming from the perspective of a former Windows Mobile user, Part I

    I just switched over to a Palm Pre from a Windows Mobile device a week or two ago.  Now, don’t get me wrong here—I really do like the Palm.  For the most part, all of those things that were buggy, slow and inconsistent with Windows Mobile just simply

  • Can't open my files.

    I just upgraded to Yosemite and the latest version of Pages.  Now I can't open my files on iCloud.  I get a message that says:  File type can't be opened.  Thoughts?

  • Employee Photo Upload through binary data

    Hi all, I know the Provision for Photo upload through OAAD Tcode, I know FM to upload the photos by giving path as input data. my requirement is I have picture in the form of binary data . i want to upload that into PA30. I have return the following

  • My iPod Touch Freeze!!!!!

    i have my ipod touch 4 32g. Sometimes, i slide to unlock my ipod and show the home screen, then it FREEZE for 5-10 seconds!!!!! i tried to reset and restore it but it doesn't work. When i download an app from the appstore, i lock the screen. After do

  • Advanced Queuing for Oracle / Dequeue failed

    Hi *, I'm using Oracle Advanced Queuing and OC4J with some MDBs. Unfortunately sometimes I have following exception: 03-05-21 10:29 Error listening to 'USER_QUEUE' oracle.jms.AQjmsException: JMS-120: Dequeue failed      at oracle.jms.AQjmsError.throw