14.01.2020 Views

ABAP_to_the_Future

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

B

Making Programs Flexible

target program, but either way the two programs are now different, and copying

over any updates now becomes fraught with danger.

왘 When the same customizing value mean s different things in different SAP

systems

Once again, you might copy your program from the master system to a subsidiary

system—and this time the target system does have the value ZX23, but it

means something totally different. This is a worse problem, because your program

will react to the value but do something unexpected. You can do the same

fix when customizing values are different in different systems, but with the

same problem.

As an aside, this approach also makes code hard to read. After all, what is a ZX23

anyway? You tend to have a limited numb er of characters in customizing values

(sometimes only one character), so it’s hard to make those values meaningful.

Other programmers will look at the code and struggle to understand what’s going

on.

Once my company sold a business unit to another company, and because I had

written most of the software I was hired out for a week to help the new company

modify my programs for use in their system. It turned out that one of the major

programs only had about five lines that needed changing, because I had hardcoded

some customizing values of delivery types and the like, and it was just a

question of replacing those values with the new company’s equivalent values,

and that was that. There are three ways I could have reacted to this:

왘 I could have thought, “Oh no, if I had hard-coded much more and written the

program in an inflexible way, we could have had a lot more consulting hours

out of this.”

왘 I could have said, “Whoopee! How good is this! I wrote this program to be so

portable that it needs minimal changes when transported into to a totally foreign

SAP system. Hang out the flags!”

왘 What I actually thought was, “Hang on; if I can write a program that’s 95% portable,

then why not one that’s 100% portable? After all, that’s what SAP does.

Programs like SAPMV45A (VA01) work in any company.”

When looking through custom programs, it’s often amazing how many assumptions

are made; programmers take things for granted because they are always true

in their company.

712

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!