cancel
Showing results for 
Search instead for 
Did you mean: 

Reading the label text and its corresponding field value dynamically in WDA

former_member682881
Discoverer
0 Kudos

Hi Experts,

   I need your help in reading the Label Text and its corresponding VALUE of  input field / Dropdown field / Text view screen elements dynamically in Webdynpro abap.

   I have managed to get the Label text and Label For values and by using 'Label for'  value I can find out the corresponding screen field.  What I want is VALUE of Screen field.

   For example:

        Assume there is customer field with the value C00001.  I need to get the label of field and value of corresponding field programmatically.

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

      Customer         |   C00001              |

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

    Immediate help is greatly appreciated.

Best Regards,

Sreenivasa Sarma K

Accepted Solutions (1)

Accepted Solutions (1)

ramakrishnappa
Active Contributor
0 Kudos

Hi Sreenivasa,

Please follow the below steps to achieve your requirement

  • Get the context binding of primary property of your ui element using method BOUND__PRIMARY_PROPERTY( ) of class CL_WD_UIELEMENT
  • You would get the binding path of the context attribute like VIEW.NODE.ATTRIBUTE
  • Use string operation to find node and attribute name.
  • Then get the node reference and attribute values accordingly

Note: the method bound_primary_property( ) returns the binding path only if the UI element has a primary property like input field has VALUE as primary property

Hope this helps you.

Regards,

Rama

former_member682881
Discoverer
0 Kudos

Hi Ramakrishnappa,

    Thanks for the prompt response.

    I would appreciate if you could advice me to fetch the View instances from component controller.

    For example: I have 7 views in my Webdynpro and when I perform action and I need to get the all the views instances programmatically.

Best Regards,

Sreenivasa Sarma K

ramakrishnappa
Active Contributor
0 Kudos

Hi Srinivasa,

Is your issue resolved? if not, please find my answer for your latest query.

The instances of views gets created/available once the views loaded / displayed.

To have the instances of all the views stored, you need to create global component attributes go_view1, go_view2.... go_viewN for each view of type IF_WD_VIEW and save the instance for first time in wddomodifyview

if first_time = abap_true.

     wd_comp_controller->go_view1 = view.

endif.

Similarly, write the same code in all other views

So, you can access the view instances whenever required.

Hope this helps you.

Regards,

Rama

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Sreeni,


There is a concept in Webdynpro called "Context change log", try this concept to find the changes in a context. By this you can get the changed data.

Refer: Context change log | Team ABAP for implementation details.

Regards,

Meganadhan S