SAP Knowledge Base Article - Preview

3784950 - OutputManagementUtilities.GetPDF Returns empty binary object for standard business objects and form templates

Symptom

When using the OutputManagementUtilities.GetPDF() function in custom code to generate PDF documents for standard business objects (such as Sales Order, Customer Quote, Contract, Service Request, Opportunity), the function returns an empty binary object with the following characteristics:

  • .content.IsInitial() returns true
  • The binary object has no content
  • No error messages are thrown during execution
  • The form template displays correctly when using the UI Preview button
  • The form template code and language parameters appear to be correct

Example scenario:

You are attempting to generate the PDF programmatically for the Sales Order form template:

var FormTemplateLanguage = "E";
var FormTemplateCode : OutputRequestFormTemplateCode;
FormTemplateCode.content = "C2029"; //Form Template Code for Sales Orders
pdfDocument = OutputManagementUtilities.GetPDF(this.GetFirst(), FormTemplateCode, FormTemplateLanguage);

// Result: pdfDocument.content.IsInitial() = true (empty binary)


Read more...

Environment

  • SAP Cloud Applications Studio
  • SAP Business ByDesign
  • SAP Cloud for Customer

Product

SAP Business ByDesign all versions ; SAP Cloud Applications Studio all versions ; SAP Cloud for Customer add-ins all versions ; SAP Cloud for Customer core applications all versions

Keywords

OutputManagementUtilities, GetPDF, empty binary, PDF generation, standard business object, custom business object, Sales Order, Customer Quote, Contract, Service Request, Opportunity, DocumentOutputRequest, binary object, pdfDocument.content.IsInitial, form template, ABSL, SDK, Cloud Applications Studio, C4C, ByD, PreviewBinaryObject, OutputRequestFormTemplateCode, PDF empty, GetPDF returns empty, Sales Order PDF, Contract PDF, empty PDF binary, form template not working , KBA , AP-RC-BDS-OM , ByDesign Studio Output Management(Forms) , AP-RC-BDS-SCR , ByDesign Studio Scripting (ABSL) , How To

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP for Me (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.