Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Hardcoded

Former Member
0 Kudos

can any one please tell me what is meant by hardcoded

5 REPLIES 5

0 Kudos

Hi,

Harcoded means that constant values have been used.

E.g

you have a report where you have hardcoded in the select statement that the compnay code is 1000. The result will be : The data would be fetched for only company code 1000. Next time you want to run the same report for another company code you will have to change the report.

Regards,

Narayani

Former Member
0 Kudos

Hi,

<b>hardcoded means -


> put the value of any field in 'Code' not taken as user input.

Fixing of value of field in the code.</b>eg.

data type i value '5'.

<i>

reward point for helpful answer

debjani lahiri</i>

Former Member
0 Kudos

Hi,

Hard coded value is like a constant.

Data: v_num type i value 12.

Data: v_num1 type i.

v_num1 = v_num.

So v_num has value 12 which is hard coded.

and v_num1 is a variable and which is not hard coded.

Former Member
0 Kudos

Hi,

See this


SELECT SINGLE menge meins FROM mara 
                                               INTO   wrk_matnr
                                               WHERE matnr = 'abc-0001'.

Here we are hardcoding the value of matnr in the where condition. This is apoor programming practice.

see this also.


if wk_matnr = 'abc-001'.
*Code
*code
endif.

Here also we are hardcoding the value. Instead of this we can use text elements and use it there. For creating text symbols, in menu GOto->text elements->text symbols.

In this case if we want any change later after years in this program we don't need to change the code again, We just only need to change the text symbols only.

<b>Please don't forget to reward if found helpfull</b>

Regards,

Rakesh.

Former Member
0 Kudos

Hardcode means writing values in the code and not geting them dynamically in runtime.

most of the cases u should avoid if since if you want to change teh value u need to touch the code.

clear?

give points if it is useful. also dont forget to close the call if u get what you want.