Symptom
In SAP S/4HANA Cloud Public Edition, the quality certificate form template QM_QUALITY_CERTIFICATE_FORM doesn't support extensibility. This means the data source FDP_QC_QUALITY_CERTIFICATE_SRV cannot be extended via Data Source Extension, and at the same time, a custom field cannot be added to the form template in Custom Fields.
However, the pre-delivered content in the form template sometimes cannot meet the requirements of the real business. Additional content needs to be printed on the certificate.
In this article, you will get a brief introduction on how to solve this problem using BADI QM_QCERTIFICATE_OUT_MODIFY.
*Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental.
Environment
SAP S/4HANA Cloud Public Edition
Cause
Form template QM_QUALITY_CERTIFICATE_FORM doesn't support extensibility but business requires more content to be printed.
Resolution
Users can print additional content on the quality certificate following these steps:
1. In Custom Logic app, create a new implementation for BADI QM_QCERTIFICATE_OUT_MODIFY.
Make the code as below to fetch the inspection lot long text (as an example) into the changing parameter of the BADI. This is just an example where you fetch a single entry. In case you need to fetch multiple entries from the database, please make sure that they can be distinguished by the system. Please see more details in the "See Also" section of this article.
Save and publish the implementation.
2. In Maintain Form Templates app, choose 'QM_QUALITY_CERTIFICATE_FORM' under 'Predelivered Templates' tab.
Copy it, then go to 'Custom Templates' tab and choose your new copy. Download it without Form Master and store the file locally.
3. Open the local file in Adobe Lifecycle Designer. Add a field in the template, binding it with the long text we just fetched in the BADI. The data path is $record.QualityCertificateNode.QltyCertReadCustomCntntNodeSet.QltyCertReadCustomCntntNode[*].QltyCertFreeDefinedText.
Then upload it in your copied custom form template.
4. In SSCUI 102313 - Assign Form Templates, assign the custom form template to output type QUALITY_CERTIFICATE.
5. In Output Parameter Determination app, select your new form instead of the SAP standard one.
6. Select an inspection lot and maintain the long text for it.
Preview the quality certificate in Manage Quality Certificates for Inspection Lots app. We can see that the inspection lot long text is printed.
See Also
Here is the sample code for your reference:
DATA: ls_entity LIKE LINE OF qltycertcustomercontent.
DATA: lv_insp_lot_long_text TYPE string.
DATA: lv_language TYPE sy-langu .
IF qltycertcustomercontentkey-inspectionlot IS NOT INITIAL.
SELECT SINGLE InspectionLotLongText FROM I_InspectionLotLongText WITH PRIVILEGED ACCESS
WHERE InspectionLot = @qltycertcustomercontentkey-inspectionlot
INTO @lv_insp_lot_long_text.
ls_entity-qltycertcstmid = 'InspLotTxt'.
ls_entity-qltycertfreedefinedtext = lv_insp_lot_long_text.
APPEND ls_entity TO qltycertcustomercontent.
CLEAR ls_entity.
ENDIF.
If you need to fetch multiple data, you need to make them distinguished by the system. To achieve this, you can assign different values to the qltycertcstmid entity of BADI exporting parameter, for example KEY1, KEY2, KEY3... Then in the data binding in Adobe LiveCycle Designer, you specify which key should be used for the current field:
$...QltyCertReadCustomCntntNode.[QLTYCERTCSTMID=='KEY1'].QltyCertFreeDefinedText
Keywords
quality certificate, QM_QUALITY_CERTIFICATE_FORM, FDP_QC_QUALITY_CERTIFICATE_SRV, QM_QCERTIFICATE_OUT_MODIFY, extensibility, Custom Fields, Data Source Extension, additional content, inspection lot, Adobe Lifecycle Designer, Maintain Form Templates, Output Parameter Determination , KBA , QM-CA-2CL , Quality Certificates (only QM) (Public Cloud) , How To
Product
Attachments
| Pasted image.png |
| Pasted image.png |
| Pasted image.png |
SAP Knowledge Base Article - Public