‎2005 Aug 30 11:02 AM
Hi,
I declared a variable for material number as "g_matnr TYPE mara-matnr" but my QA person has raised a point saying I should declare variable as "g_matnr TYPE matnr" i.e. he asks me to directly refer data element instead of table name-fieldname and also he says directly referring data element improve the performance. Is it correct? Will it really improve the performance?
Advance thanks.
Regards,
Balaji Viswanath.
‎2005 Aug 30 1:06 PM
Hi Balaji,
What max said is true...
You wont see a great improvement in performance.. because that resolution of field to data element will probably take a micro second or lesser...
But it is generally a good practise to give the data element so that the system doenst have to do this resolution at runtime.
So ur QA said the right thing..
And rememebr to reward the points to answer that helped you most and close the thread.
Rgds,
Prabhu.
‎2005 Aug 30 11:20 AM
Pehaps it's true...i think the system can bypass one step: the system doesn't has to check which data element is linked to your dictionary field (MARA-MATNR in your case).
When it uses stataments 'data my_var like ....', the variable get the characteristics that are defined in data element and domain linked to dictionary field.
‎2005 Aug 30 12:41 PM
The important question is if you want to refer to the dictionary or the mentioned field in a table (or structure). If you're working with the mentioned structure or table I would prefer the use of "like" in case the theoratical event occurs that SAP decides to change the type of certain table-fields.
‎2005 Aug 30 1:06 PM
Hi Balaji,
What max said is true...
You wont see a great improvement in performance.. because that resolution of field to data element will probably take a micro second or lesser...
But it is generally a good practise to give the data element so that the system doenst have to do this resolution at runtime.
So ur QA said the right thing..
And rememebr to reward the points to answer that helped you most and close the thread.
Rgds,
Prabhu.
‎2005 Aug 30 3:19 PM
Thanks Max and Prashanth, I am ready to declare some 10 variables in both the ways and check the performance... how to do it.. can you please tell me Transaction code to trace performance.
Advance thanks.
Regards,
Balaji Viswanath.
‎2005 Aug 30 3:22 PM
‎2005 Aug 30 3:23 PM
try SE30 or ST05
I am pretty sure you won't find much difference in performance.. the QA is person only trying to make you adhere to the standards..
Good luck,
Suresh Datti
‎2005 Aug 30 6:18 PM
Hi Balaji,
Go for transaction code : SE30 thats enough.
Bye....
sri.
‎2005 Aug 31 4:45 AM
Balaji,
SE30 is the transaction where you can check for performance. But take it from me, that you will not see much difference in performance. Because, as I said in my earlier post, the performance improvement u get by declaring these by directly referring to the data element is very small. however it is a good practise to do it this way.
Kindly reward points.. and if ur Q is answered, close this post.
Prash.
‎2005 Aug 31 4:31 AM
Hi,
It will surely improve ur performance, u r refering directly yo a dataelemnt in the case of
g_matnr TYPE matnrbut in the other case u referring to a table and then to its field.
SO it will take a bit ime more to fetch the type.
U can also give as
g_matnr LIKE matnr
To check for performance u can do a performance check in the program itself. Or u can do in ST05.
Hope this helps.
Kindly reward and close the thread.
‎2005 Aug 31 4:35 AM
you will surely get good performance,
BUT YOU WILL NOT HAVE F4 (default from database) facility.
regards