‎2008 Jun 10 10:25 PM
Let's say I create a peristent class, ZCL_PWIDGET.
ZCA_PWIDGET and ZCB_PWIDGET are created on my behalf.
Let's say I map data in all the fields from table ZWIDGET .
ZWIDGET has 1 Key field, KEY1, and five data fields, C1-C5.
I think I can retrieve data from the tables and create a runtime instance of my class using
DATA: this_widget TYPE REF TO zcl_pwidget.
this_widget=>agent->get_persistent( I_KEY1= '1234' ).
Can someone tell me how to populate wa_widget ( I think I can use a map attributes call, but I don't quite understand how).
Data : wa_widget type zwidget.
Thanks...
...Mike
‎2008 Jun 10 10:49 PM
In your persistence class you must have the SET_ and GET_ methods.
Use GET_C1 method to get the value of the field C1.
Like:
wa_widget-c1 = this_widget=>agent->get_c1( ).
Regards,
Naimesh Patel
‎2008 Jun 11 1:24 PM
Thanks, but I'm looking for a way to populate wa_widget in one fell swoop.
Is there a way to populate all (or most) of the fields of wa_widget at one time, like...
wa_widget = this_widget->get_ALL_fields_from_persistent_mapping
How do folks do this in practice ?
Thanks...
...Mike
‎2008 Jun 12 2:54 AM
Don't believe that a method that will return all fields will be generated for you. If you want something like that, you can create your own custom method in the class that will just call the necessary GET methods for you and return the values.