AP Invoice Attachment code

Hi
The below code is the part of the custom code in the PKG AP_WFAPPROVAL_PKG
i observed that "'PLSQLBLOB:xxx_workflow_pkg.xx_notif_attach_procedure/' || to_char(l_file_id));" is not working by adding debug msg, temp table.
Can you let me know how to use 'PLSQLBLOB:xxx_workflow_pkg.xx_notif_attach_procedure/' || to_char(l_file_id))
in the package (AP_WFAPPROVAL_PKG) ...
select fl.file_id
into l_file_id
from
ap_invoices_all ai,
FND_ATTACHED_DOCS_FORM_VL fad,
fnd_lobs fl
where ai.invoice_id= fad.pk1_value
and fad.MEDIA_ID = fl.file_id
and ai.invoice_id =substr(itemkey, 1, instr(itemkey,'_')-1)
group by fl.file_id;
wf_engine.setitemattrdocument
(itemtype=>itemtype
, itemkey=>itemkey
, aname=>XXX_TEST_ATTR'
, documentid =>'PLSQLBLOB:xxx_workflow_pkg.xx_notif_attach_procedure/' || to_char(l_file_id));
Regards
Yram

Hi Varun
Thanks for your response...
due to the limitation in the uploading the pkg...(size of the pkg XXX_AP_WFAPPROVAL_PKG is exceeding the limit)... i have not uploaded the pkg....
do find the pkg xxx_workflow_pkg which is called in the XXX_AP_WFAPPROVAL_PKG.notification_handler
1. let me know where to use the below code
select fl.file_id
into l_file_id
from
ap_invoices_all ai,
FND_ATTACHED_DOCS_FORM_VL fad,
fnd_lobs fl
where ai.invoice_id= fad.pk1_value
and fad.MEDIA_ID = fl.file_id
and ai.invoice_id =substr(itemkey, 1, instr(itemkey,'_')-1)
group by fl.file_id;
wf_engine.setitemattrdocument
(itemtype=>itemtype
, itemkey=>itemkey
, aname=>XXX_TEST_ATTR'
, documentid =>'PLSQLBLOB:xxx_workflow_pkg.xx_notif_attach_procedure/' || to_char(l_file_id));
--pkg xx_workflow_pkg
CREATE OR REPLACE package body APPS.xxx_workflow_pkg is
PROCEDURE xx_notif_attach_procedure
document_id IN VARCHAR2
,display_type IN VARCHAR2
,document IN OUT BLOB
,document_type IN OUT VARCHAR2
) IS
lob_id NUMBER;
bdoc BLOB;
content_type VARCHAR2(100);
filename VARCHAR2(300);
BEGIN
--set_debug_context('xx_notif_attach_procedure');
lob_id := to_number(document_id);
-- Obtain the BLOB version of the document
SELECT file_name
,file_content_type
,file_data
INTO filename
,content_type
,bdoc
FROM fnd_lobs
WHERE file_id = lob_id;
document_type := content_type || ';name=' || filename;
dbms_lob.copy(document, bdoc, dbms_lob.getlength(bdoc));
EXCEPTION
WHEN OTHERS THEN
--debug('ERROR ^^^^0018 ' || SQLERRM);
wf_core.CONTEXT('xx_g4g_package'
,'xx_notif_attach_procedure'
,document_id
,display_type);
RAISE;
END xx_notif_attach_procedure;
end xxx_workflow_pkg;
Regards
Yram

Similar Messages

  • Where is "Attach Code" option???

    When posting a new topic, there is a note that states:
    Please use "Attach Code" to include any sample code in the
    message.
    However, there is no button that allows you to do this. Can
    we get this fixed?

    That feature is disabled in this forum, for some reason. It
    really bites. Adobe is working on the forums constantly, we can
    hope this will be fixed soon.
    Tracy

  • Error creating Invoice though code

    Hi All,
    I have a requirement to convert deliveries to invoice through code.
    When adding a delivery without rearranging items in the matrix and converting that delivery to invoice through code works fine.This can be done using the "Copy To" function in delivery window also.However when I add items to a new delivery , eg : items A001,A002,A003 added to the lines and before clicking the add button, I changed A001 to A003,Then clicked add.Delivery is saved.This saved delivery couldnt be converted to Invoice through code.Error is "INV1: ItemCode is missing in Line".But this delivery can be manually converted to invoice though B1 window.The code I am using is as follows.
    SAPbobsCOM.Documents oINV;
                        oINV = (SAPbobsCOM.Documents)
                            modups.oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices);
                        oINV.CardCode = oDLN.CardCode;
                        for (int i = 0; i < oDLN.Lines.Count; i++)
                            oDLN.Lines.SetCurrentLine(i);
                            string str = oDLN.Lines.ItemCode;
                            if (i != 0)
                                oINV.Lines.Add();
                            oINV.Lines.BaseType = Convert.ToInt32(SAPbobsCOM.BoObjectTypes.oDeliveryNotes);
                            oINV.Lines.BaseEntry = oDLN.DocEntry;
                            oINV.Lines.BaseLine = i;
                            taxcode = oDLN.Lines.TaxCode;
    oINV.Add();
    Can any body help me to trouble shoot this? I am wondering because it works in one case and fails in othercase where the itemcode is edited just before save.
    Deepesh

    Deepesh,
    Documents.DocDueDate and Document_Lines.ItemCode are mandatory fields. You need to set them manually.
    SAPbobsCOM.Documents oINV;
    oINV = (SAPbobsCOM.Documents)
    modups.oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices);
    oINV.CardCode = oDLN.CardCode;
    oINV.DocDueDate = oDLN.DocDueDate;
    for (int i = 0; i < oDLN.Lines.Count; i++)
    oDLN.Lines.SetCurrentLine(i);
    string str = oDLN.Lines.ItemCode;
    oINV.ItemCode = str;
    if (i != 0)
    oINV.Lines.Add();
    oINV.Lines.BaseType = Convert.ToInt32(SAPbobsCOM.BoObjectTypes.oDeliveryNotes);
    oINV.Lines.BaseEntry = oDLN.DocEntry;
    oINV.Lines.BaseLine = i;
    taxcode = oDLN.Lines.TaxCode;
    oINV.Add();
    Kind Regards,Yatsea

  • "Attach Code" is now available!

    The long missing "Attach Code" button is now available in the
    "Reply" screen of the forum.
    This will help a lot when posting code examples.
    Tracy

    Duh, show them what it looks like :P (haven't seen it
    myself...)
    Edit: Next up-> The push for syntax highlighting :P

  • Help: i need smtp single attachment code

    hy
    i need smtp single attachment code with out any html tag.
    thnx with regards

    There is some sample code on OTN
    http://www.oracle.com/technology/sample_code/tech/pl_sql/htdocs/Utl_Smtp_Sample.html

  • Invoice attachment to R/3 system

    Hi ,
    I have created an invoice without reference to a PO  in SRM 7.0.
    I performed the following steps.
    1. from role Invoicing --> Overview --> Invoice processing --> Created documents --> Invoice create an
    invoice.
    2. In the notes and attachment tab add an attachment ( a word doc
    e.g. "test.doc" )
    3. Make sure invoice is in approved state.
    4. in BBP_PD transaction in SRM ABAP system check the attachment.
    5. Go to Tracking tab and get the Back end document number.
    6. Go to FB03 transaction in R/3 system and enter the document and
    Company code to view the document
    7.In document overview , go to attachment list and try to locate the
    attachment.
    8. Attachment was missing.
    how can i transfer this attachment in back end R/3 system?
    Regards,
    Ashish Shah

    This feature is not possible,
    Got the following response from SAP:
    Unfortunately, I can not provide a solution for you. Once the invoices
    are transferred from SRM to Backend via IDOC funcionality it is not
    possible to use this to transfer attached files.
    This is the standard system design.
    Regards,
    Ashish Shah

  • Inbound Invoice -  Porcess code etc

    Hi,
    I think I need to append VBRK for invoice.
    I need to save a Reference field that is comming from 3 party and send to us via xml and then convertet to SAP idoc (XI/PI) .
    I'm thinking of using inound INVOICE02 for this purpose.
    a. there are different process code for inovice. Which to use ?
    b. The idoc should be quite simple in this matter... just Inovice nr and ref.field. right ?
    Br Martin

    ?  You only need to attach a reference number to an invoice that already exists in your system?  If so, I would create my own custom IDOC, single segment, two fields, write my own function module to process (update the field in VBRK when the invoice number is obtained) and create my own process code to call the FM.
    On the other hand, if the invoice detail is coming to you, you could utilize and unused field in the IDOC and use a user exist to grab that value and populate, or you could extend an appropriate IDOC.  What process code do you now have for the IDOC you mentioned?

  • Aging report - detailed needs invoice project code

    Dear All,
    Would it be possible for us to have project code (on A/R invoice header) on Aging report - detailed print layout? I found all fields in Aging report - detailed PLD are sys var. Is there a way for us to figure out which sys var is for project code of the invoice? Thanks a lot.
    Regards,
    Yuka

    Unfortunately you can't, you have to recreate it using crystal. In all SAP std reports you only able to show/print what it already shows.

  • INDIA - Subcontract Process- Creation of Excise Invoice T-code J1IS

    Dear All,
    We are placing most of the purchase orders on subcontractor labour basis & raw material steel is being supplied by us to subcontractor. Transfer posting Movement type 311. After creation of material document Excise Invoice is created using T-code J1IS. Finsidhed job directly despatched to site.
    At present for raw material despatches to vendor from works, Assessable value is derived on by the basis of GR No. printed on the transfer posting delivery note. A person preparing excise invoice retrieves the relevant GR works out the Assessable value and then enters the value manually. This process is repeated for as any many line items that a particular delivery note consists. This is resulting in delay of creating excise invoice. In our case we have only Project stock & moving average price is being update automatically in Table QBEW .
    Now our requirement is that The value should be auto derived from QBEW Table and captured while creating excise invoice. T-code J1IS.
    Please inform if this is possible & guide us.

    In normal circumstances, it is not possible to generate an excise invoice for credit / debit notes in SAP.  Moreover, DLFC excise invoice type can be generated only if delivery is involved.  So in order to achieve the requirement (and fool the system :-|), you can try by creating a delivery with an item category as TAX so that it will not check for stock, do PGI and invoice (credit memo) can be generated  referencing credit memo request.  Finally, try to generate an excise invoice via J1IIN
    I have never tried this option and hence, its only a guess that this should work.  Update after testing.
    thanks
    G. Lakshmipathi
    Edited by: Lakshmipathi on Jul 26, 2011 2:07 PM

  • Invoice Attachment

    We are getting Invoices from our Vendors with the Attachment.
    After it comes into XI, the Invoice Data and the Attachment(PDF) needs to be separated and then needs to be sent into R/3 system. The Invoice data goes into R/3 as an IDOC.
    How should I achieve this in Message Mapping? How to separate the Invoice data and the PDF Attachment?
    The adapters needs to be used?
    Thanks.

    That is not possible out of the box. Most adapters like RFC adapter, BPM and mapping cannot deal with attachments.
    When your application system is based on 6.20, you could create an ABAP proxy which deals with the attachment and calls inside the IDOC and the RFC.
    Another approach is using a Java Proxy which runs on the XI server. It receives the message and sends two seperate messages out, one for the invoice, one for the attachment.
    You could use as well an adapter module, but you can only combine the invoice and the attachment to one payload and do a message split with different mappings later.
    Here an idea for an adapter module:
    /people/sap.user72/blog/2005/07/15/copy-a-file-with-same-filename-using-xi
    Regards
    Stefan

  • SBO 2007 PLD AR invoice item code not printing

    Hi,
    We have a problem which just started yesterday on an installation that has been running fine for a long time.   The PLD format for the AR Invoice usually prints the row ItemCode no problem.  Since yesterday it started printing the item's manufactirers number instead.   If we changed the default layout to the SAP supplied layout the problem was the same.   Went in to the customised PLD and amended it to one field and then back to the ItemCode now it does not print anything in that field, and nor do the system provided PLDs either, although they have/can not be amended.
    Any ideas?
    Thanks
    Simon

    Hi Thanks for the replies,
    The system is on SP00 PL49.    There are no add-ons, and certainly no add-on have been removed or added recently.  The AR invoice PLD has been in use for at least six months without modification.   The field for item code in the PLD looks fine, if I amend it to show, say, the INV1 warehouse code instead, it works fine.  If I switch it back to Itemcode it print nothing.   If I check the table it looks fine also.  It is very strange that the same symptom is experienced in the customer modified PLD and system default PLDs
    Any ideas?
    Simon

  • Pdf attachment code

    Hi,
    Script to Mail as PDF attachment. Any one having the code for this...
    If so, please give me the code..
    I want code for sales order acknowledgment mail should go as PDF attahment.
    Thanks in advance
    Venkat

    hi,
    check all the below links if u find it useful mark the points
    http://www.erpgenie.com/abap/pdf_creation.htm
    script to pdf to email????
    Problem Sending SAP Script as a PDF attachment to external mail
    script to pdf
    send script as a pdf
    ~~Guduri

  • List of Excise Invoices-T-CODE other than J1I7

    Hi,
    Can any body plz tell me the t-code or path to see list of excise invoices created other then j1I7 T.code.
    In J1I7 T.code only Basic excise duty is flowing--but ECS & SECess in not flowing..
    Plz guide me...
    Thanx & Regards,
    Ramesh Reddy

    Through J1IV also we can view the list of excise invoices.
    Regards.

  • Invoice Attachment in MIRO/MIRA

    Hi All,
    Please let me know how invoice pdf can attach in MIRO/MIRA.
    I am an abaper and I am facing an issue where the attached pdf values( Invoice no and PO no ) and the screen values are not matching.
    Please let me know, is the pdf is attaching manually or whether the attachment will create automatically once the invoice is entered in the system.
    Regards,
    Nikhil V.Kumar

    Hi ,
    We are using same process and attached the invoice to the PO Line Item,
    So you always can see it from the MIRO, or finance documents ( Drill down to PO )
    Regards,
    Moshe

  • Mail with invoice attachment. How to?

    Hi... With the client, you can email an invoice (jpg attachment).. In the SDK you can also send emails using the Message-object, but is it possible to make the jpg-file as attachment... I can't see how...

    Hi Rasmus,
    Using the DI API SBO 2004 can only create a .xml version of the invoice (to create the .jpg is impossible) and attach that to the Mail. You would have to find a way to create a .jpg document and then attach that. It has been mentioned that you could send the document to a ".jpg printer" as you would send a word document to a ".pdf printer" and then attach that file to your mail

Maybe you are looking for

  • ITunes Library search won't find song actually in library

    i have the problem with iTunes 7.5 it won't find some of the songs in my library when i search them. i can see them in the library, but when i type a word from artist or album it won's show anything. any ideas? also, why doesn't the album cover chang

  • Create a new line in the smartforms

    Hi Guys, Please let me know to create a new line in the smartforms. I tried creating a window with the height length is 0 cms. It is allowing to create a line.

  • Can't get photos out of iphoto

    arghhh... i'm super frustrated because all of a sudden i can not get my photos from iphoto to 1. go into photoshop 2. to even go on the desktop and 3. to burn to backup I see them on my iphoto and in the folders they are supposed to be in but i feel

  • Oracle 11gR2 RAC Vs Linux Version

    Hi Guys Please let me know whether i can start the Oracle 11gR2 RAC Grid installation in RHEL 6 or the higher version. Will i able to download the ASM libs for RHEL 6 n greater version. Thanks.

  • How to run Perl script in Java program?

    Some say that the following statement can run Perl script in Java program: Runtime.getRuntime().exec("C:\\runPerl.pl"); But when I run it, it'll throw IOException: java.io.IOException: CreateProcess: C:\runPerl.pl error=193 at java.lang.Win32Process.