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:
* 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.
* 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:
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:
So do you have any idea on solving this problem?
Thanks in advance,
Edited by: John Smith on Jun 18, 2009 4:17 PM
Hi, what I did was change the condition properties as you can see on this screenshot:
Sorry for the late reply, hope it helps anyway.
Edited by: John Smith on Mar 3, 2010 11:55 AM
Well... are you sure is the same case as yours? do you use a calculation formula? If you look the code of mine, I take the KBETR from another condition type and then calculate the value for the proper one (ZVAC, Z234)
Can you post your calculation formula code to analyze it?
I am facing a similar problem. I tried to open the screen shot posted by you but its not showing up now.
My code is:
CONCATENATE c_varcond_prefix l_varcond INTO l_varcond SEPARATED BY space. * Now find the corresponding ZA00 with the same variant condition READ TABLE tkomv into wl_tkomv WITH KEY kposn = komp-uepos kschl = c_za00 varcond = l_varcond. IF sy-subrc = 0. * xkomv-kawrt = wl_tkomv-kbetr. xkwert = wl_tkomv-kbetr. ENDIF.
However as you mentioned this is getting overwritten by standard code. The calculation type is a percentage. Can you please tell me how you solved the issue?
please have a look on this Change "multidimensional condition"
The value can not be changed in the default was the answer from SAP.
I debug it again and use a ENHANCEMENT-POINT to change it.
I use this:
ENHANCEMENT-POINT xkomv_bewerten_04 SPOTS es_saplv61
I hope this will help you