cancel
Showing results for 
Search instead for 
Did you mean: 

To set and get values of a field in web ui

Former Member
0 Kudos

Hi all,

As per the screenshot attached with this discussion, I have created a view with a Model context node binded to BTAdminH entity. I need to display a dynamic text in this view, so i created a value context node. Also i have added the value attribute to the UI.

I need help regarding how to read and write values to the newly created node which is present in the webui.

That is How to Get and Set values to the new field in UI.

I also tried Getter and Setter methods, but the field in the UI is not getting updated.

Thanks in advance

cheers,

Savaridasan

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Are you trying to write to the attribute on page initialize and trying to save the data in the field on save?

If you are trying to save the data in that field in database, i would rather suggest to enhance BTAdminH using AET. We can update the contents of the dynamically based on some events or in DO_PREPARE_OUTPUT.

Could you explain the requirement a bit more in detail?

Former Member
0 Kudos

Hi Savaridasan,

  Use below code to set your value node

     ---------------------------------------------

     --------------------------------------------

     ---------------------------------------------

       TYPES: BEGIN OF str,

           payment_status TYPE char20,

        END OF str

        DATA  lr_struct_ref    TYPE REF TO str. "Structure of payment status context node

        DATA  ls_struct    TYPE  str.""Structure of your context node

        DATA lr_value_node    TYPE REF TO cl_bsp_wd_value_node.  

  

        CREATE DATA lr_struct_ref.

        CREATE OBJECT lr_value_node

          EXPORTING

            iv_data_ref = lr_struct_ref.

        ls_struct-payment_status = 'Your Value'.

        lr_value_node->if_bol_bo_property_access~set_properties( ls_struct ).

---------------------------------------------------------------------------

---------------------------------------------------------------------------

Regards

Rajarama U

Former Member
0 Kudos

Hi Rajarama, thanks for your reply.

Hi i used the below code in GET_PAYMENTSTATUS method to set a value in to paymentstatus field in the UI.

me->SET_PAYMENTSTATUS( attribute_path = 'PAYMENTSTATUS' value = value ).

But now as per my requirement, I need to set the value while a Button is clicked.

That is help me how to set new value to the paymentstatus field when an event is performed.

Thanks

Savaridasan.


Former Member
0 Kudos

Hi,

  On click on button,first write the logic for description of payment status and set it as I shown above post.

Regards

Rajarama U

Former Member
0 Kudos

Hi,

I am able to set and get values in creating Model attribute in Model NODE and also while using Value attribute in Valude NODE.

But in my case, am creating a Value attribute in Model NODE and the field gets displayed only if i comment the code in Get and Set method of the Value attribute field

Also i tried with some code to display value to the attribute but it throws BSP error - the snapshot i have atached with this discussion.

Help me in this regard. Thanking you all Experts

Cheers,

Savaridasan

Former Member
0 Kudos

Hello savarisasan ,

This is called mixed node now . cl_bsp_wd_mixed_node is class you need to refer for seperating the collection.

Once you add an value attribute to the model node then it will called as mixed node.

Thanks and Regards,

Nikhil Kulkarni

Former Member
0 Kudos

Greetings Nikhil,

Thank you for the reply. i have tried with the cl_bsp_wd_mixed_node, but the same error resulting in UI

cheers,

Savaridasan

Former Member
0 Kudos

Hello,

Let me know something, Do you have the solution for the error that you posted??...

Because I have the same error and I looking for a solution for one week and I didn´t Find Anythingggggggggggggg hahahahhaa...

So, I aprecciated if you telling me what do you about this error?

Former Member
0 Kudos

Hi Juan,

You should have started new discussion as this one is 4 years old.

You haven't written much about your issue but you may try passing the parameter in get_property method in all CAPS. i.e. instead of PayAmount try PAYAMOUNT. If this does not work please provide more details.

Former Member
0 Kudos

Hi Jaun,

Try to do type cast using the interface if_bol_bo_property_access. This may solve your problem,else plz share your code here.

Thanks and regards,

Raja