Skip to Content

ABAP : Add Yes / No popup before invoice print

Dear Abap Experts,

We want to give the user a popup message (Yes / No) before printing the billing document (Invoice , The Tcode is VF01).

I mean user must select Yes for print out and no for no print out by the printer.

How can we do this.? Should we use user-exit or by some ABAP code.? The program name in the NACE is RLB_INVOICE.

I have tried all the userexits for the Tcode VF01 but no success. I have checked many threads on SCN but no solution found.

I will be very thankfull to you if any one can help. Image is also attached for more clarification.

Regards,

Aneel Munawar

VF01.png (56.9 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Best Answer
    avatar image
    Former Member
    May 26, 2015 at 03:04 PM

    Hi Aneel,

    As the output is only triggered in V1 update process ( When you use Dispatch time "4" - Send Immidiately ) there is no way you can give popup before printing the form ).

    Do this. It should work.

    1. Write the code to give popup before invoice save . You can use BADI/EXIT/ BTE based on the floowing post.

    2. In the exit code save the response of user ( Yes / No ) along with the invoice number in a custom table. The reason we need custom table instead of ABAP Memory option is that by the time the print program will be called the memory will be refreshed by the COMMIT issued by SAP.

    3. Copy the driver program ( RLB_INVOICE ) . Select the response from the newly created custom table and set the flag TDIMMED of output options accordingly. Unfortunately the driver program has to be copied to write the code or you can use the generic BADI for driver program ( I am not sure RLB_INVOICE calls that or not ) to write the code. If you copy the driver program the output type configuration needs to be changed or you can ask for new output type copied from the standard one to use your custom driver program.

    4. Delete the response from the custom table if necessary.

    Regards,

    R

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 23, 2015 at 05:31 AM

    Hi

    Copy Program RLB_INVOICE and write code and assign to NACE.

    Regards,

    Chandu

    Add comment
    10|10000 characters needed characters exceeded

  • May 26, 2015 at 08:21 PM

    As Rudra mentioned that, you should not send popup during the V1 update. Processing time 4 gets triggered as soon as document gets saved.

    BTW, Giving popup in the output processing is the bad idea. Think of batch (Tcode VF04) where you user is generating the output. Poor fellow has to say yes so many times...

    If users don't need to have output, you need to suppress it via configuration - don't propose the condition which generates the output. Your SD consultant would know, how to control it.  If for some plants, the users don't want to print the output, create condition based on the plant and don't maintain this plant in the condition table.

    Billing document is rather static document. It doesn't gets changed that often like Delivery or Order. Thus, user would need to go into the billing document and change something (which many not be require) to trigger the output.

    Still if you want to have the Popup, Provide the popup during the output determination. Based on the user input, set SY-SUBRC  to 0 or 4 (4 when user say no). This way the output would be ignored and you wont have output.

    Regards,

    Naimesh Patel

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 25, 2015 at 06:36 AM

    Hi

    check Output condition type in VV31 for Dispatch time as ' 3' - send with application own transaction.

    its display preview , user want to close it without print.

    Regards,

    Chandu

    Add comment
    10|10000 characters needed characters exceeded

  • May 27, 2015 at 05:47 AM

    Dear All,

    Issue is being closed now.

    I am very thankful to you  all for  your help and comments.

    As mentioned by Rudra,

    This post helped me out to solve the issue.

    Thanks Rudra.

    Regards,

    Aneel

    Add comment
    10|10000 characters needed characters exceeded