Friday, 30 July 2021

Output Management: adding contact person to Billing Document form in SAP S/4HANA Cloud

Introduction

One of the popular requirements in terms of adjusting output forms is to add contact person to the document header. In Billing Documents, for example, there is no such default field, therefore custom field and logic are necessary. In most cases we can use name of employee, who created the document as contact person name. Let´s have a look, how to implement this requirement in Invoice form.

Create Custom field

First of all we need to use “Custom Fields and Logic” app and add new custom field there:

SAP S/4HANA Cloud, SAP HANA Exam Prep, SAP HANA Learning, SP HANA Tutorial and Material, SAP HANA Preparation, SAP HANA Guides, SAP HANA Career, SAP HANA Study Material

Enter custom values in Label and Tooltip and select “Sales: Billing Document” as context and “Text” as “Type”:

SAP S/4HANA Cloud, SAP HANA Exam Prep, SAP HANA Learning, SP HANA Tutorial and Material, SAP HANA Preparation, SAP HANA Guides, SAP HANA Career, SAP HANA Study Material

Then click “Create and Edit”.

Enable the field for UIs and Reports “Billing Document Object Page” and “Change or Display Billing-Related Documents (Header)”:

SAP S/4HANA Cloud, SAP HANA Exam Prep, SAP HANA Learning, SP HANA Tutorial and Material, SAP HANA Preparation, SAP HANA Guides, SAP HANA Career, SAP HANA Study Material

Make sure the field is enabled for Customer Invoice Standard Forms in the Form Templates tab:

SAP S/4HANA Cloud, SAP HANA Exam Prep, SAP HANA Learning, SP HANA Tutorial and Material, SAP HANA Preparation, SAP HANA Guides, SAP HANA Career, SAP HANA Study Material

Save and publish the changes:

SAP S/4HANA Cloud, SAP HANA Exam Prep, SAP HANA Learning, SP HANA Tutorial and Material, SAP HANA Preparation, SAP HANA Guides, SAP HANA Career, SAP HANA Study Material

Wait until the field will be published:

SAP S/4HANA Cloud, SAP HANA Exam Prep, SAP HANA Learning, SP HANA Tutorial and Material, SAP HANA Preparation, SAP HANA Guides, SAP HANA Career, SAP HANA Study Material

Create custom logic


Go to the main screen of the app and then to Custom Logic:

SAP S/4HANA Cloud, SAP HANA Exam Prep, SAP HANA Learning, SP HANA Tutorial and Material, SAP HANA Preparation, SAP HANA Guides, SAP HANA Career, SAP HANA Study Material

Click “+” sign, select “Sales: Billing Document” as context:

SAP S/4HANA Cloud, SAP HANA Exam Prep, SAP HANA Learning, SP HANA Tutorial and Material, SAP HANA Preparation, SAP HANA Guides, SAP HANA Career, SAP HANA Study Material

Select “Billing Standard Output Header Adaption”:

SAP S/4HANA Cloud, SAP HANA Exam Prep, SAP HANA Learning, SP HANA Tutorial and Material, SAP HANA Preparation, SAP HANA Guides, SAP HANA Career, SAP HANA Study Material

Add custom implementation description and click “create“.

In the code editor window enter following code, replacing custom field name by your own:

billingdoc_extension_out = billingdoc_extension_in.
billingdocdescr_extension_out = billingdocdescr_extension_in.

DATA: ls_user TYPE I_BusinessUser.

   SELECT  SINGLE  *
         FROM   I_BusinessUser
         INTO  @ls_user
         WHERE I_BusinessUser~UserID =   @billingdoc-createdbyuser.
billingdoc_extension_out-<your custom field name>_bdh = ls_user-PersonFullName.

Click test -> save draft -> publish. Wait until the logic is published.

Implementing the field in Billing Documents form


Now we need to implement our field in Billing Document form.

Once you opened the custom form in Adobe Livecycle designer go to Data View tab. You will find 2 new fields there:

SAP S/4HANA Cloud, SAP HANA Exam Prep, SAP HANA Learning, SP HANA Tutorial and Material, SAP HANA Preparation, SAP HANA Guides, SAP HANA Career, SAP HANA Study Material

You need the one, which end with “BDH”. Drag and drop it to the necessary place in the document. You can adjust placing of the field on Hierarchy tab.

Select the newly added field go to Object -> Binding and check, if the binding remained correct:

SAP S/4HANA Cloud, SAP HANA Exam Prep, SAP HANA Learning, SP HANA Tutorial and Material, SAP HANA Preparation, SAP HANA Guides, SAP HANA Career, SAP HANA Study Material

Save the changes and upload the new form to SAP S/4HANA Cloud.

No comments:

Post a Comment