cancel
Showing results for 
Search instead for 
Did you mean: 

assistance class ??

Former Member
0 Kudos

Hi ,

Can anyone help me to know the usage of assistance class with an example?.

Thanks

siva

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

Just go through the following link

[http://help.sap.com/saphelp_nw04s/helpdata/en/43/1f6442a3d9e72ce10000000a1550b0/frameset.htm]

Also go through the standard program DEMO_COMMON_ASSISTANCE1.

thanks.

uday_gubbala2
Active Contributor
0 Kudos

Hi Siva,

Sumit & Sarath have already given you some idea about what you can use the Assistance class for. I will try to give you some more details about the same.

Instead of using texts defined in the OTR, it is possible to define the texts as text elements in an ABAP class. To access the text element values, a public method of the class can be used. A class offering methods to read the text elements is already available in each SAP NetWeaver AS 7.0, having the name

CL_WD_COMPONENT_ASSISTANCE. Each class inheriting from this parent class will have the method get_text( ). Passing the identifier of the text symbol to the method will return the text in the language sy-langu. To use this class in a Web Dynpro component, it has to be instantiated in each controller. However, an easier and more consistent way is to let the Web Dynpro runtime create the instance only once. This is done by writing the class name in the Assistance Class field, which can be found on the Properties tab for the Web Dynpro component. The single steps are:

1) Edit the Web Dynprpo component. Navigate to the Properties tab of the component.

2) Enter a class name in the Assistance Class field.

3) Double-click the class name. If the class does not exist, it will be created. The class will be derived from the parent class CL_WD_COMPONENT_ASSISTANCE.

Text symbols can be added to the class by choosing Gotou2192Text Symbols.

Once you have assigned the assistance class to the component, an attribute WD_ASSIST, is added to the attribute list of each controller. This attribute is set by the Web Dynpro runtime to the assistance class instance. Using WD_ASSIST, a text can be accessed as follows:

1) Using the text element identifier CAR:

DATA: lv_text TYPE string.
lv_text = wd_assist->if_wd_component_assistance~get_text( key = 'CAR' ).

2) Using a constant CARRID, having the text element identifier CAR as its

value:

DATA: lv_text TYPE string.
lv_text = wd_assist->if_wd_component_assistance~get_text( key = wd_assist->carrid ).

Regards,

Uday

Former Member
0 Kudos

Hi Siva,

You mainly use Assistance class for two basic reason:

1) To use texts efficciently in Web Dynpro ABAP components

2) To make your WD ABAP applications MVC compliant by putting all data base related methods in assistance class.

I was not able to find any standard demo porgram using assistance class.

Please go through this link below to get basic idea about working with assistance classes.

[Working with Assistance Class|http://help.sap.com/saphelp_nw70/helpdata/EN/43/1f6442a3d9e72ce10000000a1550b0/frameset.htm]

Please revert back if you need any help regarding assistance class.

I hope it helps.

Regards,

Sumit Oberoi

Former Member
0 Kudos

HI siva,

If you want to talk to data base or fetch any thig from data base, you have to use assistance class.

This is mandatory in real time development of applications.

creaing assistace class is simple enter in componet initial screen in the field of assistace class, you get

that class name under component tree.

create methods as of you create for a class.

give import and export paramenters.

call this methods in your view or component methods.

where ever you required select quiery call the methods from assistance class only.

Regards,

sarath

Edited by: sarath kumar on Dec 8, 2008 4:18 PM