9 Replies Latest reply: Aug 8, 2011 9:06 AM by Florian Martin RSS

XKOMV-KWERT doesn't take XKWERT value with Customized Routine

Marcelo García
Currently Being Moderated

Hi Gurus,

 

I have a problem with a custom value routine. Inside it a new value for xkwert is calculated but it never goes to its corresponding xkomv-kwert field. So the kwert field for my condition remains the same.

 

I've been debugging the code, mainly "LV61AA55" and I've seen that there are two ways to get to the routines execution:

 

1º )

 

* 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.
    ENDIF.

 

2º)

* calculation formula
  IF xkomv-kofrm NE 0.
    wertformel = 'X'.
    xkwert = xkomv-kwert.
    frm_kondi_wert-nr = xkomv-kofrm.
    PERFORM (frm_kondi_wert) IN PROGRAM saplv61a IF FOUND.
    xkomv-kwert = xkwert.
  ENDIF.

 

As you guys can see, on the second one it takes the xkwert value correctly into xkomv-kwert but in my case it never pass through that code inside form "xkomv_kwert_ermitteln". On my case, it always go through the point 1 and never assign the xkwert to the xkomv.

 

 

I show you the code here:

 

Custom routine:

 

form frm_kondi_wert_930.
zkomv[] = xkomv[].
case xkomv-kschl.

  when 'ZVAC'.
    clear: kwert_aux, kbetr_aux, komv_aux.
    
    read table zkomv with key kschl = 'ZIMP'.
    if sy-subrc = 0.
      kwert_aux = xkomv-kwert * zkomv-kbetr / 100000.
      xkwert = xkomv-kwert - kwert_aux.

    endif.

  when 'Z234'. 
    clear: kwert_aux, kbetr_aux, komv_aux.
    read table zkomv with key kschl = 'ZIMP' into komv_aux.
    if sy-subrc = 0.
      kwert_aux = xkomv-kwert * zkomv-kbetr / 100000.
      xkwert = xkomv-kwert - kwert_aux.

    endif.

endform.

 

Here are my condition specs:

http://gunshit.250free.com/SS1.png

 

 

So do you have any idea on solving this problem?

 

Thanks in advance,

 

John.

 

Edited by: John Smith on Jun 18, 2009 4:17 PM

 

Actions