cancel
Showing results for 
Search instead for 
Did you mean: 

ReuseFunctions in OutputManagementUtilities

former_member187171
Participant
0 Kudos
810

Dear Experts, There are three functions in Library OutputManagementUtilities. 1. CreatePrintQueueItem ; 2. CreatePrintQueueItemWithFormTemplate ; 3. GetPDF

First question: There is not explanation for function 1 and 2 in help document, could you help please?

Second question is: Function GetPDF returns nothing when the FormTemplateCode is a standard form template code, while it returns the Binary Data while a Custom Form Template which is created basing on a Custom Business Object is imported. Is this function designed only using for Custom Form Template? Or I missed something while calling this function? >>For example, refer the following codes, templatecode1 is from a Custom Form Template, while templatecode2 is from a standard one(Production Order). Here I am sure the import parameters are correct, for PDF1, I can get the return Binary data as I expected, however, for PDF2,the return is null. I tried several standard form template codes here, the return is always null. >>>>sample codes: FormTemplateCode1.content = "Y8C18KNX_PQB87"; FormTemplateCode2.content = "MM_02"; //Reuse service Call PDF1 = OutputManagementUtilities.GetPDF(this, FormTemplateCode1, FormTemplateLanguage); PDF2 = OutputManagementUtilities.GetPDF(prodOrder, FormTemplateCode2, FormTemplateLanguage); <<<<

Third question is : Function CreatePrintQueueItemWithFormTemplate returns an error message” Mandatory parameter binary data is missing”, there are 12 import parameters of this function, I tried to fill value for all the import parameters as following codes, however the return cannot be get and the error was popped out. Could you help to explain how to use this function please? >>>>sample codes: userAccountID.content="K8U08M26CI1";// documentName="Picking list "+this.MergedPickingListNo; queueId="DEFAULT"; numberOfCopies=1; formTemplateCode="Y8C18KNX_PQB87"; language="1"; countryCode="CN"; companyId="SR10"; OrgUnit="SR11"; channelType="1"; docCreationTimestamp=Context.GetCurrentSystemDateTime().content.ToString(); formXMLData.content=PDF1.content; formXMLData.mimeCode="application/pdf"; formXMLData.fileName="领料单_"+this.MergedPickingListNo+ " .pdf"; formXMLData.uri="/BOAttachments/"+this.MergedPickingListNo+"/"+formXMLData.fileName; formXMLData.characterSetCode="utf-8"; formXMLData.format="pdf";  test=OutputManagementUtilities.CreatePrintQueueItemWithFormTemplate(userAccountID,documentName,queueId,numberOfCopies,formXMLData,formTemplateCode,language,countryCode,companyId,OrgUnit,channelType,docCreationTimestamp);<<<

Thanks for your help. Br Misher

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member187171
Participant
0 Kudos

Hell All, Update my findings:   The function GetPDF only works for custom Form template "OutputManagementUtilities.GetPDF(this, FormTemplateCode1, FormTemplateLanguage)" For function CreatePrintQueueItem, I can create the print queue item successfully using following sample codes. However for function CreatePrintQueueItemWithFormTemplate , the error “ Mandatory parameter binary data is missing” was popped out. Why same Binary Data behave different in these two functions? What else should be paid attention when calling function-CreatePrintQueueItemWithFormTemplate . Sample codes: userAccountID.content="K8U08M26CI1";// documentName="Picking list "+this.MergedPickingListNo; queueId="DEFAULT"; numberOfCopies=1; formTemplateCode="Y8C18KNX_PQB87"; language="1"; countryCode="CN"; companyId="SR10"; OrgUnit="SR11"; channelType="1"; docCreationTimestamp=Context.GetCurrentSystemDateTime().content.ToString(); formXMLData.content=PDF1.content; formXMLData.mimeCode="application/pdf"; formXMLData.fileName="领料单_"+this.MergedPickingListNo+ " .pdf"; formXMLData.uri="/BOAttachments/"+this.MergedPickingListNo+"/"+formXMLData.fileName; formXMLData.characterSetCode="utf-8"; formXMLData.format="pdf";  //failed created test=OutputManagementUtilities.CreatePrintQueueItemWithFormTemplate(userAccountID,documentName,queueId,numberOfCopies,formXMLData,formTemplateCode,language,countryCode,companyId,OrgUnit,channelType,docCreationTimestamp); //Sucessfully created test1=OutputManagementUtilities.CreatePrintQueueItem(userAccountID,documentName,numberOfCopies,formXMLData,queueId); Do you have any idea? thanks br Misher

Former Member
0 Kudos

Hi Misher,

This document might be helpful.

Best Regards,

Fred

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Misher,

I forwarded your question to the resp. colleagues.

Stay tuned for an answer,

   Horst

former_member187171
Participant
0 Kudos

Hello Horst, Thanks for your help. Looking forward an answer. Br Misher

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Misher,

This is the information reg. the other 2 functions:

  1. CreatePrintQueueItem – This is used to create print queue instance by taking PDF binary content as an input. Here is the signature:

PrintUUID = OutputManagementUtilities.CreatePrintQueueItem(<userAccountID>,<DocumentName>,<No. Of Copies>,<PDF binary Content>,<Print Queue ID>);

  1. Create print queue instance by taking the form template code , country , language , XML data (binary content) etc. as an input. PDF binary content will be created internally based on the template(Determined based on the input like country,language,form template code etc..) and the XML data.

PrintUUID = OutputManagementUtilities.CreatePrintQueueItemWithFormTemplate(<userAccountID>,<DocumentName>,>,<Print Queue ID>,<No. Of Copies>,<XML data binary content>,<formTemplateCode>,<lang>,<country>,<companyID>,<orgUnit>,<channelType>);


HTH,

    Horst

Rudhra
Participant
0 Kudos

Dear Horst Schaude,

We have created the Form template and Preview button is configured in the QA screen,

Currently our customer requirement is to generate the automatic printing from other business object. i.e from other business object we need to perform the preview action.

we  found out one library function but unable to process it. help me to solve this 

PrintUUID = OutputManagementUtilities.CreatePrintQueueItemWithFormTemplate(<userAccountID>,<DocumentName>,>,<Print Queue ID>,<No. Of Copies>,<XML data binary content>,<formTemplateCode>,<lang>,<country>,<companyID>,<orgUnit>,<channelType>);


Help me how to use this function.

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Rudhra,

What exact is the issue?

Bye,

   Horst

Rudhra
Participant
0 Kudos

Dear Horst,

Without performing the action button , from the script we need to do the printing.

For example :

once the status is released, automatically printing need to perform.

rudhra

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Rudhra,

Okay. And what is the issue with the function? Parameter?

Bye,

   Horst

Rudhra
Participant
0 Kudos

Dear Horst,

i have tried the same but somehow unable to succeed,

My code below

error while run the code

regards

Rudhra

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Rudhra,

Is the the UserAccountID 999994 valid?

How did you determine it?

Bye,

   Horst

Rudhra
Participant
0 Kudos

Dear Horst ,

Fred help to solve that problem but now im facing this isssue

I tired as the same and currently the scripting is successfully passed.

but no result in the printing

There is no Queued document,

Regards

Rudhra

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Rudhra,

To make the discussion not more compley than it is already , I suggest to follow-up in Fred's document.

Bye,

   Horst

Former Member
0 Kudos

Hi Horst,

I am in big trouble.

1) Single-select printing is working fine. But multi-select printing is giving UI dump.

2) When I select C1 and click Print twice, it is giving UI dump also.

I used this - OutputManagementUtilities.CreatePrintQueueItem(userAccountID,PDF2.fileName,1,PDF2,"MCS_Default");

Best Regards,

Fred

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Fred,

How do you achieve the"multi-select" printing?

Reg. "Click Print twice": Did you tried to wait for 2 seconds, 5 seconds, 10 seconds, ...?

I can imagine that the queue is busy.

Of course that should be fetched inside the function.

Bye,

   Horst

Former Member
0 Kudos

Hi Horst,

The BO Action is added to OWL as usual (bound with data list).

A normal BO Action works fine for multiple selection for we added a lot in the past.

I might probably wait for 1 or 2 seconds before clicking twice.

I am going to have a net meeting with SAP for the issue today.

Hope this can be solved.

Best Regards,

Fred

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Fred,

I'll wait for an update.

Bye,

  Horst

former_member187171
Participant
0 Kudos

Hello Fred, I am very interesting for your case to print multi selections. Could you tell more about your case please? Thanks a lot. Br Misher

Former Member
0 Kudos

Hi Misher,

As I wrote here , we can send the PDF of the single-selected row the print queue.

Multi-selected rows should also work fine. But unfortunately, there are some issues with the reuse function. We had a net meeting with SAP yesterday. They seem to have figured out the cause but it will take a while to fix it.

Best Regards,

Fred