Thursday, October 11, 2007

Deleting Document Attachments via fnd_attached_documents2_pkg - PO Lines

A quick correspondence with reader Mark L came up with the following to delete PO Line attachments. This is in relation to my blog on document attachments.

declare
l_entity_name varchar2(20):= 'PO_LINES';  -- PO_LINES entity for the package
l_pk1_value varchar2 (20) := '200487';    -- PO_LINE_ID attachments are attached to
l_delete_document_flag varchar2 (1) := 'Y';    -- Delete document
begin
fnd_global.apps_initialize(0,20420,1); -- SYSADMIN, System Administrator
fnd_attached_documents2_pkg.delete_attachments
( X_entity_name                  => l_entity_name
, X_pk1_value                    => l_pk1_value
, X_delete_document_flag         => l_delete_document_flag
);
end;
/
commit;
Nice, but use with caution!

3 comments:

Tani said...

Another way of deleting document Attachments via fnd_attached_documents correspondence with reader is good.

sap upgrade

Unknown said...

i have a question about this excel output format.
i saw the picture you posted, the excel file show within the browser, how could i make the excel export to an "really" .xls file, that i can edit directly ?

Gareth said...

Hi 蔡佩君,

In the browser choose file > Save as, and save the file then open it in Excel.

Regards,
Gareth