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 overwrite xkomv-kwert

Former Member
0 Kudos

Hi guys,

I implemented a condition value routine where I want to change the kwert of a condition.


read table xkomv ASSIGNING <fs>  with key mandt = sy-mandt
                                  kposn = xkomv-kposn
                                  kschl = lv_kschl.
  IF sy-subrc = 0.

* do some calculations
    lv_division = ls_xkomv-kbetr * 100 / lv_kwert2 * 100.
    xkwert = lv_division / 100.

    xkomv-kbetr = xkwert.
    IF ls_xkomv-kwert <> 0.
      lv_division = ls_xkomv-kwert * 100 / lv_kwert2 * 100.
      xkwert = lv_division / 100.
      <fs>-kwert = xkwert.
    ENDIF.

At the end of the routine there is the correct value in the internal table xkomv.

But after that, in SAP standard code the line of the internal table will be overwritten.


Form: XKOMV_BEWERTEN


* execute condition value formula not changing xkomv
* will normally be processed in xkomv_kwert_ermitteln
     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.

I found some other threads with this topic but can't find a solution for this.

Would be nice, if someone has an idea.

Regards,

Basti

2 REPLIES 2

Former Member
0 Kudos

HI Basti,

Write/Copy your code at end of XKOMV_BEWERTEN form using implicit Enhacement,

Regards,

Noufal P

0 Kudos

Hi Noufal P,

is there no other way to change this value?

What is the logic behind this sap code? Why do they do this?

Regards,

Basti