‎2008 Aug 20 8:28 AM
hi all,
In a call function statement if we hardcode the parameter values, whether it will be a hard coding?
It should be avoided are not?
ex.
CALL FUNCTION ' REUSE_ALV_GRID_DISPLAY '
EXPORTING
STRUCTURE_NAME = ' MARA '
....................
In this ' MARA ' is a hardcode or not?
Regards,
Florian.
‎2008 Aug 20 8:31 AM
Hi florian,
1. This would NOT mean as hard coding.
Bcos it is the format in which we want to display.
2. Hardcoding is hardcoding of variable values / business parameters.
Eg. if company code is 1000, and if we use this '1000'
directly in our code, then it is called hardcoding.
Another eg. would be of a particular material number. If
we directly use that material number in our variable, then
it is hardcoding.
regards,
amit m.
‎2008 Aug 20 8:31 AM
Hi florian,
1. This would NOT mean as hard coding.
Bcos it is the format in which we want to display.
2. Hardcoding is hardcoding of variable values / business parameters.
Eg. if company code is 1000, and if we use this '1000'
directly in our code, then it is called hardcoding.
Another eg. would be of a particular material number. If
we directly use that material number in our variable, then
it is hardcoding.
regards,
amit m.
‎2008 Aug 20 8:32 AM
It is Hardcoding, you can avoid doing this..
DATA: STR TYPE DD02L-TABNAME .
STR = 'MARA'.
CALL FUNCTION ' REUSE_ALV_GRID_DISPLAY '
EXPORTING
STRUCTURE_NAME = STR
‎2008 Aug 20 8:33 AM
Hi Florian,
It depends on ur rquirement whether to hard code or not. Maximum we should try to avoid hardcoding.
Moroever in call function , if you want to pass a structure the it shouldn't be in single quotes. It should be kept open.
Thanks & regards,
Ravi Amistapur
‎2008 Aug 20 8:36 AM
Hi Florian,
Hard coding means .....I will explain in your case:
If suppose you expect the structure name to be more than one and anything may come in that place and if you are giving one value only among a set of values, Then we can say that it is hard coded.
If in your case the structure name is only MARA then you can give it directly as you mentioned in the code above. This is not considered as hard coding
Regards,
Swapna.