有客户提出需求,在为采购订单预制发票时,进行检查,对于采购订单行项目 Account Assignment Category (科目分配类别) 是 Y(3rd Party W/O SN), 如果 Deliv. Compl. (交货已完成) 未被勾选,此时用 MIRO 开票需要提示报错:收货未完成,不能开票。 本文即对该需求展开分析,探索解决方案。 如果没有果 Deliv. Compl. 未被勾选,此时用 MIRO 开票需要提示报错 解决方案: 尝试通过自定义逻辑,写一个 BAdI 来满足需求。 分析步骤: 1. 以前也帮助处理过客户的一个关于开票的需求,因此我们这次需要用到的增强逻辑和之前的一样。参见这篇 Blog :在 SAP S/4HANA Cloud 中通过自定义逻辑检查预制发票的付款条件与供应商主数据中的付款条件是否一致 | SAP Blogs 首先,我们需要在 SAP S/4HANA Cloud 系统的应用 – 自定义逻辑里,新增增强实施。根据业务场景,选择下图中的业务上下文以及业务加载项描述,填写好实施描述以及实施标识。 新增增强措施 2. 在自定义逻辑里新增增强实施完成后,我们需要找到一个字段来获取采购订单的 Account Assignment Category 和 Deliv. Compl. ,我们需要在 CDS Views 里进行查找和检索。I_PURCHASEORDERITEMAPI01 这个 CDS View 里有助于检索采购订单行项目的详细信息,其中我们可以找到字段 ACCOUNTASSIGNMENTCATEGORY ,这个字段即 Account Assignment Category ,我们要判断这个字段是不是 Y 。字段 ISCOMPLETELYDELIVERD ,这个字段就代表了 MIRO 中的 Deliv. Compl. 字段。 3. 目前需要作为判断条件的字段都已经找到了,但我们还需要作一个主数据和....

有客户提出需求,通过自定义的增强,达到采购订单收货后就不允许更改价格。本文即对该问题展开分析,探索解决方案。 解决方案: 尝试通过自定义逻辑,写一个 BAdI 来满足需求。 分析步骤: 1. 首先,我们需要在 SAP S/4HANA Cloud 系统的应用 – 自定义逻辑里,新建增强实施。根据业务场景,选择下图中的业务上下文以及业务加载项描述,填写好实施描述以及实施标识。 新增增强措施 2. 在自定义逻辑里根据本问题涉及业务上下文完成新建增强实施后,我们需要找到字段获取采购订单的价格。此外,根据问题中的需求,我们还需要获取采购订单的发货状态。 通过在 CDS Views 里的检索,没有能够找到一个字段可以帮助我们直接获取采购订单的发货状态。但是,我们可以通过 I_PURCHASEORDERHISTORYAPI01 这个 CDS View 来间接帮助我们判断一个采购订单是否已经发货。如果一张采购订单有 item 已经发货,该 CDS View 里会对该采购订单的对应的 item 生成一条记录。那么只要我们使用采购订单的单号在该 CDS View 里进行检索,如果返回的记录数不为 0 ,则代表采购订单已经有发货。那么,我们可以写出我们关于采购条件发货状态的判断语句。 select count(*) from I_PurchaseOrderHistoryAPI01 with privileged access where PURCHASEORDER = @PURCHASEORDER-PURCHASEORDER into @data(ls_PO_NUM) . if ls_PO_NUM ne '0'. ... endif. 接下来就是获取价格,以及完成数据的匹配。由于采购订单的价格存储在行项目里,而相关增强针对的业务上下文是采购凭证,因此我们需要使用 loop 语句循环读取 PURCHASEORDERITEM 表,从中获取采购订单行项目的价格,对应字段为 NETAMOUNT 。与销售订单不同的是,并没有一个字段可以表示整个采购订单的净值,我们只能获得每个 item....

问题背景: 有客户提出需求,采购订单在触发审批后,如果在审批中的状态,希望采购订单不可被更改。 解决方案: 尝试通过自定义逻辑,写一个 BAdI 来满足需求。 分析步骤: 1.  首先,我们需要在 SAP S/4HANA Cloud 系统的应用 – 自定义逻辑里,新增增强实施。根据业务场景,选择下图中的业务上下文以及业务加载项描述,填写好实施描述以及实施标识。 新增增强措施 2. 在自定义逻辑里新增增强实施完成后,我们需要找到一个字段来获取采购订单的审批状态,需要在 CDS Views 里找到这样的一个字段。I_PurchaseOrderAPI01 这个 CDS View 包含了采购订单的基本信息。根据字段描述,有两个字段可以帮助我们检查采购订单的审批状态。分别是 ReleaseIsNotCompleted 和 PurchasingProcessingStatus 。 ReleaseIsNotCompleted 字段用来表示“审批尚未完全生效”,有两种情况,为空或者为“X”。但前者表示的情况包括订单未审批、审批完成,后者表示的情况包括订单审批中、审批不通过等。所以单独使用这个字段无法判断订单是否处于审批中。 PurchasingProcessingStatus 字段表示“采购凭证处理状态”,类型为 CHAR ,长度为2,通过一个两位的状态码来标识采购订单。标识码有如下几种: 02 – 未审批 03 – 审批中 05 – 审批完成 08 – 审批不通过 因此,我们可以在 BAdI 里使用 ReleaseIsNotCompleted 和 PurchasingProcessingStatus 这两个字段来共同判断采购订单的审批状态,进而实现需求。 3. 根据以上分析过程,实现 BAdI ,具体代码如下。 if purchaseorder-purchasingprocessingstatus is not initial or purchaseorder-purchasingprocessingstatus is initial. select single * from I_PurchaseOrderAPI01 with privileged access....

问题背景: 有客户提出需求,在为采购订单预制发票时,检查供应商主数据的付款条件。如果预制发票的付款条件与供应商主数据中的付款条件不一致,则发送一条错误信息;如果预制发票的付款条件与供应商主数据中的付款条件一致,预制发票可以保存成功。本文即对该问题展开分析,探索解决方案。 解决方案: 尝试通过自定义逻辑,写一个 BAdI 来满足需求。 分析步骤: 1. 首先,我们需要在 SAP S/4HANA Cloud 系统的应用 – 自定义逻辑里,新增增强实施。根据业务场景,选择下图中的业务上下文以及业务加载项描述,填写好实施描述以及实施标识。 新增增强措施 2. 在自定义逻辑里新增增强实施完成后,我们需要找到一个字段来获取供应商主数据中付款条件这个字段,我们需要在 CDS Views 里进行查找和检索。I_SupplierCompany 这个 CDS View 包含了我们可以获取供应商的一些字段信息。根据字段描述,字段 paymentterms 可以帮助我们获取供应商的付款条件。 同时我们需要将“该 CDS View 里的 supplier 字段等于预制发票数据的 invoicingparty 字段”作为查询条件,这样才能正确的取到采购订单对应的供应商主数据中的付款条件字段。另外,由于这个 BAdI 在保存发票时都会被触发,为了防止在冲销过程中也触发该 BAdI ,我们可以在判断条件里添加一条对字段 reversedocument 的判断。该字段代表冲销凭证编号,当进行发票预制时,该字段为空值。所以将其也作为一条判断条件添加到 BAdI 里。 3. 根据以上分析过程,实现 BAdI ,具体代码如下。 if headerdata-companycode is not initial or headerdata-companycode is initial. select single * from i_SupplierCompany with privileged access where....

Before creating the workflow definitions in the system, be ready with the list of approvers whom can process the workflow tasks. This blog post describes about how you can enable the approvers and assign them to people picker(agent list) present in the workflow definition. Firstly, we should understand how the employees are maintained in the....

Hi! In this blog post, we will see how to calculate the accumulative sum using ABAP CDS views without using any AMDP function implementation. First, let us see an example of cumulative amount figures by Calendar Year and Calendar Month. Calendar Year Calendar Month Amount Cumulative Amount 2022 JAN 10000.00 10000.00 2022 FEB 12000.00 22000.00....

As of SAP S/4HANA Cloud 1902 email notifications concerning approval results can be sent to the workflow initiator however with SAP S/4HANA Cloud 2111 release the Purchase Order workflow supports Configurable Email Notifications at the end of the workflow providing the possibility to choose an outcome of when an email will be sent, an associated....

Introduction In this blog, the steps outlined for configuring and executing ‘Supplier Advance Return Management process in S/4HANA’. This will help users to configure advance return management and execute, monitor in S/4HANA Environment. The Business user can effectively monitor the complete return process cycle end to end and take corrective measures. The system can be....

The Rework feature in purchase requisitions provides approvers with an option to send back  requisitions to requestors for rework. Requestors can then make the required changes in the requisition and resubmit. This blog post briefly outlines the various configurations and steps involved in the rework process of a purchase requisition. Let us now see an example of....

Welcome to the Q2 2021 product update of the intelligent Cloud ERP series, where we share insightful information on how technologies such as robotic process automation or machine learning transform an ERP to an intelligent ERP. This series enables you to fully understand how the end-to-end integration between different SAP solutions makes you run with a....

Innovation in Procurement: Making All the Right Connections on a Single Platform  Although the primary function is as old as the concept of “running a business,” procurement has maintained an existence rooted in making connections and establishing relationships. Seeking out the right materials from the most reliable suppliers at the best price has always been....

Welcome SAP procurement stakeholders, this blog provides insights on SAP S/4HANA Cloud release 2008 for Sourcing & Procurement. In case you do not need all the information below and just briefly want to get an overview on the release highlights, please watch this video: Before we start with the details, I would like to encourage....

The following document includes frequently asked questions related to workflows in purchase order: Section 1: “An exception was raised” error message appears while saving a purchase order.  Q1.  Why is an exception raised while saving a purchase order save?  Reason 1: Workflows are very old  Solution: Copy the old workflows to new workflows. Deactivate, and delete the old workflows. Hierarchy must be maintained correctly while activating the new workflows. ....

Recently, I had the opportunity to participate in a couple of SAP S/4HANA transformation workshops with one of our largest and most advanced customers in Regulated Industries.  If you’ve ever had the chance to work with a client in the Aerospace & Defense industry, you may already be aware of this.  It comprises a lot....