cancel
Showing results for 
Search instead for 
Did you mean: 

How to read the form view data of value node?

Former Member
0 Kudos

Hello experts,

I have a Z table with some fields , say GC#, Validity, Value, Offered on.

I have created the form view with these fields and with the button  Create.

After entering the values in the form, I am trying to get those details in  eh_oncreate method with the below code.

DATA: lr_entity TYPE REF TO cl_crm_bol_entity,

lr_entity ?= me->typed_context->GCNODE->collection_wrapper->get_current( ).

lv_gcno = lr_entity->get_property_as_string( 'GCNO' ).


Here, it is giving me the error. I have checked that in debugging. lr_entity  does no have any reference, it is initial.  When the view is displayed, will it not create any instance for the context node?

Can someone please tell me how to read the form view data of value node? Your help will be much appreciated. Thank you.

Accepted Solutions (0)

Answers (2)

Answers (2)

sumeet_gehlot
Contributor
0 Kudos

Hi,

Extending the BOL to incorporate the Ztable you would be referrring to.


First you have to  fill up value nodes :

  1. * Structure of  context node. 
  2. DATA  lr_struct_ref    TYPE REF TO Zstr. 
  3. * Structure of your context node 
  4. data  ls_struct    type  Zstr. 
  5. DATA lr_value_node    TYPE REF TO cl_bsp_wd_value_node. 
  6. CREATE DATA lr_struct_ref. 
  7. CREATE OBJECT lr_value_node 
  8.    EXPORTING 
  9.      iv_data_ref = lr_struct_ref. 
  10. ls_struct-gc = 'Your Value'.
  11. ls_struct-validity = 'Your Value'.
  12. ls_struct-calue = 'Your Value'. 
  13. lr_value_node->if_bol_bo_property_access~set_properties( ls_struct ). 
  14. *Add Value Node to a collection 
  15. typed_context->testnode->collection_wrapper->add( lr_value_node ).


Then to retrieve data Use lr_Entity type ref to cl_bsp_wd_value_node.

and use get_property_as_string or get_property  method which will return Returns a Reference to an Attribute.

Check CL_BSP_WD_VALUE_NODE class for more information.


Regards,

Sumeet

Former Member
0 Kudos

Thanks Sumeet.

I got the idea about how to do that. Your help is appreciated!

Thread closed.

-Ezhno.

former_member188346
Active Participant
0 Kudos

Hi Maren,

Instead of using lr_entity ref type cl _crm_bol_entity  use cl_bsp_wd_value_node. It will work.

Thanks

Bhushan