Avoid Hard-coding by maintaining TVARVC table entries.

Hard coding is a nightmare for any SAP ABAPer. It must be strictly avoided but there are circumstances where we need to hard code like for example data based on certain fixed company codes. You can avoid the hard coding in these scenarios by maintaining TVARVC table.

Go to Transaction STVARV and maintain the data. Create a parameter or select option data and fill in the values/constants that your program requires.

STVARV : Maintain data to avoid hard coding
STVARV : Maintain data to avoid hard coding

Use a select query in the beginning of your program to fetch the parameters you have maintained in the table. Thats it :)

At any point, any functional can edit the entries in the TVARVC table and your program will consider the updated values without the need of modifying the code.