Friday 7 August 2020

Logic of default attribute at Dispute Case creation screen

Users can create a dispute case in the FI document display mode like FB03 or FBL5N by including the document displayed in the dispute case and assign the dispute case to a processor. Dispute case attributes like Processor and Responsible person will be populated automatically at the creation screen, it’s SAP standard.

In this article, I will show the key function module been used to fetch those dispute attributes to better understanding the FSCM mechanism and answer user query or enhancement preparation.

SAP ABAP Tutorial and Materials, SAP ABAP Exam Prep, SAP ABAP Learning, SAP ABAP Prep

Key functions involved in dispute creation


The Function Code triggered at PAI(User command) for the dispute case creation button at FBL5N is ‘ +CUS05‘.

SAP ABAP Tutorial and Materials, SAP ABAP Exam Prep, SAP ABAP Learning, SAP ABAP Prep

The main function module to create a dispute case is: “FDM_AR_DOC_DISPUTE_BUILD”. It will use FUNCTION ‘FDM_AR_DOC_UI_PREPARE’ to get a dispute data from UI (for current example which is FBL5N) as lt_dispute_data_ui and put it into FM: ‘FDM_AR_DOC_UI_PERFORM’ to fetch other attributes like the processor.

SAP ABAP Tutorial and Materials, SAP ABAP Exam Prep, SAP ABAP Learning, SAP ABAP Prep

Inside FM: ‘FDM_AR_DOC_UI_PERFORM’, it calls another key FM: “FDM_AR_UI_DISPUTE_CREATE” to decide to create a new dispute or copy from another dispute.

SAP ABAP Tutorial and Materials, SAP ABAP Exam Prep, SAP ABAP Learning, SAP ABAP Prep

Here gs_cdis_dispute–dispute_ref is an object refer to class cl_dispute_data_ui. It has one attribute called GS_DISPUTE contains Data for the UI Create/Change Disputes in AR. It refers to structure FDM_AR_DISPUTE_UI.

SAP ABAP Tutorial and Materials, SAP ABAP Exam Prep, SAP ABAP Learning, SAP ABAP Prep

Logic to fetch Dispute attributes like processor


The field attribute is a table type that contains all the attributes value and populated by method “CONSTRUCTOR” of cl_dispute_data_ui. You can find it stored at ls_dispute_data at FM: FDM_AR_UI_DISPUTE_CREATE.

SAP ABAP Tutorial and Materials, SAP ABAP Exam Prep, SAP ABAP Learning, SAP ABAP Prep

Here we can find the big FM ‘FDM_AR_CUST_GET_ALL_DEFAULTS’ to get attributes including case type, Category, Status, Reason code, Priority, External Reference, Processor, Coordinator, Responsible, planned end date, Case Title, etc.

SAP ABAP Tutorial and Materials, SAP ABAP Exam Prep, SAP ABAP Learning, SAP ABAP Prep

Take the field ‘processor’ as an example it uses function module  ‘FDM_AR_CUST_GET_DEF_PROCESSOR’ to fetch default processor.

◉ get the accounting clerk number from KNB1/LFB1 by BP number and company code accordingly;
◉ get the user name from T001S as a processor by company code and accounting clerk number.

Also, we can find the BADI: FDM_AR_DEF_PROCESSOR(Customer-defined default values for the processor) will be check and called if implemented.

No comments:

Post a Comment