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

Modify standard method

Former Member
0 Likes
4,220

Hi

I need to amend a single line of code in the following method IF_BSP_ELEMENT~DO_AT_BEGINNING on class CL_HRRCF_BSP_EXT_APPLICATION.

This is the line in question - content->design = 'DESIGN2003'.


We are upgrading our erec system and need to display our bsp's with design2008. None of the notes referenced can by applied to our basis version, they are either too old or too new.

Can someone please tell me the best way to make this very simple amendment. Modification operations don't seem to be available and the Enhancement operations don't seem to allow for editing this line of code.

Thanks

Jon.

1 ACCEPTED SOLUTION
Read only

matt
Active Contributor
0 Likes
3,459

When you try to go to change mode,you should be prompted for an object key. Get this from service.sap.com and make the change.

Have you tried that?

10 REPLIES 10
Read only

matt
Active Contributor
0 Likes
3,460

When you try to go to change mode,you should be prompted for an object key. Get this from service.sap.com and make the change.

Have you tried that?

Read only

Former Member
0 Likes
3,459

Hi Matthew

I'm well aware of changing SAP standard by getting an object key but that would be my last resort.

I would rather make the change using one of/the correct enhancement/modification operation. That way it's future proofed against future upgrades and service packs.

Cheers

Jon.

Read only

matt
Active Contributor
0 Likes
3,459

I'm glad you're well aware - it wasn't clear from your first posting that you were looking for an alternative to modification.

I've had a dig around in that part of the code, and you might get away with an implicit enhancement at the end of the method, to set content->design to the desired value. It seems not to be used until after this method.

There are other alternatives, but they all involve to a degree, copying and pasting the original code and then making amendments. I would strongly suggest that a direct modification would be preferable to this approach.

Except in really volatile areas, a direct modification does not cause problems during upgrades/service packs. The worst is that you'd have to reapply the change (but it would be clear what to do, and flagged up in SPAU), and you'd only have to do that if that bit of code had changed (hence my comment on volatility) and the modification assistant couldn't make the change itself.

Read only

Former Member
0 Likes
3,459

Hi Jon

Implement the Implicit Enhancement at the beginning of the Method.

Copy the whole method code into this Enhancement (with your change).

In the last line of the Enhancement add the RETURN command to leave the method to prevent calling the original method code.

Our Philosophy is that code modifications are to be avoided.

We have only one modification in our entire ERP System,

Regards,

Ron

Read only

matt
Active Contributor
0 Likes
3,459

Copying SAP standard (cloning) is more prone to error and problems than direct modification, and in my view is even more to be avoided. This way isn't so bad, but nonetheless, you won't get the benefit of any fixes applied to the original object, and, worse, you won't know they need applying.

I've spent far more time sorting out problems due to cloning in the past 18 years than problems caused by direct modification! In fact, I don't recall any issues caused by modifications except a little basic work during SPAU from time to time.

Read only

0 Likes
3,459

Hi Mathew,

You make a very good point.

I'll certainly keep this in mind.

Regards,

Ron

Read only

Luk11
Active Participant
0 Likes
3,459

I agree with Matthew. This kind of modification should be done with a repair instead of using implicit enhancement options.

Since BSP is considered as being a "mature technology", there probably will not be very much changes to this code by SAP and if there should be a change in it, I would prefer to be notified in the SPAU list.

Read only

0 Likes
3,459

I agree with Matthew. This kind of modification should be done with a repair instead of using implicit enhancement options.

Since BSP is considered as being a "mature technology", there probably will not be very much changes to this code by SAP and if there should be a change in it, I would prefer to be notified in the SPAU list.

Sorry, but I need to jump in and play Wisenheimer:

For enhancements you also have SPAU_ENH for adjustments after upgrades so there's no disadvantage there. Also, implicit enhancements and explicit enhancements (excluding overwrite exits) should always be used when possible instead of modifictions (will gladly take up the discussion if there's a "why?"). Don't get me wrong, Matt's advice to go for a modification in this case is 100% valid, because the only process-wise clean alternative would be an overwrite exit which invokes that bit of "cloning/copying" he was refering to and you'll have the most problems during upgrades in terms of overviewing "what has been done where and why".

Cheers, Lukas the Enhancement-Wisenheimer

Read only

matt
Active Contributor
0 Likes
3,459

I don't disagree at all.

Read only

Former Member
0 Likes
3,459

Cheers everyone.

So in this instance I'm going to go with the consensus and get the object key.

Really appreciate the input.

Regards

Jon