Skip to Content
Author's profile photo Sankaran A

Mass Printing

The existing scenario is, each document should print separately. But this article helps to save your time and print multiple documents at the same time.

I would like to document it here and let you know the same so that it will stay as a reference for everyone.

Tenant: SAP Business ByDesign.

Scenario: Implement Mass Print for Customer Invoice consequently.

Process Flow

  1. Prerequisites
  2. Create Standard Business Object, Screen & Script file
  3. Configure SAP Business ByDesign
  4. Scripting
  5. Add standard button on the customer invoice screen
  6. Configure SAP Print Manager
  7. Testing

Prerequisites

You have to download software from SAP Store and install it your local system.

  1. SAP Business ByDesign – User License
  2. SAP Cloud Application Studio
  3. SAP Print Manager Software

Create a Standard Business Object, Screen & Script

  1. Create a Customer Invoice standard business object and an OWL Screen.
  2. Create Action Validation: Release script file.
  3. Save and Activate.

Finally, your solution looks like in the below screenshot.,

Mass Printing Byd


Configure SAP Business ByDesign

  1. Login into SAP Business ByDesign as a Business User.
  2. Navigate to the Application and User Management -> Print Queues -> New
    New Queue window will open. Here,

    1. Enter Queue ID as Customer_invoing
    2. Assigned User: Click New button and create a new user.
    3. Click Save and Close.

Mass Printing Byd


Script

  1. Double click Release Action file which we generated in step 2.
  2. Copy & Paste below code.
  3. Save & Activate Script file.
    var Useraccountid : UserAccountID;
    
    var PDF : basisGlobal:BinaryObject;
    
    var title = “CustomerInvoiceDoc”;
    
    // Retrieve the attachment document’s content and assign to the PDF variable
    
    //Assign the content
    
    PDF.content = Document_content;
    
    // PD002 is an assigned user which we created in the previous step.
    
    Useraccountid.content = “PD002”;
    
    /*
    
             Useraccountid : This is assigned user id
    
              Title :  Title of the document
    
              Numberic value(1) : No of copies
    
              PDF : Content of file
    
              “Customer_Invoice” : Print queue ID which we created in previous step
    
    */
    
    var PrintDocument = OutputManagementUtilities.CreatePrintQueueItem(Useraccountid, title, 1, PDF, “Customer_Invoice”);
    
    return ture;​

 


Add standard button on the customer invoice screen

  1. Add a custom button on the standard screen as shown in the below screenshot.Mass Printing Byd
  2. Save & Activate.

Configure SAP Print Manager

  1. Download & Install SAP Print Manager.
  2. Configure your tenant with SAP Print Manager as shown in the below screenshot.Mass Printing Byd
  3. Double click on highlighted “Printer Queue”. Configure SAP Print Manager with your printers. Five printers can configure with the SAP Print Manager and Documents can store it on the local computer also.

Mass Printing Byd


Testing

  1. Open SAP Business ByDesign as a Business User.
  2. Choose Customer Invoicing -> Invoice Documents.
  3. Select only “Released” invoices. You can select more than one invoice at a time. (Ctrl+Click)
  4. Click Print button. (This is a custom button, which we added in step 5).
  5. It will show the printing status. Check with SAP Print Manager.

Mass Printing Byd

 

To learn more click here.

If you like to add some points to this article, kindly leave your points as a  comment.

Assigned Tags

      3 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Chempian Pontie
      Chempian Pontie

      Helpful!.

       

      Thanks

      Chempian Pontie

       

      Author's profile photo Ji-ho Yoo
      Ji-ho Yoo

      Hello,

      We followed this step for mass printing for customer invoicing.

      But it is not working, we could not find any reason.

      If you can see this, could you help us to check below for what is wrong?

      import ABSL;
      import AP.Common.GDT as apCommonGDT;
      import BASIS.Global as basisGlobal;
      import DocumentServices.Global;

      if (this.Status.ReleaseStatusCode == "3") //Release
      {
      var userAccountID : UserAccountID;
      var PDF : basisGlobal:BinaryObject;
      var title = "CustomerInvoiceDoc";
      userAccountID.content = "PRT_004";

      if (this.DocumentOutputRequest.IsSet())
      {
      var docOPReqItem = this.DocumentOutputRequest.Item;
      if (docOPReqItem.Count() > 0)
      {
      title = docOPReqItem.GetFirst().DocumentName;
      if (docOPReqItem.GetFirst().ItemPreview.IsSet())
      {
      if (!docOPReqItem.GetFirst().ItemPreview.PreviewBinaryObject.IsInitial())
      {
      //Assign the content
      PDF.content = docOPReqItem.GetFirst().ItemPreview.PreviewBinaryObject.content;
      }
      }
      }
      }

      var PrintDocument = OutputManagementUtilities.CreatePrintQueueItem(userAccountID, title, 1, PDF, "Customer invoicing");
      return false;
      }
      else
      {
      return true;
      }

      Author's profile photo Aruna Thakar
      Aruna Thakar

      Thank you for the information, Sankaran!