Skip to Content
0
Former Member
Oct 12, 2011 at 09:54 AM

Enhanced comp new context node added; Attribute doesn't hold values entered

313 Views

Hi

I enhanced the component, ICCMP_BTSHEAD. Added a new context node, with higher level BOL entity as BTADMINH.

the attribute Extenal reference (PO_NUMBER_SOLD), added on the configuration.

When user enters value in external reference field, on save the value disappears. the field doesn't hold the value.

I debugged the Set_PO_NUMBER_SOLD method of the attribute. Collection_ref >Data_ref >attribute list is intial. the PO_NUmber shows blank.

Kindly help me how to hold the field value.

Thanks!

I added below code in Do_validate_input method. It is reading the po_number_sold attribute. but not saving the attribute.

method DO_VALIDATE_INPUT.
CALL METHOD SUPER->DO_VALIDATE_INPUT
    .

*****-----------------------------------------------------------------------------------*
*   set external reference value
*    set entity to BTSALESSET as current
  DATA : lr_salesSet_coll        TYPE REF TO    if_bol_bo_col,
         lr_salesSet_entity      TYPE REF TO    cl_crm_bol_entity,
         lr_btSalesSet           TYPE REF TO    ZL_ICCMP_BT_BTSHEADER_CN00,
         lv_ext_ref              TYPE           STRING,
         lr_current_extRef       TYPE REF TO    if_bol_bo_property_access.

  TRY.

    CHECK me->ztyped_context->BTSalesSet IS BOUND.
*CHECK  me->typed_context->BTSalesSet IS BOUND.
    lr_salesSet_coll = me->ztyped_context->BTSalesSet->GET_COLLECTION_WRAPPER( ).
    lr_salesSet_entity ?= lr_salesSet_coll->GET_CURRENT( ).

    CHECK lr_salesSet_entity IS BOUND AND lr_salesSet_entity->ALIVE( ) EQ ABAP_TRUE.

    lr_current_extRef = lr_salesSet_coll->GET_CURRENT( ).

    TRY.
      CALL METHOD LR_CURRENT_EXTREF->GET_PROPERTY_AS_STRING
        EXPORTING
          IV_ATTR_NAME = 'PO_NUMBER_SOLD'
        RECEIVING
          RV_RESULT    = lv_ext_ref.
      IF lv_ext_ref IS NOT INITIAL.
        lr_salesSet_entity->switch_to_change_mode( ).

        TRY.
            CALL METHOD LR_CURRENT_EXTREF->SET_PROPERTY_AS_STRING
              EXPORTING
                IV_ATTR_NAME = 'PO_NUMBER_SOLD'
                IV_VALUE     = lv_ext_ref.
          CATCH CX_SY_CONVERSION_ERROR .
        ENDTRY.

        LR_CURRENT_EXTREF->set_properties( if_genil_obj_attr_properties=>changeable ).
        DATA: lv_attr_props       TYPE REF TO if_genil_obj_attr_properties.
        lv_attr_props->set_all_properties( if_genil_obj_attr_properties=>changeable ).

      ENDIF.
    ENDTRY.



  endtry.
endmethod.

Edited by: Ekta on Oct 12, 2011 12:16 PM