1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

Location Path for Form Attachment

Discussion in 'Oracle Forms and Reports' started by brahmaji, Sep 17, 2013.

  1. brahmaji

    brahmaji Active Member

    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    55
    Hi ,

    Can you please tell me the path where the form attachment will be stored in oracle apps r12.

    Thanks
     
  2. kiran.marla

    kiran.marla Forum Genius

    Messages:
    403
    Likes Received:
    52
    Trophy Points:
    505
    Location:
    Khammam
    Hi,

    1. Source file fmb is stored in $AU_TOP/forms/US path..
    2. Executable file fmx is stored in $<MOD_TOP>/forms/US path..

    Hope this helps...
     
  3. brahmaji

    brahmaji Active Member

    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    55
    Hi Kiran,

    We are not looking for form location.. We want to know where the document will be stored when we attach a document in form level from attachments option.

    Regards,
    Brahmaji
     
  4. kiran.marla

    kiran.marla Forum Genius

    Messages:
    403
    Likes Received:
    52
    Trophy Points:
    505
    Location:
    Khammam
    Refer to FND_LOBS tables...
     
  5. brahmaji

    brahmaji Active Member

    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    55
    Didn't get information from FND_LOBS table....

    Regards,
    Brahmaji
     
  6. kiran.marla

    kiran.marla Forum Genius

    Messages:
    403
    Likes Received:
    52
    Trophy Points:
    505
    Location:
    Khammam
    Once there was a requirement of my client like one yours. He want the purchase order attached file content to be printed in the report. but unfortunately that was not accomplished. but we some what developed that the file can be retrieved from the server... the following code fulfills it... the following plsql program creates file in the server...

    Code (SQL):

     DECLARE
    l_file UTL_FILE.FILE_TYPE;
    l_buffer RAW(32767);
    l_amount BINARY_INTEGER := 32767;
    l_pos INTEGER := 1;
    l_blob BLOB;
    l_blob_len INTEGER;
    l_blob_fnme VARCHAR2(200);
    BEGIN
    -- Get LOB locator
    --SELECT col1
    --INTO l_blob
    --FROM tab1
    --WHERE rownum = 1;

    SELECT file_name, file_data
    INTO l_blob_fnme, l_blob
    FROM FND_LOBS
    WHERE FILE_ID = 784505;

    --SELECT FILE_DATA INTO i1 FROM FND_LOBS WHERE FILE_ID = 784508;

    l_blob_len := DBMS_LOB.getlength(l_blob);
    -- Open the target file.
    l_file := UTL_FILE.fopen('/usr/tmp',l_blob_fnme, 'A', 32767);
    -- Loop through the BLOB and write to 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, TRUE);
    l_pos := l_pos + l_amount;
    END LOOP;

    -- Close the file.
    UTL_FILE.fclose(l_file);

    EXCEPTION
    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;
    END;
    /
     
    later we suggested user to enter long text instead of attaching the file to the PO then he accepted to do so..

    Code (SQL):

    SELECT fdlt.long_text
      FROM fnd_document_datatypes fdat,
           fnd_document_entities_tl fdet,
           fnd_documents_tl fdt,
           fnd_documents fd,
           fnd_document_categories_tl fdct,
           fnd_attached_documents fad,
           fnd_documents_long_text fdlt
     WHERE fd.document_id = fad.document_id
       AND fdt.document_id = fd.document_id
       AND fdct.category_id = fd.category_id
       AND fd.datatype_id = fdat.datatype_id
       AND fad.entity_name = fdet.data_object_code
       AND fdlt.media_id = fd.media_id  
       AND fad.entity_name = 'PO_HEADERS'
       AND fad.pk1_value = TO_CHAR(:PO_HEADER_ID);
     

    is this you are looking for ???
     
    Bharat and brahmaji like this.
  7. brahmaji

    brahmaji Active Member

    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    55
    Yes kiran..

    Thank you .