Application Development and Automation 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: 
Read only

Reg: hard coding..

Former Member
0 Likes
396

HI,

could any one tel me what exactly mean by hard coding, and how to avoid that in program, if you give me one or two exampls that would be great.

Thanx in advance.

Akshitha

1 ACCEPTED SOLUTION
Read only

anversha_s
Active Contributor
0 Likes
374

hi,

hard cocding means we are directly writing the values with out assigning that value in a variable.

eg:

<u>hard coding</u>

select field1 from ztable into table itab
where field = 'ANVER'.

Instead of that use like this. Assaign the value to avariable.

data : f_val(10) tyep c.

f_val = 'ANVER'.

select field1 from ztable into table itab
where field = f_val.

Hope u r cleared.

Regards

Anver

2 REPLIES 2
Read only

Former Member
0 Likes
374

Hi,

Hard coding is like writing the text directly

write:/ 'hi'.

this will create problem while releasing the object

to avoid this

write 😕 text-001.

it will translate the text in logon language and also can be very handy in reporting

It is not recommended to hard code the text

Regards

Shiva

Read only

anversha_s
Active Contributor
0 Likes
375

hi,

hard cocding means we are directly writing the values with out assigning that value in a variable.

eg:

<u>hard coding</u>

select field1 from ztable into table itab
where field = 'ANVER'.

Instead of that use like this. Assaign the value to avariable.

data : f_val(10) tyep c.

f_val = 'ANVER'.

select field1 from ztable into table itab
where field = f_val.

Hope u r cleared.

Regards

Anver