METHOD Quantity
METHOD Quantity
METHOD Quantity
*****************************************************************************
******
* METHOD Name : GET_ZZEND_DATE
* Author : Mahak Jain
* Date : 25.10.2013
* Developer ID : GBHATIA
* Object Code : E168
*&---------------------------------------------------------------------*
*& Modification History
*&---------------------------------------------------------------------*
*& Date(DD/MM/YYYY) RICEFWID USER ID Change Req. Release
*& 25/10/2013 E168 GBHATIA CRDK901884 Initial versio
n
*&---------------------------------------------------------------------*
* * * *&-------------------------------------------------------------------
------*
*& Date(DD/MM/YYYY) RICEFWID USER ID Change Req. Version
*& 29/10/2014 D8947 SONGOLE CRDK911167 1.1
*& 139/03/2015 D13914 aparnap CRDK918947 1.3
*&-------------------------------------------------------------------------*
* * *& Date(DD/MM/YYYY) RICEFWID USER ID Change Req. Ver
sion
*& 19/03/2015 D13914 SONGOLE CRDK918946 1.3
*& 25/03.2015 D14134/D14069 Songole CRDK919507 1.4
*& 20/04/2015 D15543 nmangal CRDK921421 1.5
*& 24/06/2015 D19980 Songole CRDK925297 1.6
*& 17/07/2015 D20528 JOJYG CRDK926706 1.7
*&-------------------------------------------------------------------------*
* Begin of cahnges by Mahak Jain for copying Requested start date
* from Item Detail page
* DATA: current TYPE REF TO if_bol_bo_property_access.
DATA: dref TYPE REF TO data.
lr_core = cl_crm_bol_core=>get_instance( ).
IF lr_core IS BOUND.
lr_global_messages = lr_core->get_global_message_cont( ).
ENDIF.
* CONSTANTS:lv_temp_value(30) TYPE c VALUE '00.00.0000'. "Commented by n
mangal for D15543 on 20/04/2015
* value =
*'BTAdminI not bound'. "#EC NOTEXT
CLEAR v_itm_num.
CALL METHOD current->if_bol_bo_property_access~get_property_as_string
EXPORTING
iv_attr_name = 'NUMBER_INT'
RECEIVING
rv_result = v_itm_num.
current = current-
>get_related_entity( iv_relation_name = 'BTItemDatesSet' ). "#EC NOTEXT
CHECK current IS BOUND.
* current = current-
>get_related_entity( iv_relation_name = 'BTDatesSet' ). "#EC NOTEXT
* CHECK current IS BOUND.
CALL METHOD current->get_related_entities
EXPORTING
iv_relation_name = 'BTDatesAllCust_SERVICE'
RECEIVING
rv_result = lr_col.
* current = current-
>get_related_entity( iv_relation_name = 'BTDatesAllCust_SERVICE' ). "#EC NOTE
XT
* CHECK current IS BOUND.
IF lr_col IS BOUND.
CLEAR lr_ent.
lr_ent ?= lr_col->get_first( ).
WHILE lr_ent IS BOUND.
* Checking if application type is Customer Begin date
* then getting the corresponding from date
*********************************************************************
* SOC BY JOJY TR : CRDK926706 D20528 DT : JULY/17/2015 *
*********************************************************************
CLEAR v_enddat.
IF lv_value IS NOT INITIAL.
v_enddat = lv_value.
ENDIF.
*********************************************************************
* EOC BY JOJY TR : CRDK926706 D20528 DT : JULY/17/2015 *
*********************************************************************
ENDIF.
ENDIF.
*********************************************************************
* SOC BY JOJY TR : CRDK926706 D20528 DT : JULY/17/2015 *
*********************************************************************
* D20528: In Renewal Quote - Start Date > End Date is allowed by the system
*********************************************************************
* EOC BY JOJY TR : CRDK926706 D20528 DT : JULY/17/2015 *
*********************************************************************
lr_ent ?= lr_col->get_next( ).
ENDWHILE.
ENDIF.
*********************************************************************
* SOC BY JOJY TR : CRDK926706 D20528 DT : JULY/17/2015 *
*********************************************************************
IF v_strtdat > v_enddat.
value = lv_contend_value.
set_zzend_date(
EXPORTING
attribute_path = 'table[1].zzend_date'
iterator = iterator
value = lv_contend_value
).
ENDIF.
*pass date value
IF current IS BOUND.
lr_parent = current->get_parent( ).
IF lr_parent IS BOUND..
lr_parent-
>get_property_as_string( EXPORTING iv_attr_name = 'NUMBER_INT' RECEIVING rv_r
esult = lv_item_no ).
ENDIF.
ENDIF.
IF lr_global_messages IS BOUND.
lr_global_messages->add_message(
iv_msg_type = 'E'
iv_msg_id = c_id_message
iv_msg_number = '041' "'036'
iv_msg_v1 = lv_item_no
iv_show_only_once = 'X' ).
ENDIF.
lr_parent-
>get_property_as_string( EXPORTING iv_attr_name = 'PRODUCT' RECEIVING rv_res
ult = lv_product_guid ).
lr_parent-
>get_property_as_string( EXPORTING iv_attr_name = 'ORDERED_PROD' RECEIVING rv
_result = lv_product ).
IF lv_eos_date NE '00000000'.
IF v_enddat GT lv_eos_date.
IF lr_global_messages IS BOUND.
IF lv_value2 IS INITIAL.
lv_msg_typ = 'W'.
ELSE.
lv_msg_typ = lv_value2.
ENDIF.
lr_global_messages->add_message(
iv_msg_type = lv_msg_typ "'W'
iv_msg_id = c_id_message
iv_msg_number = '043'
iv_msg_v1 = lv_item_no
iv_msg_v2 = lv_product
iv_show_only_once = 'X').
ENDIF .
ENDIF.
ELSE. "if lv_eos_date is initial
* BOC SKGANDEM 10/08/2016 CHG644671
* Check EOS date is awailable on HW SKU if not avialble on Service SKU
DATA: lv_hw_prod TYPE REF TO data,
lr_entity_bo TYPE REF TO cl_crm_bol_entity,
lr_entity_a TYPE REF TO cl_crm_bol_entity,
lr_coll_ref TYPE REF TO if_bol_bo_col,
lv_size TYPE i,
lv_r3matid TYPE r3material_id,
lr_entity_ref TYPE REF TO if_bol_bo_property_access,
lv_hw_product_guid TYPE crmt_object_guid,
lv_r3ident_guid TYPE crmt_object_guid.
lr_entity_bo = lr_parent-
>get_related_entity( iv_relation_name = 'BTItemBOSSet' ).
IF lr_entity_bo IS BOUND.
lr_entity_a = lr_entity_bo-
>get_related_entity( iv_relation_name = 'BTRefObjSet_A' ).
ENDIF.
IF lr_entity_a IS BOUND.
lr_coll_ref = lr_entity_a-
>get_related_entities( iv_relation_name = 'BTRefObjectAll' ).
ENDIF.
CHECK lr_coll_ref IS BOUND.
lv_size = lr_coll_ref->size( ).
IF lv_size GE '2'.
lr_entity_ref ?= lr_coll_ref->find(
iv_index = '2'
).
ELSE.
lr_entity_ref ?= lr_coll_ref->find(
iv_index = '1'
).
ENDIF.
IF lr_entity_ref IS BOUND.
lr_entity_ref-
>get_property_as_string( EXPORTING iv_attr_name = 'GUID_OBJECT' RECEIVING rv_
result = lv_r3ident_guid ).
IF lv_r3ident_guid IS INITIAL.
lr_entity_ref ?= lr_coll_ref->find(
iv_index = '1'
).
IF lr_entity_ref IS BOUND.
lr_entity_ref-
>get_property_as_string( EXPORTING iv_attr_name = 'GUID_OBJECT' RECEIVING rv_
result = lv_r3ident_guid ).
ENDIF.
ENDIF.
IF lv_r3ident_guid IS NOT INITIAL.
SELECT SINGLE r3mat_id INTO lv_r3matid FROM com_ta_r3_id WHERE produc
t_guid = lv_r3ident_guid.
IF sy-subrc = 0.
SELECT SINGLE product_guid INTO lv_hw_product_guid FROM comm_produc
t WHERE product_id = lv_r3matid.
IF sy-subrc EQ 0.
IF sy-subrc EQ 0.
SELECT SINGLE zz0014 FROM zproductflds INTO lv_eos_date
WHERE frg_guid = lv_frg_guid.
IF lv_eos_date NE '00000000'.
IF v_enddat GT lv_eos_date.
IF lr_global_messages IS BOUND.
IF lv_value2 IS INITIAL.
lv_msg_typ = 'W'.
ELSE.
lv_msg_typ = lv_value2.
ENDIF.
lr_global_messages->add_message(
iv_msg_type = lv_msg_typ "'W'/E
iv_msg_id = c_id_message
iv_msg_number = '043'
iv_msg_v1 = lv_item_no
iv_msg_v2 = lv_r3matid
iv_show_only_once = 'X').
ENDIF .
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
* EOC SKGANDEM 10/08/2016 CHG644671
ENDMETHOD.