Quantcast
Channel: SCN: Message List - SAP CRM: Webclient UI - Framework
Viewing all articles
Browse latest Browse all 7775

Re: WEB UI Component - update context node contents

$
0
0

Hello,

i have made simple method in the context node B class.

It retreives property access pointer to the attribute of the collection_wrapper of the context node B.

So if i can not access data from ITERATOR i use this method and it retreives.

This solves my issue, finally

 

" Definition

IV_PATH    Importing    Type    CSEQUENCE

IV_INDEX    Importing    Type    I

EO_PA    Exporting    Type Ref To    IF_BOL_BO_PROPERTY_ACCESS

 

" Implementation

METHOD zz_get_by_index.
   DATA: lo_iterator TYPE REF TO if_bol_bo_col_iterator.
   DATA: lv_path TYPE string.
   DATA: lv_index TYPE i.
   DATA: lv_offset TYPE i.

   CLEAR eo_pa.

   lv_index = iv_index.
   IF lv_index IS INITIAL.
     lv_path = iv_path.
     REPLACE 'Table[' IN lv_path WITH space IN CHARACTER MODE.
     SHIFT lv_path LEFT DELETING LEADING space.
     CLEAR lv_offset.
     FIND ']' IN lv_path MATCH OFFSET lv_offset.
     IF lv_offset > 0.
       lv_index = lv_path(lv_offset).
     ENDIF.
   ENDIF.

   lo_iterator ?= collection_wrapper->get_iterator( ).
   CHECK lo_iterator IS BOUND.

   CALL METHOD lo_iterator->get_by_index
     EXPORTING
       iv_index  = lv_index
     RECEIVING
       rv_result = eo_pa.
ENDMETHOD.

 

I call this method in my GET_<> methods in the same context node:

METHOD get_fname.


   DATA: current TYPE REF TO if_bol_bo_property_access.
   DATA: dref    TYPE REF TO data.
   DATA: lo_iterator TYPE REF TO if_bol_bo_col_iterator.


   value =
'GoCfg not bound'.                                          "#EC NOTEXT


   IF iterator IS BOUND.
     current = iterator->get_current( ).
     IF NOT current IS BOUND.
       CALL METHOD zz_get_by_index
         EXPORTING
           iv_path  = attribute_path
*         iv_index =
         IMPORTING
           eo_pa    = current.
     ENDIF.
   ELSE.
     current = collection_wrapper->get_current( ).
   ENDIF.

" .......

endmethod.


Viewing all articles
Browse latest Browse all 7775

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>