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: 

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

mgbernardo
Participant
0 Kudos

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:

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Dear John,

Were you able to solve the problemb ? I am having the same problem in pricing ?

Appreciate if you can help.

Thanks,

Rupak

12 REPLIES 12

Former Member
0 Kudos

Dear John,

Were you able to solve the problemb ? I am having the same problem in pricing ?

Appreciate if you can help.

Thanks,

Rupak

0 Kudos

Hi, what I did was change the condition properties as you can see on this screenshot:

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

Sorry for the late reply, hope it helps anyway.

Regards,

John

Edited by: John Smith on Mar 3, 2010 11:55 AM

0 Kudos

Hi Marcelo

The image does not exist. Can you Please add the image link again?

0 Kudos

Hi Thilina,

It's a long time since this post and may depend on your current ERP version. I think this was on 4.72

Anyway, if I remember correctly, the problem was about the condition type properties. In order to get the value fixed properly you gotta follow this rules specified on LV61AA55:


          IF xkomv-krech NA absolute OR xkomv-kgrpe NE 'X'.

            PERFORM xkomv_kwert_ermitteln.

          ENDIF.

where "absolute" var is: "BT". So your condition type can't use calculation type "B" or "T" and can not be grouped either (KGRPE must be initial)

For example my working condition type was like:

Anyway your problem could be different. Your best option would be to open a new post explaining your case with your code and context.

Just tell me if you do and I'll try to clear it out

Regards

Message was edited by: Marcelo García

mgbernardo
Participant
0 Kudos

Image at last post.

0 Kudos

Hi ,

I did the changes according to the screenshot attached by you. It didn't work. Basically when you change the qty. the price doesn't get updated. Can you be able to tell what was the actual change ?

0 Kudos

Hi Rupak,

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?

Regards,

John

Former Member
0 Kudos

Hi John,

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?

Regards,

Sai

0 Kudos

Hello,

i have the sanme problem in RV64A903

The xkwert is changed but it has no effect.

I have open an call.

If i get an answer from SAP, i will tell it you.

Regards

Florian

0 Kudos

Hi Florian,

please help. We do have the same issue. Did you get a reply from SAP?

Thanks

Srinivas

0 Kudos

Hello.

please have a look on this

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

Regards

Florian Martin

0 Kudos

This finally paid for my 3 weeks hard work!!

ENHANCEMENT-POINT xkomv_bewerten_04 SPOTS es_saplv61  worked just perfect to my requirement!!

Thanks Martin!!


-Satya