SAP Financial Supply Chain Management - ERP Q&A https://www.erpqna.com Trending SAP Career News and Guidelines Mon, 29 Jan 2024 11:43:47 +0000 en-US hourly 1 https://wordpress.org/?v=6.8.2 https://www.erpqna.com/wp-content/uploads/2021/11/cropped-erpqna-32x32.png SAP Financial Supply Chain Management - ERP Q&A https://www.erpqna.com 32 32 SAP S/4HANA Finance Advanced Payment Management (APM) in Integration with SAP Multi-Bank Connectivity (MBC) https://www.erpqna.com/sap-s-4hana-finance-advanced-payment-management-apm-in-integration-with-sap-multi-bank-connectivity-mbc/?utm_source=rss&utm_medium=rss&utm_campaign=sap-s-4hana-finance-advanced-payment-management-apm-in-integration-with-sap-multi-bank-connectivity-mbc Mon, 13 Mar 2023 10:56:59 +0000 https://www.erpqna.com/?p=72740 It integrates with other areas within SAP S/4HANA such as In- House Bank, In-House Cash, Cash Management, Bank Communication Management, Bank Account Management and General Ledger.

The post SAP S/4HANA Finance Advanced Payment Management (APM) in Integration with SAP Multi-Bank Connectivity (MBC) first appeared on ERP Q&A.

]]>
Advanced payment management allows you to centralize all payment activities of a corporate group. Advanced payment management supports five payment scenarios: Internal payments, payments ‘in name of’ with forwarding only, payments ‘in name of’ with routing optimization, payments ‘on behalf of’ and central incoming payments.

It integrates with other areas within SAP S/4HANA such as In- House Bank, In-House Cash, Cash Management, Bank Communication Management, Bank Account Management and General Ledger.

As organizations scale up, there is significant increase in payment volumes and hence need to automate, streamline, optimize the end-to-end payment process across the entire group. Headquarter need the centralization of the payment approval and monitoring for subsidiaries by using a single source of truth. They need the ability to handle different payment formats centrally and automate the routing of payments to different financial institutes.

The system uses Bank Account Management to determine the bank account to be used, triggers approval through Bank Communication Management and once approved creates the external medium for transmission to the bank using Multi Bank Connectivity.

SAP S/4HANA Finance for advanced payment management provides centralized payment factory to manage payments from various systems – SAP, non-SAP and manual payments.

In this blog we are majorly focusing on the scenario payments ‘in name of’ with forwarding only and its basic configuration.

In this scenario, we want to consume a file based payment instruction in advanced payment management and send it to the bank via Multi-Bank Connectivity.

In the following I will describe the available configuration which is used for this scenario as well as the master data which needs to be created to support the scenario.

Define Clearing Areas

SPRO–>Financial Supply Chain Management–>Advanced Payment Management–>Basic Configuration–>Organization–>Define Clearing Areas

Clearing areas act as an org object under the client level. Users working in one clearing area do not have access to data in other clearing areas. One clearing Area we can make work for multiple company codes with different currencies.

Maintain Generic Number Ranges

SPRO–>Financial Supply Chain Management–>Advanced Payment Management–>Basic Configuration–> Maintain Generic Number Ranges

The number range numbers are assigned to diverse number range objects in advanced payment management. A number range object is uniquely identified by its name, and you can assign a number range number starting with 01 and an end value of 99.

With the number range numbers defined here you can customize the number ranges for the following objects:

  • /PF1/COLL: Number Range Object for Collectors > Not used in the Project.
  • /PF1/CSTID: Customer IDs for service level agreements > Not used in the Project.
  • /PF1/FH_OL: Number Range Object List Number (Secondary Key)
  • /PF1/PO_PI: Number range for Payment Transactions (Secondary Key)
  • /PF1/PO_PO: Number range for Payment Order (Secondary Key)
  • /PF1/PO_RE: Number range Object for Recalls > not used in this Project.

Maintain Number Ranges for Payment Orders

SPRO–>Financial Supply Chain Management–>Advanced Payment Management–> Payment Processing–> Business Objects–> Payment Order–> Maintain Number Ranges for Payment Orders

A clearing area always requires a payment order number range before payment orders can be processed in that clearing area. The payment order number is then populated in the Input Manager. You create a payment order number range for payment orders and define whether or not the payment order number is assigned internally by the system.

Define Payment Order Types

SPRO–>Financial Supply Chain Management–>Advanced Payment Management–> Payment Processing–> Business Objects–> Payment Order–> Define Payment Order Types

Payment order types are defined for both incoming and outgoing payment orders. Every payment order needs exactly one payment order type.

The payment order types that are defined here are assigned to incoming & outgoing payment orders by format converters.

The payment order tells the system what checks to carry out on the payment order and its components.

While payment order categories are delivered as part of advanced payment management, payment order types can be used as incoming or outgoing order.

Maintain Number Ranges for Payment Items

SPRO–>Financial Supply Chain Management–>Advanced Payment Management–> Payment Processing–> Business Objects–> Payment Item–> Maintain Number Ranges for Payment Items

If the payment item numbers are assigned internally then they are assigned incrementally. Customizing allows you to set the lower and upper limits for a payment item number. The last number to be assigned is also visible in this activity.

Define Transaction Types

SPRO–>Financial Supply Chain Management–>Advanced Payment Management–> Payment Processing–> Business Objects–> Payment Item–> Define Transaction Types

The transaction types are assigned attributes that determine the processing of payment items. They can determine whether the amount is a credit, or a debit and which validations should be carried out during posting.

  • Originator: – An item posted to the party initiating the payment order. (Company Code)
  • Recipient: – An item posted to the party receiving the payment. (Beneficiary Vendor/ Customer)
  • Clearing: – A special category of payment item used for internal posting. During the clearing process, a clearing item is generated either when a payment batch is closed or when a single payment order is forwarded. For clearing batches, the clearing item is posted on the bank clearing (nostro) account. For internal batches, the clearing item is posted on the customer account.
  • Turnover: – A special category of payment item that does not have an ordering party or recipient characteristics. Turnover items are usually generated by internal settlement systems, for example, when security transactions are handled or interest is calculated.

Assign Transaction Types to Order Types

SPRO–>Financial Supply Chain Management–>Advanced Payment Management–> Payment Processing–> Business Objects–>Payment Item–> Assign Transaction Types to Order Types

The relationship between payment order type and its allowed transaction types. The Order and Repair user interface uses this information to display allowed transaction types.

Define Rules for Bank Communication Management

SPRO–>Financial Supply Chain Management–>Advanced Payment Management–> Payment Processing–> External Interfaces–> Bank Communication Management (BCM)–> Define Rules for Bank Communication Management

Maintain the Bank Communication Management (BCM) rule IDs that are used in BCM workflow configuration for payments that are passed from advanced payment management. You can map it based on order type, Company Code, House bank & Account ID

SetUp Converter

SPRO–>Financial Supply Chain Management–>Advanced Payment Management–> Payment Processing–> External Interfaces–> File Handler–> Basic Configuration–> Set Up Converter

Maintain the format in which data is passed into and out of advanced payment management. The format describes the structure of the fields and records of the payment objects that are used in advanced payment management.

Define Media

SPRO–>Financial Supply Chain Management–>Advanced Payment Management–> Payment Processing–> External Interfaces–> File Handler–> Basic Configuration–> Define Media

You maintain the medium used to deliver data to and from advanced payment management. The medium along with the channel and the format defines a converter.

Define Channels

SPRO–>Financial Supply Chain Management–>Advanced Payment Management–> External Interfaces–> File Handler–> Basic Configuration–>Define Channels

The channel used to deliver data to advanced payment management

SPRO–>Financial Supply Chain Management–>Advanced Payment Management –>External Interfaces–> File Handler–> Basic Configuration–> Define Converter(new)

Define Inbound Converter

A converter is represented by the combination of 4 attributes. Format, medium, channel and direction are linked with a conversion program, which is responsible for interpreting the data and translating it into the required target data structure or file format.

If the file to be imported is a standard XML file, we would use the standard inbound conversion of the XML conversion framework. Its class is /PF1/CL_IPM_P_XML_FORMAT_CONV, however you do not have to enter the class, it would be derived automatically.

If Schema and tag validation was already done in your source system and if you want forward this format without any change or validation than it is recommended to use the flag ‘Forwarding’. it is recommended to use the class /PF1/CL_IPM_FORWARD_PAIN1. The partial reaction is not possible always processing happen at file level.

If you are using the Multi-Bank Connectivity (MBC) local routing functionality than it not required to configure the Directory logical file Name & Logical File ( in this scenario we are using the MBC local routing)

Note:- If you are not using the MBC local routing functionality than it is mandatory to configure the Directory logical file Name & Logical File.

For the outgoing Payments I am using the order type”000200” for Clearing area SAP001 in below screen shot which I configure.

For the outgoing Payments I am using the XML Message Identifier as “/ISO_PAIN.001.001.03” for order type “000200” in below screen shot which I configure.

PAIN.001.001.03 Message Type Inbound Handler with Help of MBC and F110 Automatic payment program

We are assigning the Incoming order type is assigned to Converter ID as per the above Screen Shot. The Order type we are assigned it to Transaction type at clearing area level.

  • Originator: – An item posted to the party initiating the payment order. (Company Code)
  • Recipient: – An item posted to the party receiving the payment. (Beneficiary Vendor/ Customer)

Define Outbound Converter

A converter is represented by the combination of 4 attributes. Format, medium, channel and direction are linked with a conversion program, which is responsible for interpreting the data and translating it into the required target data structure or file format

the converters map the data received from the source system to advanced payment management meta format in the Output Manager (OPM)

If we are using XML conversion framework Converter class for outbound file based conversion it is standard class which we use the configuration /PF1/CL_OPM_P_XML_FORMAT_CONV,

If Schema and tag validates already done in your source system and if you want forward same format without any change or validation than it is recommended to use the Class in the configuration /PF1/CL_OPM_FILE_FORWARD_CONV

we are using the Multi-Bank Connectivity (MBC) than it not required to configure the Directory logical file Name & Logical File ( in this scenario we are using the MBC local routing)

we using the Multi-Bank Connectivity (MBC) than it is mandatory to configure the Class “/PF1/CL_OPM_OUTPUT_STREAM_MBC” or it will not create out file which we needs send it bank.

Note:- If you are not using the MBC functionality than it is mandatory to configure the Directory logical file Name & Logical File. It recommended to configure the class /PF1/CL_OPM_OUTPUT_STREAM_FILE, if you not configured also by default it will pick up the class as /PF1/CL_OPM_OUTPUT_STREAM_FILE

Maintain Routing Settings for Outbound Messages

SPRO–> Multi-Bank Connectivity Connector–> Routing and Connectivity–> Maintain Routing Settings for Outbound Messages

In case of local routing, an outgoing message is not sent to SAP Multi-Bank Connectivity. Instead, a new inbound message is created using the outgoing message. The new inbound message is handed over to the Connector for SAP Multi-Bank Connectivity for inbound processing.

Set Up XML Schema Validation

SPRO–>Financial Supply Chain Management–>Advanced Payment Management–> Payment Processing–> External Interfaces–> File Handler–> XML Framework–> Set Up XML Schema Validation

The XML schema definitions can be used in the IPM/OPM XML Format Converters.

The XML schemas could be used as follows:

  • As a basis template for an XML converter implementation. For more information, see Message Identifier for an XML Converter.
  • As a rule set for an individual schema validation of XML files. For more information, see Identifier of an XML message that defines an XML schema definition (XSD).

In the standard system, some standard XML schema definitions are available for implemented converters. If required, you can update these schemas with adjusted versions. The customizing table is protected against SAP updates. SAP is allowed to insert new entries only.

  • Choose Upload to upload a new XSD file from your local PC.
  • The following data has been entered to have the ISO_PAIN.001.003.03 in the system available:
  • Choose Upload XSD File to store this schema definition in the Customizing table.
  • Depending on the standard client transport settings, you may need to create a transport request.

The Customizing transaction enables you to display each schema definition in a detail tree view with the different types of validations (for example, patterns or digits) for each node.

Test the XML schema validation on individual XML files by choosing the Test Schema Validation button.

To replace individual invalid XML values and to control errors from the XML schema validation more flexibly, you can use the BAdI: Replacement of Invalid XML Values During Read Access.

Define XML Settings for Format Converter

SPRO–>Financial Supply Chain Management–>Advanced Payment Management–> Payment Processing–> External Interfaces–> File Handler–> XML Framework–> Define XML Settings for Format Converter

the converter implementation from the settings in this Customizing activity. You can either directly assign a specific converter implementation or specify a converter package. Converter packages can provide automatic converter implementation derivation by using the BAdIs listed at the end of this section.

You need to specify the correct converter implementation for output converters. You assign the general XML output converter /PF 1/CL_OPM_P_XML_FORMAT_CONV for your format converter regardless of the XML format. This activity enables you to inform Output Manager of the type of XML format that has to be created.

You can also use the following BAdIs to overrule the customizing settings:

  • BAdI: Derivation of Message ID for XML Input Converter
  • BAdI: Derivation of Message ID for XML Output Converter
  • /PF1/BADI_FH_XML_MSG_IDENT_OPM
  • /PF1/BADI_FH_XML_CONVERTER
  • /PF1/BADIIMPL_FH_XML_IPM_ISO
  • /PF1/BADIIMPL_FH_XML_OPM_ISO
  • /PF1/BADIIMP_FH_SWIFT_IPM
  • /PF1/BADIIMP_FH_SWIFT_OPM
  • /PF1/BADI_BNK_WF_INTEGRATION
  • /PF1/BADI_IMPL_BP_DEFAULT
  • /PF1/BADIIMPL_OPO_PROCESS_BCM
  • /PF1/BADIMPL_PO_XML_MAP_ISO

Maintain Number Ranges for Object List

SPRO–>Financial Supply Chain Management–>Advanced Payment Management–> External Interfaces–> File Handler–> Basic Configuration–>Maintain Number Ranges for Object List

A converter that converts the incoming payment order information into business objects of advanced payment management is determined based on format, medium and channel. One business object that is created is the business object “Object List”

Determine Payment Order Priorities

SPRO–>Financial Supply Chain Management–>Advanced Payment Management –> External Interfaces–> Format Specific Configuration–> ISO20022–> Determine Payment Order Priorities

The determination of the advanced payment management internal priority of payment orders. This information controls, amongst others, the processing frequency and the frequency in which the order status is changed. The priority is determined and assigned to the payment order. In the case the priority cannot be determined for e.g. the respective message field is not filled (optional) a default priority is assigned.

Determine Payment Order Types

SPRO–>Financial Supply Chain Management–>Advanced Payment Management–> External Interfaces–> Format Specific Configuration–> ISO20022–> Determine Payment Order Types

the determination of the internal payment order type. The system uses this control information for certain validation and processing throughout advanced payment management. You define this information in the payment order. The combination of message type and original message type allows the system to distinguish uniquely between credit transfers and direct debit and between -bank-to- bank R-messages (reject/return).

Determine Item Transaction Type

SPRO–>Financial Supply Chain Management–>Advanced Payment Management–> External Interfaces–> Format Specific Configuration–> ISO20022–>Determine Item Transaction Type

the system determines the internal transaction type. You define the transaction type for the payment item in customizing (see below). This control information is used for various validation and processing steps throughout the system.

Assign Exception Handling Reaction to Bank Reject

SPRO–>Financial Supply Chain Management–>Advanced Payment Management–> External Interfaces–> File Handler–> External Status–>Assign Exception Handling Reaction to Bank Reject

he system will use the most specific (bank specific) entry. If no matching entry for the bank is available, the generic entry without bank identifier will be applied.

If no specific reaction type is defined, the ‘ Define Default Reaction Types’ or Master data configuration will be used for the standard error code ‘Bank Reject(002010)’.

Maintain Multi-Bank Connectivity Connector Inbound Settings

SPRO–>Financial Supply Chain Management–>Advanced Payment Management–>External Interfaces–> File Handler–> Multi-Bank Connectivity Connector Integration–> Maintain Multi-Bank Connectivity Connector Inbound Settings

Maintain inbound settings for Multi-Bank Connectivity (MBC) messages received via the Multi-Bank Connectivity Connector. We can configure the Convertor ID based on Sender ID, Receiver ID, Message type and origin ID.

With the help of MBC Local Routing functionality once we ran F110, the XML will be routed with help MBC and handed over to APM

Maintain Multi-Bank Connectivity Connector Outbound Settings

SPRO–>Financial Supply Chain Management–>Advanced Payment Management–> External Interfaces–> File Handler–> Multi-Bank Connectivity Connector Integration–> Maintain Multi-Bank Connectivity Connector Outbound Settings

the outbound settings for sending messages via the Multi-Bank Connectivity Connector to Multi-Bank Connectivity (tenant).

Exception Handling

SPRO–>Financial Supply Chain Management–>Advanced Payment Management–> Exception Handling

the priorities of all existing response types. The response types, regardless of the group, are listed with their respective response type groups in number format and a short and long text description.

Only the response type priority is set in this activity. You do not create or modify any existing information regarding a response type or a response type group.

you can create response types for rejection of payment orders and/or payment items. You assign an existing return reason and a final response type to the new response types.

You can use the dropdown box in the Partial column to specify whether the payment orders are to be rejected in full, or whether only incorrect items are to be rejected, and processing is to continue. If you do not specify a value in this column, the system rejects the payment order in full. You can also specify the correspondence type required in each case.

Payments are running into erroneous situations based on various reasons. Instead of pushing these payments back to the local subsidiary systems the solution allows to fix these errors in a central place, either manually or automatically.

Service Level Agreement

SAP Menu–>Accounting–> Financial Supply Chain Management–> Advanced Payment Management–> Master Data–> Service Level Agreement

Displays options for Enrichment and Validation, Notifications and Charges for which you can define set of rules and restrictions in detail. Mark the relevant checkboxes in the Options section. The corresponding tab pages will be displayed.

Routing Objects

SAP Menu–> Accounting–> Financial Supply Chain Management–> Advanced Payment Management–> Master Data–> Routing Objects

Based on the predefined Business rules such as Incoming order type, Bank Key, Account Number and originator the Route and clearing agreement it will be identified based on clearing area .

We can use all attributes of a payment like amount, currency, country, payment type, priority and additional attributes like time, % distribution of payments

Define payment routing based on business rules (master data)

Route by all attributes of a payment and several special dimensions, e.g.

  • Cut-off times
  • Percentage of business
  • Beneficiary bank
  • Available liquidity
  • Adherence to due date
  • Transaction Currency
  • Payment Scheme compatibility
  • Amount limits
  • Payment Type

Perform rerouting and regrouping of payments

Link payment formats, cut-off times, bank account details, bank clearing account, etc. in one place with central governance and approval processes

End user: Run Automatic Payment – F110

Apart from the Payment run job, MBC FSN job got tiggered automatically and the Small_POP job for the APM file import.

SAP Menu–> Connector for Multi-Bank Connectivity–> /BSNAGT/MONITOR – Connector Monitor

In the below screen shots it has been observed that file has not set out it has been locally routed and handed over to APM

Loge Represents message has been locally routed

When the file is local routed it will show on incoming side

Loge Represents file has been handed over to APM

In the relation ship tab you see the both incoming and out going orders

In the Fiori Notifications you observe the APM batch approval notification which has to be approved

Got the APM (Advanced Payment Management APP’s and select the Manage Payment)

Based on the Selection it is displaying two orders which represents incoming order and Outgoing order based on the

Incoming order is getting created based on MBC Local routing based which file has been handed over to APM

For Each outgoing order it has three Segments Originator, Recipient & General Order Data

Originator: – Sending Company code information , Send bank Account Information, Service level Agreements, route, Clearing Agreements & Process flows

Recipient: – Beneficiary Bank Account details, EndtoEndID , Service level Agreements, route, Clearing Agreements & Process flows

Based on the Incoming order system is processing data and do required data validations in the APM and create the Outgoing order based on that APM batch will the created which will updated in the BNK_MONI (APP, Monitor Payment )

Note:- For Approvals We are using BCM frame work with APM information

For Each outgoing order it has three Segments Originator, Recipient & General Order Data

Originator: – Sending Company code information , Send bank Account Information, Service level Agreements, route, Clearing Agreements & Process flows

Recipient: – Beneficiary Bank Account details, EndtoEndID , Service level Agreements, route, Clearing Agreements & Process flows

Once the APM batch has been Approved with help of BCM Transaction (BNK_APP) or Fiori APP Approve Bank Payments, than an outbound file will be generated which will sent MBC Connector to tenant from their it will be sent to bank.

If you Observe in the below screen shot APM batch status is Approved

The Memo records will get created based Liquidity Management Application Activation in the Clearing area

It Below mentioned screen shot you can observe that APM Batch has been approved and file been generated which will sent MBC Connector to tenant from their it will be sent to bank.

SAP Menu–> Connector for Multi-Bank Connectivity–> /BSNAGT/MONITOR – Connector Monitor

In the below screen shots, it has been observed that file has set out with the help of MBC Connector to tenant from their it will be sent to bank.

Conclusion:

Below are take away points to be considered for this SAP S/4HANA Advanced Payment Management for scenario payments ‘in name of’ with forwarding.

  • Forward payment as is to house bank (no bank account determination – PINO Forwarding)
  • No Accounting will be generated from APM for scenario payments ‘in name of’ with forwarding.
  • Forward payment case we bring the external system payment file and process in APM and we track them centrally.
  • We payment group functionality is available based on the sending company bank key and currency we group the payments at the APM batch level which is available form S/4 HANA 2021.
  • We are able to receive the payment files from external system and able to process centrally in APM.
  • If we are not Using the MBC than for the file import directly from Physical file name directory with help transaction /PF1/FH_IPM_EXPERT – Execute Import Files.
  • If we are not Using the MBC than for the file import from file directory with help of transaction /PF1/FH_IMPORT_DIR – File Directory Import.
  • Cash Management will get updated with the help of APM
  • In APM Following tables will be used for Master data /PF1/DB_CA, /PF1/DB_ROUTE, /PF1/DB_SLA, and /PF1/DB_EOD_DT etc.,
  • In APM Following tables will be used for transaction data /PF1/DB_OLIST, /PF1/DB_ORDER, /PF1/DB_ITEM, /PF1/DB_EXT_STAT, /PF1/DB_ITEM_FI, and /PF1/DB_FH etc.,
Rating: 0 / 5 (0 votes)

The post SAP S/4HANA Finance Advanced Payment Management (APM) in Integration with SAP Multi-Bank Connectivity (MBC) first appeared on ERP Q&A.

]]>
Enhancements in FSCM Dispute Management https://www.erpqna.com/enhancements-in-fscm-dispute-management/?utm_source=rss&utm_medium=rss&utm_campaign=enhancements-in-fscm-dispute-management Mon, 06 Mar 2023 11:46:06 +0000 https://www.erpqna.com/?p=72539 SAP delivered a dedicated component called Dispute Management within FSCM module to manage the differences (i.e., disputes) that arise during clearing of incoming payments & customer invoices. Dispute Management uses the component Case Management as a technical basis to process the dispute cases. The purpose of this post is to explore the enhancement options behind […]

The post Enhancements in FSCM Dispute Management first appeared on ERP Q&A.

]]>

SAP delivered a dedicated component called Dispute Management within FSCM module to manage the differences (i.e., disputes) that arise during clearing of incoming payments & customer invoices. Dispute Management uses the component Case Management as a technical basis to process the dispute cases. The purpose of this post is to explore the enhancement options behind the BADI SCMG_CHNG_BFR_STR_C. This post will focus mainly on the use of this BAdI for management of dispute cases. I’ll provide some recommendations on the architecture of the enhancements and some useful tips how to use the interface of this BAdI efficiently.

Overview of the BAdI interface

This BAdI uses the interface IF_EX_SCMG_CHNG_BFR_STR_C with one method CHANGE. The screenshot below shows the method’s signature:

This BAdI is a generic BAdI within case management framework and it is used in many processes. However, this BAdI can be implemented only once i.e., only one active implementation can exist at a time. The interface uses an importing parameter FLT_VAL to distinguish between various processes that call this BAdI. Typical filter values are:

  • F_DM – for dispute cases.
  • FDCD – for documented credit decision.

Screenshot below shows the implementation of this BAdI:

High-level architecture of the BAdI implementation

If you want to use this BAdI for implementation of custom logic, I’d recommend using the implementing class for this BAdI only as a controller, whereas the main logic should be implemented in separate global classes. Let me clarify what I mean.

BAdI implementing class ZCL_IM_SCMG_CHNG_BFR_ST as is shown below serves only one purpose: it checks the value of the filter and routes the execution to two other global classes: ZCL_IM_SCMG_CHNG_BFR_ST_DC & ZCL_IM_SCMG_CHNG_BFR_ST_DCD. The first class implements custom logic for dispute cases, the second one for documented credit decisions.

What are the benefits of this approach? Main benefit in my opinion is that the enhancement logic is split into separate classes. Each class follows the single responsibility principle and knows how to handle the objects of one type only. This architecture ensures smaller regression impact and means lower maintenance cost in the long run: if you need to adjust the logic for one component (e.g., dispute cases), you can be sure that other functionalities will not be impacted by these changes.

class zcl_im_scmg_chng_bfr_st definition
  public
  final
  create public .

  public section.

    interfaces if_ex_scmg_chng_bfr_str_c .

  protected section.
  private section.

endclass.

class zcl_im_scmg_chng_bfr_st implementation.

* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Instance Public Method ZCL_IM_SCMG_CHNG_BFR_ST->IF_EX_SCMG_CHNG_BFR_STR_C~CHANGE
* +-------------------------------------------------------------------------------------------------+
* | [--->] IM_CASE                        TYPE REF TO IF_SCMG_CASE
* | [--->] FLT_VAL                        TYPE        SCMGPROCESS
* | [!CX!] CX_SCMG_CASE_BADI
* +--------------------------------------------------------------------------------------</SIGNATURE>
  method if_ex_scmg_chng_bfr_str_c~change.

    constants:
      begin of lc_filter,
        dispute_case      type scmgprocess value 'F_DM',
        doc_cred_decision type scmgprocess value 'FDCD',
      end of lc_filter.

    case flt_val.
      when lc_filter-dispute_case.
        zcl_im_scmg_chng_bfr_st_dc=>change_dc( im_case ).
      when lc_filter-doc_cred_decision.
        zcl_im_scmg_chng_bfr_st_dcd=>change_dcd( im_case ).
      when others.
        return.
    endcase.

  endmethod.
endclass.

Screenshots below show how new class for dispute cases was implemented:

Instance of the case as method parameter

If you’re a functional consultant and you analyze the interface of this BAdI for the first time, you might be confused a bit: the method has only one importing parameter IM_CASE and normally you cannot change the parameters of this type. Besides, even if you put a breakpoint in the code and will check the variable IM_CASE in debug mode, you’ll not find a lot of useful details. Screenshot below shows how this parameter looks like during debugging.

The explanation is simple: this method receives an instance of the dispute case. Each dispute case as an instance has certain attributes (i.e., values associated with it) and methods (i.e., actions you can perform in relation to the instance). Let’s see how to access these attributes and what are some useful methods you can use to get / set the values of certain attributes.

Overview of Getter Methods

If you want to check a value of some attribute, you can use the method GET_SINGLE_ATTRIBUTE_VALUE. It will retrieve the current value of the attribute e.g., who is coordinator of the dispute case. Similarly, you can use another method GET_SINGLE_OLD_ATTR_VALUE to retrieve the value of the attribute before it was changed. See two examples below:

try.
  data lv_coordinator type udmcaseattr00-fin_coordinator.
  lv_coordinator = im_case->get_single_attribute_value( 'FIN_COORDINATOR' ).
  catch cx_srm_framework .
  catch cx_scmg_case_attribute .
endtry.

try.
  data lv_previous_coordinator type udmcaseattr00-fin_coordinator.
  lv_previous_coordinator = im_case->get_single_old_attr_value( 'FIN_COORDINATOR' ).
  catch cx_srm_framework .
  catch cx_scmg_case_attribute .
endtry.

The list of fields for these methods is essentially limited by the list of fields in the following two tables:
(1) Generic case attributes i.e., table SCMG_T_CASE_ATTR.
(2) Application specific case attributes: UDMCASEATTR00 – attributes of dispute cases, UKM_DCD_ATTR – attributes of document credit decision etc.

The first table stores common attributes e.g., case type, external reference, administrative details (who created, who changed and when etc.). The second table stores attributes that are specific to a given case type (e.g., dispute case).

Technically speaking, application specific table depends on the settings of the attribute profile associated with your case. You can check out the configuration in the transaction S_SE3_50000032 or maintenance view SCMGVC_ATTRPROF (SM34).

When you are referencing these variables in the code, you can use different approaches. Depending on your project’s rules: you can reference the variable name directly (e.g., RESPONSIBLE); you can use a constant from the interface IF_SCMG_CASE or you can use the case attribute directly.

data lv_responsible type scmg_t_case_attr-responsible.
lv_responsible = im_case->get_single_attribute_value( 'RESPONSIBLE' ).
lv_responsible = im_case->get_single_attribute_value( if_scmg_case=>if_scmg_case_read~responsible ).
lv_responsible = im_case->get_single_attribute_value( im_case->responsible ).

You can review the list of available constants in the interface IF_SCMG_CASE via transaction SE24:

There are a few other standard methods to get certain attributes. For example, there are predefined methods to get case type, creating user, creating date, case GUID, last changing date / user. These methods are useful shortcuts and you do not need to re-invent the logic from scratch.

Here is also a useful tip along the way. It is often necessary to check if BAdI is executed during initial creation of the case or in a change mode. You can do a simple check: get case GUID (i.e., global identifier) and select any attribute (e.g., case type) from the table SCMG_T_CASE_ATTR. When the BAdI is executed during case creation, case GUID is already assigned, but this table is still empty. If the select fails, it means that the BAdI is executed in creation mode.

" We already have a Case GUID at this point, but no entries in DB
data lv_guid type udmcaseattr00-case_guid.
lv_guid = im_case->get_guid( ).

data lv_case_type type scmg_t_case_attr-case_type.
select single case_type
  from scmg_t_case_attr
  into lv_case_type
  where case_guid = lv_guid.

if sy-subrc <> 0.
  " BAdI is executed in creation mode.
endif.

Another common requirement is to check if the case was changed by the user. Why would you need to do that? The answer is quite simple. The enhancement logic is often based on the assumption that the user changes the case, and this action triggers some additional changes (e.g., workflow, e-mail notification, change of some attributes etc.). However, if you simply open the dispute case in change mode via SAP GUI transaction UDM_DISPUTE or via Fiori App F0702A “Manage Dispute Case” and save the case without changing anything, this action will also trigger the BAdI execution. This might lead to some unwanted automatic changes. To avoid that, you can use standard method IS_CHANGED. See sample code below:

" Method definition
class-methods is_changed
  importing
	im_case type ref to if_scmg_case
  returning
	value(rv_yes) type abap_bool.

" Method implementation
method is_changed.

  try.
    if im_case->is_changed( ) = abap_true.
      rv_yes = abap_true.
    endif.
  catch cx_srm_framework .
  endtry.

endmethod.

" Use of the check in the main method
method change_dc.
 
  " Check if dispute case was changed
  if is_changed( im_case ) = abap_false.
    return.
  endif.

endmethod.

Overview of Setter Methods

There is also a setter method that allows you to change the value of case attributes. You can use the method SET_SINGLE_ATTRIBUTE_VALUE to change the value of the case attribute. Source code below shows how to update the value of the case title:

try.
  im_case->set_single_attribute_value(
    im_srmadid = im_case->case_title
    im_value   = 'Case Title: New Value' ).
  catch cx_srm_framework .
  catch cx_scmg_case_attribute .
endtry.

Big advantage of using this BAdI is that you can update many different attributes within the same enhancement. FSCM module provides a lot of different BAdIs that can be used to update only one specific attribute (e.g., case priority, external references, processor etc.). The screenshot below shows the list of these BAdI in the configuration menu. In my opinion, it is better to use one enhancement to manage custom logic for dispute cases vs. many enhancements that update just one attribute. With one central enhancement you save time around administration / documentation of the WRICEFs and have better visibility / control over the enhancement logic.

Links to Disputed Objects

Each dispute case has links to a range of disputed objects including but not limited to a business partner, residual item & customer invoice. See the screenshot below:

These links are stored in the table FDM_DCOBJ. See the screenshot below with sample content of the table:

If you need additional information about disputed object for your enhancement logic, you can implement a utility method within BAdI implementing class that will select the object key and parse it into the accounting document line item. Sample source code for this method is provided below.

" Definition of the global type
types:
  begin of ty_fidoc_key,
    belnr type belnr_d,
    bukrs type bukrs,
    gjahr type gjahr,
    buzei type buzei,
  end of ty_fidoc_key.

" Definition of utility method
class-methods get_related_doc_key
  importing
    im_case type ref to if_scmg_case
    iv_classification type fdm_classification
  returning
    value(rs_fidoc) type ty_fidoc_key.

" Implementation of utility method
method get_related_doc_key.

  data lv_guid type udmcaseattr00-case_guid.
  lv_guid = im_case->get_guid( ).

  data lv_obj_key type fdm_dcobj-obj_key.

  " Get object key of related payment documlent
  select single obj_key
    from fdm_dcobj
    into lv_obj_key
    where case_guid_loc = lv_guid
    and obj_type = 'BSEG'
    and classification = iv_classification.

  " Parse object key into FI document key
  if sy-subrc = 0 and strlen( lv_obj_key ) = 21.
    rs_fidoc-bukrs = lv_obj_key(4).
    rs_fidoc-belnr = lv_obj_key+4(10).
    rs_fidoc-gjahr = lv_obj_key+14(4).
    rs_fidoc-buzei = lv_obj_key+18(3).
  endif.

endmethod.

" Use of utility method in the main method
method change_dc.

  " Get the link to linked case object
  data ls_fidoc_key type ty_fidoc_key.
  ls_fidoc_key = get_related_doc_key(
    im_case = im_case
    iv_classification = fdmco_disp_residual ).

endmethod.

FDMCO_DISP_RESIDUAL – is a global constant defined by SAP for field FDM_DCOBJ-CLASSIFICATION, which is used to denote the residual item. Type group FDMCO stores the whole list of these global constants that can be used in your enhancement:

I’m mentioning this aspect about disputed objects on purpose here. There is one big limitation with regards to this BAdI. When it is executed in creation mode, the GUID of the dispute case is already assigned, but the table FDM_DCOBJ is not filled yet. Therefore, you cannot access these objects during creation of the dispute case, you can access them only in change mode. If you need to access the attributes from the disputed objects during creation of the dispute case, I’d recommend using BAdI FDM_AR_DISP_COMPLETE. This BAdI is execute before SCMG_CHNG_BFR_STR_C and offers many enhancement options. The method COMPLETE_DISPUTE of the BAdI FDM_AR_DISP_COMPLETE has a parameter T_OBJECTS, which stores the list of disputed objects.

Reading of Case Long Texts

Apart from case attributes & disputed objects you might also need to access the case long texts. Before accessing long texts, you need to know the text ID. You can check-out the settings of the text profile associated with the dispute case in the transaction S_SE3_50000056 (or maintenance view SCMGVC_TEXTPROF, SM34). If you do not know which text profile is being used, check out the customizing of the dispute case type in the transaction S_SE3_50000059 (or maintenance view SCMGV_CTYPE_PPF, SM30). See the screenshot of sample text profile below:

You can re-use the FM BDM_DISPUTE_NOTES_GET to fetch the text associated with dispute case. See the sample source code below:

" Get the value of case notes
data ls_return type bapiret2.
data lt_notes  type bdm_t_notes.

call function 'BDM_DISPUTE_NOTES_GET'
  exporting
    im_guid  = lv_guid
  importing
    es_return = ls_return
    et_notes  = lt_notes .

if lines( lt_notes ) = 0.
  return.
endif.

data lv_text type string.
field-symbols <i> like line of lt_notes.
loop at lt_notes assigning <i> where tdobject = 'SCMG_CASE' and tdid = '0001'. " 0001 is a text ID
  " Skip the first line
  if sy-tabix = 1.
    continue.
  endif.
  
" Contcatenate the lines
  if <i>-tdline = '' or <i>-tdline na sy-abcde.
    continue.
  else.
    lv_text = <i>-tdline && lv_text.
  endif.
endloop.

Text data is stored in the table LT_NOTES. The first line from the text should be skipped. This is automatically generated caption for the text.

Note: if you’re using S4 HANA system and the Fiori App F0702AManage Dispute Case” to maintain long texts, it does not generate this technical line. So, there is no need to skip the first line.

Rating: 0 / 5 (0 votes)

The post Enhancements in FSCM Dispute Management first appeared on ERP Q&A.

]]>
Revenue Recognition for Project Sales(Time and Material) in SAP Business ByDesign https://www.erpqna.com/revenue-recognition-for-project-salestime-and-material-in-sap-business-bydesign/?utm_source=rss&utm_medium=rss&utm_campaign=revenue-recognition-for-project-salestime-and-material-in-sap-business-bydesign Sat, 05 Nov 2022 10:22:41 +0000 https://www.erpqna.com/?p=69388 In this blog post I have explained how the Revenue is Recognized for the Revenue type ‘Project Sales(Time and Material)’ when the accrual method is “Recognize at the point of delivery”. Project sales include the sale of project-based services and Material but it does not includes the sale of standardized material and services. Prerequisites Navigate […]

The post Revenue Recognition for Project Sales(Time and Material) in SAP Business ByDesign first appeared on ERP Q&A.

]]>
In this blog post I have explained how the Revenue is Recognized for the Revenue type ‘Project Sales(Time and Material)’ when the accrual method is “Recognize at the point of delivery”.

Project sales include the sale of project-based services and Material but it does not includes the sale of standardized material and services.

Prerequisites

Navigate to Business Configuration > Choose the First Implementation > Click on Edit Project Scope > Under third Step Scoping Make sure that Sell Project-Based Products and Services is in Scope

Figure1:Scoping

Under Fourth step Questions > Enable the question “Do you want to use Solution-Supported Revenue Recognition for sales orders?”.

Figure2:Enable the question

Navigate to Business Configuration > Select the First Implementation > Click on Open Activity list > Search for Accrual Method Determination Activity > Assign the accrual method for the Revenue type Project sales(time and Material) .

Figure3:Accrual method Determination

Process flow

Navigate to Sales order Workcenter > Create a new sales order by entering all the mandatory details . Under items tab add the Project Based Material and Services and click on Save.

Figure4:Create Sales Order

Create a Project from the sales order and ‘Create Project’ field will be enabled only if we add the Project-Based Material and Services in the sales order.

Figure5:Create Project

Enter all the mandatory details and click on ok

Figure6:Enter mandatory details

Project is Created and it is linked to the Sales Order

Figure7:Project is linked to the sales order

Release the Sales Order

Figure8:Release the sales order

Navigate to Project Management workcenter > Open the Created Project > Add the team member and Edit Period Plans for the Service under Work tab.

Figure9:Added team member

Enabled ‘From Stock’ indicator as I’m going to consume it from own stock for the Material under Materials tab.

Figure10:Enabled From Stock indicator

Released the project task

Figure11: Release the Project Task

Created project stock order for the Material under Products tab.

Figure12:Create Project Stock Order

Choose the Ship From Location and click on finish

Figure13:Choose ship from location

Navigate to Outbound Logistics control Workcenter > Search for Created Project Stock Order > Release the Project Stock Order demand

Figure14:Release the Project Stock order Demand

Navigate to Outbound Logistics Workcenter > Delivery Proposal > Search for Project Stock Order > Allocated Material to the Project by clicking on Allocate button.

Figure15: Allocate material to the project

Choose the Source Logistics area and click on Save

Figure16:Choose the Source Logistics area

Navigate to the Project Management Workcenter > Open the created Project >Click on Consume in order to Consume the material to the project

Figure17: Consume the material to the Project

By logging into the Employee user, Edit and release the timesheet for the employee

Figure18:Edit and release the timesheet for the employee

Actual quantity for the material and Service is updated in the Project.

Figure19:Actual quantity for the Material and Service

We can see the Journal entry posted for Internal Service Confirmation and Goods Issue for consumption where Cost of sales of Material and Services are posted to the Deferred Costs account. This account is a balance sheet account, which means that the costs are not yet recognized.

Figure20:Goods issue for consumption
Figure21:Internal Service Confirmation

Navigate to Cost and Revenue Work Center > Search for Sales Order > Execute Revenue Recognition for sales order before doing Customer Invoice and click on ok

Figure22:Execute Revenue Recognition

Enter all the Mandatory Details and click on Ok

Figure23:Enter the Mandatory details

Here we can see the Journal entry, the run posts recognized revenue from the deferred net value account to the sales revenue account and deferred cost of sales account to the corresponding expense accounts.

Figure24:Journal entry for Revenue Recognition

Navigate to Project Management Work Center > Search for Created Project > Create a project invoice request

Figure25:Create Project Invoice request

Propose invoice items using sales order items Under third step, then it will propose the line items which are associated in the sales order.

Figure26:View of Project Invoice Request

Check the project invoice request for consistency, Finish and release it

Figure27:Release Project Invoice Request

Once we release the Project Invoice request, the Customer Invoice Request is automatically created under Invoice Request view of Customer Invoicing workcenter and then Release the Customer Invoice.

Figure28:Release Customer Invoice

Journal entry for customer invoice after revenue recognition ( Service) is posted.

Figure29:Journal entry for customer invoice

Journal entry for customer invoice after revenue recognition (material) is posted.

Figure30:Journal entry for customer invoice

Navigate to Cost and Revenue Workcenter > Sales Document items > Search for Sales Order > Execute the Revenue Recognition after Customer Invoice and click on ok

Figure31:Execute Revenue Recognition

Journal entry for Revenue Recognition after Customer Invoice where “Deferred Revenue” and “Unbilled Receivables” will be cleared when Revenue Recognition is performed subsequently

Figure32:Journal entry for Revenue Recognition
Rating: 0 / 5 (0 votes)

The post Revenue Recognition for Project Sales(Time and Material) in SAP Business ByDesign first appeared on ERP Q&A.

]]>