cancel
Showing results for 
Search instead for 
Did you mean: 

Best way to call method in Assistance Class - Web Dynpro for ABAP

Former Member
0 Kudos

Hi Experts,

My question is, let say in my WD Component, I want to call a method in an Assistance Class to populate an itab. I am thinking of 2 ways to achieve this.

1. Write method in Assistance Class with EXPORTING or RETURNING parameter of the itab. After that, use the itab in WD Controller.

2. Let the itab be a global attribute of the Assistance Class, then populate the itab in the method without any parameters. After that, access to the itab with wd_assist->itab_name.

May I know which way should I adopt? in term of performance? best practice?

Thanks so much for your help!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

As per performace ,Second approach is better.

In that case, once fetch the value and  store in class attribute.So  whenever u need that value,u use attribute.No need to call the logic again and again.

But make sure value in itab is not frequently change.

Thanks

Answers (2)

Answers (2)

Aashish28
Contributor
0 Kudos

Hiiii ,

         It depends on requirement but yes instead of calling method again and again you can go with 2nd option ...... hey just read this link you will get more information http://help.sap.com/saphelp_nw04s/helpdata/en/43/1f6442a3d9e72ce10000000a1550b0/content.htm

Former Member
0 Kudos

Hi,

If I may want to use the data in the table at various points, I would use the second approach for obvious reason that I would not have to call the method and in turn the logic again and again. The data will be readily available in a global table.