Hardcoding

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

Rich
Posts: 7116
Joined: Thu Oct 31, 2002 4:47 pm
Location: Liverpool
Contact:

Re: Hardcoding

Post by Rich » Tue Oct 29, 2013 7:13 am

Baz wrote:it gets even better.... i have just found a 28,000 line program that starts off....[/code]
..
..
then round the actual code! FFS!!!
:evil: :evil: :evil: :evil: :evil: :evil: :evil: :evil:
I can beat that. I once removed 29,000 lines of code from a program and it still worked!! :shock:

I can't remember the actual saying. It goes something like:

"If you pay peanuts you get ummm......"

(And please don't insult the monkeys)
Regards

Rich

Image
Abap KC:http://www.richard-harper.me.uk/Kb
SFMDR:http://www.se37.com

Baz
Posts: 4746
Joined: Fri Nov 08, 2002 5:54 am
Location: He's out there! somewhere!!!!
Contact:

Re: Hardcoding

Post by Baz » Wed Oct 30, 2013 12:31 pm

and just fell over this one by mistake...

Code: Select all

check tvko-vkorg eq text-002.  " Proceed if Sales Org. eq '8300'.
so using a text symbol as a hardcoding.....

And WTF????

Code: Select all

IF '0170_8000_8100_8200_8300_8400_8500' NS vbdka-vkorg.
Baz

AsPiRiNg tUlY iDiOt Image

http://www.catb.org/~esr/faqs/smart-questions.html

Image

check out my Podcasts http://dj-baz.podomatic.com

Rich
Posts: 7116
Joined: Thu Oct 31, 2002 4:47 pm
Location: Liverpool
Contact:

Re: Hardcoding

Post by Rich » Thu Oct 31, 2013 3:24 am

Baz, baz.... you're not being professional enough.

Whenever I start work on systems like these, without evening logging on my advice is "Bin it!!!"
Regards

Rich

Image
Abap KC:http://www.richard-harper.me.uk/Kb
SFMDR:http://www.se37.com

Baz
Posts: 4746
Joined: Fri Nov 08, 2002 5:54 am
Location: He's out there! somewhere!!!!
Contact:

Re: Hardcoding

Post by Baz » Thu Oct 31, 2013 4:34 am

lol! that was my advice Rich. but i was brought in as the blueprint was signed off.. decisions have been made...

But it makes a change to get a project that involves removing customisation to replace with standard functionality.... for all their promised, that remains to be seen.....
Baz

AsPiRiNg tUlY iDiOt Image

http://www.catb.org/~esr/faqs/smart-questions.html

Image

check out my Podcasts http://dj-baz.podomatic.com

Rich
Posts: 7116
Joined: Thu Oct 31, 2002 4:47 pm
Location: Liverpool
Contact:

Re: Hardcoding

Post by Rich » Thu Oct 31, 2013 7:12 am

On a serious note, it's very often easier and quicker (not to mention cleaner) to start from scratch in cases like this. Otherwise you end up sticking plasters over plasters and when you poke it in the leg, it's arm falls off.....
Regards

Rich

Image
Abap KC:http://www.richard-harper.me.uk/Kb
SFMDR:http://www.se37.com

YuriT
Posts: 885
Joined: Fri Feb 03, 2006 6:40 am
Location: Basel/Riga

Re: Hardcoding

Post by YuriT » Thu Nov 07, 2013 8:47 am

Thanks a lot, Grogan. Extremely useful.

I think avoiding hard-coding often confused with using constants, but technically constants in any form are hard-coding.
Hard-Code (verb): Fix (data or parameters) in a program in such a way that they cannot be altered without modifying the program.
One can deal with this in many, many ways, but following 3 are my favorite:
  • Hidden(collapsible/expandable) select-options
  • Custom Z table
  • TVARVC

Rich
Posts: 7116
Joined: Thu Oct 31, 2002 4:47 pm
Location: Liverpool
Contact:

Re: Hardcoding

Post by Rich » Thu Nov 07, 2013 8:55 am

YuriT wrote:Thanks a lot, Grogan. Extremely useful.

I think avoiding hard-coding often confused with using constants, but technically constants in any form are hard-coding.
Hard-Code (verb): Fix (data or parameters) in a program in such a way that they cannot be altered without modifying the program.
One can deal with this in many, many ways, but following 3 are my favorite:
  • Hidden(collapsible/expandable) select-options
  • Custom Z table
  • TVARVC
Agreed , but they only need to be changed in one place - ie the constant definition rather than being scattered across the program. So perhaps better than magic numbers, not so fluent as a databas table etc
Regards

Rich

Image
Abap KC:http://www.richard-harper.me.uk/Kb
SFMDR:http://www.se37.com

Grogan
Posts: 365
Joined: Thu Aug 04, 2005 7:16 pm
Location: Australia

Re: Hardcoding

Post by Grogan » Thu Nov 07, 2013 4:27 pm

Guys, check out SAP's new Business Rule Framework called BRFplus if you haven't already. It is freely available in NW 7.01 and above (with some functional limitations in 7.01, fully functional in 7.02 and up).

Business Rules Framework plus - The Very Basics Old, but still a good intro.
Business Rule Framework plus Resources
SCN Business Rule Management Community
Grogan

Award cash if useful.

Post Reply