Application Development 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: 

RETTKOMV > XKOMV

Former Member
0 Kudos

Hi,

in my condition routine I want to change xkomv-kbetr.

After my code, there is standard SAP code which overwrite my xkomv value.


  IF xkomv-kofrm NE 0 AND wertformel EQ space AND komp-kposn NE 0.
       rettkomv = xkomv.
       xkwert   = xkomv-kwert.
       frm_kondi_wert-nr = xkomv-kofrm.
       PERFORM (frm_kondi_wert) IN PROGRAM saplv61a IF FOUND.
       xkomv    = rettkomv. "<--- here the value will be overwritten
     ENDIF.

What can I do now? Is there another way I can go?

Regards,

Basti

1 ACCEPTED SOLUTION

SharathSYM
Contributor
0 Kudos

Use Implicit enhancement  at the end of subroutine/FM whichever applicable & overwrite back to your desired value.

9 REPLIES 9

SharathSYM
Contributor
0 Kudos

Use Implicit enhancement  at the end of subroutine/FM whichever applicable & overwrite back to your desired value.

0 Kudos

This would definitely be my first thought.

Neal

0 Kudos

Ok thx.

So I have to put my complete code into the enhancement? Or is there a way that I backup the value in the routine, and save it later in the enhancement?

0 Kudos

You can add your custom code at the start/end of the subroutine, using implicit enhancements.

In start of subroutine you may declare a local variable & copy the value of xkomv-kbetr into it.

At the end of subroutine you may copy the local variable back to xkomv-kbetr.

0 Kudos

Yes, you could export / import.  But does that really make sense.  Why would you not move the whole code.  That is unless there was access to values in the previous location that you couldn't have later.

Neal

0 Kudos

Ok, you are right.

So I move the complete code to the enhancement.

Thank you guys!

Regards,

Basti

Former Member
0 Kudos

Thanks, but shouldn't you really give the correct answer to Sharath.  I wouldn't mind the helpful, if it was.  But Sharath gave the correct answer...

Neal

0 Kudos

Thanks Neal,

I admire you generosity,

never saw somebody giving credit to others whom you don't know.

Regards,

Sharath

0 Kudos

I'd think of it more as honor.  Or dedication to right.  Most people think that the right thing changes depending on friendship or nationality or...  Right is always right.  And wrong is always wrong.

I can't say that I always do right, but I want to.

Neal