Skip to Content

how to create an attachment to FB03 (accounting doc) thourgh abap program.

Hi,

Kindly suggest me how can I create an attachment to the FB03 (Accounting document) by using an ABAP program.

thanks in advance.

Regards,

Vijay.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Posted on Jan 05, 2010 at 03:40 PM

    Hello

    Try something like this:

    Moderator message - Please respect the 2,500 character maximum when posting. Post only the relevant portions of code

    Regards, Otto

    p.s.: note you need to change the object to add the attachment too, provide the attachment your way... this is just a demo report etc.

    Edited by: Rob Burbank on Jan 5, 2010 10:42 AM

    Add a comment
    10|10000 characters needed characters exceeded

    • Vinod Vemuru Vijaymadhur Papabathini

      Hi,

      You need to use generic object services for this (GOS). You have to do small customization for archiving the output document.

      Check with your functional for customization changes. ABAP side just you need to pass the archival parameters to smartform/script FM in the print program.

      Thanks,

      Vinod.

  • Posted on Jan 07, 2010 at 10:04 AM

    In the code I have posted I attached a document to a SAP object. The way you get the data - if that is download or you print/ generate the PDF doc using the SAP/ Adobe function modules - is irrelevant.

    You will find the place in the code where all this funcionality is to be triggered and there you will code something like this:

    1) get data (returns data)

    2) generate the PDF form using the data (returns binary data of the generated form, same as if you would upload it)

    3) save the form to the GOS (you can access this in your transaction using the top left icon - it is called GOS toolbar or button or something like that)

    After the save you can: see it in your transaction for the object, check the binary relation (object-attachment) in table TOA01 (if I remember well), display the attachment/ load and send binary data etc.

    The upload code from my snippet was only to help you learn it. The report was ready to run. For your purpose you need to replace this upload by the mentioned PDF generator function module.

    Otto

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 02, 2014 at 05:50 PM

    Hi Vijyamadhur,

    Can u please attached the code provided by Otto, I have same kind of requirement and like to check it for my reference.

    Thank You,

    Raj.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 17, 2014 at 11:34 PM

    Thank you very much Vijaymadhur, will check it

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 15, 2016 at 09:00 AM

    Hi vijyamadhur.

    I have same requirement where in FB03 when selecting a particular correspondence type which was given to us one Smartform get trigger which we can see through f.64 tcode . The user want that the form which get triggered directly attach to attachment link of FB03 as PDF form.

    Could you please explain the procedure ,how I will first convert the form into pdf in standard then attach it to attachment link programmatically .

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.