
Virtual Elements
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Create RAP based Dispute cases'
define root view entity ZFCSM_DISPUTE_RAP_Root as select from R_DisputeCase
{
key DisputeCaseUUID,
DisputeCaseCoordinator,
DisputeCaseRootCause,
CaseProcessingDeadlineDate,
OriginalAmount,
DisputedAmount,
PaidAmount,
CreditedAmount,
WriteOffAmount,
ManuallyClearedAmount,
DisputeCaseCurrency,
ContactPersonName,
ContactPersonEmailAddress,
ContactPersonPhoneNumber,
ContactPersonFaxNumber,
ContactPersonFaxCountry,
ContactPerson,
Customer,
CompanyCode,
DisputeCaseExternalApplication,
CaseType,
CaseID,
CaseExternalReference,
CaseCreatedBy,
CaseCreatedOn,
CaseLastChangedBy,
CaseLastChangedOn,
CaseClosedBy,
CaseClosedTime,
CasePlannedCloseDate,
CaseProcessor,
CaseResponsible,
CaseTitle,
CaseEscalationReason,
CaseCategory,
CasePriority,
CaseAuthorizationLevel,
CaseStatusProfile,
CaseStatus,
CaseSystemStatus,
CaseReason,
/* Associations */
_AuthLevel,
_CaseAttribute,
_CaseCategory,
_CaseSystemStatus,
_CaseTypes,
_ChangedByContactCard,
_ClosedByContactCard,
_CompanyCode,
_Country,
_CreatedByContactCard,
_Customer,
_DisputeCaseCoordinatorCard,
_DisputeCaseExternalAppl,
_Escalation,
_Individual,
_Priority,
_ProcessorContactCard,
_Reasons,
_ResponsibleContactCard,
_RootCause,
_StatProfile,
@ObjectModel.virtualElement: true
@ObjectModel.virtualElementCalculatedBy: 'ZCL_DISPUTE_NOTES'
cast(' ' as abap.char( 1333 ) ) as note
}
class ZCL_DISPUTE_NOTES definition
public
final
create public .
public section.
interfaces IF_SADL_EXIT .
interfaces IF_SADL_EXIT_CALC_ELEMENT_READ .
protected section.
private section.
ENDCLASS.
CLASS ZCL_DISPUTE_NOTES IMPLEMENTATION.
METHOD if_sadl_exit_calc_element_read~calculate.
LOOP AT it_original_data ASSIGNING FIELD-SYMBOL(<ls_original>).
TRY.
DATA(lv_index) = sy-tabix.
ASSIGN COMPONENT 'DisputeCaseUUID' OF STRUCTURE <ls_original> TO FIELD-SYMBOL(<lv_disputecaseuuid>).
* Check if note types are requested
IF line_exists( it_requested_calc_elements[ table_line = 'NOTE' ] ).
* Get field
ASSIGN COMPONENT 'NOTE' OF STRUCTURE ct_calculated_data[ lv_index ] TO FIELD-SYMBOL(<lv_note>).
IF sy-subrc EQ 0.
DATA : lt_case_note TYPE fdmo_t_case_note_md.
DATA(lo_pr_backend) = cl_fdmo_proc_rec_bl=>get_instance( ).
CHECK lo_pr_backend IS BOUND.
lo_pr_backend->get_case_notes(
EXPORTING
iv_case_guid = <lv_disputecaseuuid>
im_db_read = abap_true
IMPORTING
et_note = lt_case_note ).
ENDIF.
ENDIF.
LOOP AT lt_case_note ASSIGNING FIELD-SYMBOL(<fs_case_note>).
<lv_note> = | { <lv_note> } { <fs_case_note>-HEADER_LINE } { <fs_case_note>-content }| .
ENDLOOP.
CATCH cx_sy_itab_line_not_found INTO DATA(lo_x).
RAISE EXCEPTION TYPE lx_sadl_exit
EXPORTING
previous = lo_x.
ENDTRY.
ENDLOOP.
ENDMETHOD.
METHOD IF_SADL_EXIT_CALC_ELEMENT_READ~GET_CALCULATION_INFO.
LOOP AT it_requested_calc_elements REFERENCE INTO DATA(lo_req_calc_elem).
CASE lo_req_calc_elem->*.
WHEN 'note'.
IF NOT line_exists( et_requested_orig_elements[ table_line = 'note' ] ).
APPEND 'note' to et_requested_orig_elements.
ENDIF.
WHEN OTHERS.
ENDCASE.
ENDLOOP.
ENDMETHOD.
ENDCLASS.
Service Binding UI Preview
BOPF CDS Notes API
Class for the CUD Operations
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
9 | |
7 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
5 |