on 07-23-2012 10:03 AM
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!
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.