Skip to Content
avatar image
Former Member



I am new on this Forum and on SAP. Please don't mind if the question may be silly but I have a condition here, out of which I am not able to find out the conclusion/root cause.

Problem:Quotation Invoice attached with Billing Document Invoice in same PDF despite both of them having different output types

I have a billing document with say output type ZBILL and sales quotation with output type ZQUO. I have triggered the quotation today with communication method 1(Print Output Immediately and am able to see the output). Post this activity on the next day a batch job runs that picks all the billing documents to be processed out of which my billing document is also picked and processed with the communication method 5(send email).

Now when the email is sent, it is sent with attachment having 2 pages. Page 1 with the quotation having output type ZQUO and page 2 for the billing document picked having output type ZBILL.

Both of these i.e. the quotation and the billing document are not related in any manner. The driver program and smartform of both of them are different. Also, the variant maintained for the job has the output type ZBILL and not ZQUO. The program that runs is the standard program SD70AV3A having header as output for billing.

Now my query here is on why the quotation invoice was attached as an added page to the PDF of Tax Invoice(billing document). The output triggered by the batch job had 2 pages(1 with the quotation invoice and 1 with the billing document)

I suppose it may be some sort of buffer issue but am not sure on it.

Can someone provide any inputs on what shall I check further and what can be the cause for this?


Add comment
10|10000 characters needed characters exceeded

  • For your output types is it a custom Z* program that executes or a standard one?

  • Former Member Michelle Crapo

    Yes,it is a custom Z program.

    I debugged the program and found that the spool id that gets generated for the quotation is picked for the smartform spool id.

    This is the reason why the quotation is getting attached with the billing document. This part is handled by SAP Standard code. Now here, I am unsure on why is this happening. Have you come across any such scenario?

  • Former Member

    Hi Sandra,

    I have changed the Tag from ABAP to SD but I suspect there maybe some ABAP related to this as the output type is not standard output type. Please check it if possible and let me know if you find any leads on what can be the root cause of this problem

  • Get RSS Feed

2 Answers

  • Best Answer
    Feb 28, 2018 at 01:45 PM

    Well - I would simply change the smartform. (ABAP solution) Put code in it to separate the documents. The problem would be if you wanted to keep several pages of billing documents and quotations. So in the smartform the option to set is under the interface output options-TDNEWID = 'X'.

    In each Smartform.

    Yes - send it back to your ABAPer as there are many different ways to do this. I'm only offering the one. And you could be causing more of an issue if you are trying to group several billing documents together in one e-mail. Doing this will create a new spool file for each one.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Also, each and every billing document needs to be sent in separate emails and hence creating a new spool for each one makes sense. Hence,went forward with the approach

  • Feb 23, 2018 at 08:20 PM
    "when the email is sent..."

    Assuming that this is done by the output processing program then that's where your answer would be. Most likely the output is processed by a custom program, as Michelle hinted in the comment. Find the program name in NACE and send this to an ABAPer (locally).

    If you're a business user then just report such issues to a local SAP Support team. If you're an SAP SD consultant then please make sure to familiarize yourself with how output works. Naturally, you don't have to know how the programs work in detail but at least knowing which part does what (i.e. what is driven by configuration, by program and by form) is very important. If you're an ABAPer then ditto about the output configuration basics.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanks for your efforts and comments. As per the comment by Michelle, I changed the parameter TDNEWID to X so that I it will be ensured that always a new spool will be created and this issue won't come up again.