Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How I can get the object wich is inside of other object, CL_CRM_BOL_ENTITY_

Hello Experts, I need your help

Inside of object ISUORDERITEM, there is an atributte CONFIG_LINE_COL from class CL_CRM_BOL_ENTITY_COL.

I have try with this to get CONFIG_LINE_COL but give me an exception because CONFIG_LINE_COL is from class CL_CRM_BOL_ENTITY_COL.


DATA:
lr_info   TYPE REF TO cl_crm_bol_entity,
      dValor TYPE REF TO DATA.


lr_info ?= ME->typed_context->ISUORDERITEM->collection_wrapper->get_current( ).
  dValor ?= lr_info->get_property( IV_ATTR_NAME = 'CONFIG_LINE_COL' ).

And I f I try this give me an error, that *the cast operation is currently only supported for object references. *


 DATA:
      lr_info   TYPE REF TO cl_crm_bol_entity,
      sitem_ref TYPE REF TO cl_crm_bol_entity.


  lr_info ?= ME->typed_context->ISUORDERITEM->collection_wrapper->get_current( ).
  sitem_ref ?= lr_info->get_property( IV_ATTR_NAME = 'CONFIG_LINE_COL'  ).


How I can get the object wich is inside of other object, where boths are from class CL_CRM_BOL_ENTITY_COL.

Tags:
replied

Hi,

try to use follwing code:

DATA:
   lr_info   TYPE REF TO cl_crm_bol_entity,
   sitem_ref TYPE REF TO cl_crm_bol_entity,
   sitem_col TYPE REF TO cl_crm_bol_entity_col.
 
  lr_info ?= ME->typed_context->ISUORDERITEM->collection_wrapper->get_current( ).
  sitem_col ?= lr_info->get_property( IV_ATTR_NAME = 'CONFIG_LINE_COL'  ).
" you can also try to use method get_property_as_value
  sitem_ref ?= sitem_col->get_first( ).

Regards,

Claudia

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question