‎2008 Dec 18 10:52 AM
<<Do not offer rewards>>
Hi all,
I have three condition types, ZCIF, ZFRE, ZFBP. My aim is to bring ZFBP = ZCIF - ZFRE.
I have written a routine with the help of my SD consultant. My logic is working fine in VA01, VF01, VF02. The problem i'm facing is when the user changes the value in VF01 and save again, it is not updating the pricing with the new value.
But the if the user changes new values in VA01 and VF02 and save, then it is working.
Please help me in this. Usefull answers will be surely rewarded.
The code i used inside the routine is as follows. (Routine is attached in ZFBP in pricing, (V/08))
Thanks & Regards,
Rakesh.
READ TABLE lit_xkomv INTO lfl_xkomv1
WITH KEY kschl = ZCIF.
IF sy-subrc EQ 0.
READ TABLE lit_xkomv INTO lfl_xkomv2
WITH KEY kschl = 'ZFRE'.
IF sy-subrc EQ 0.
lfl_xkomv-kwert = lfl_xkomv1-kwert - lfl_xkomv2-kwert.
lfl_xkomv-kbetr = lfl_xkomv1-kbetr - lfl_xkomv2-kbetr.
xkomv-kwert = lfl_xkomv-kwert.
xkomv-kbetr = lfl_xkomv-kbetr.
xkwert = lfl_xkomv-kwert.
ELSE.
xkomv-kwert = lfl_xkomv1-kwert.
xkomv-kbetr = lfl_xkomv1-kbetr.
xkwert = lfl_xkomv1-kwert.
ENDIF.Edited by: Matt on Dec 19, 2008 1:32 PM
‎2008 Dec 18 11:14 AM
Hi Rakesh,
You need to check your config. part like copy control etc.
I dont think it has to do anything with code.
-Maharshi
‎2009 Sep 08 8:19 AM
Hi Rakesh
I think you should check the user exit in sd billing along with the pricing type in SD.
‎2009 Sep 08 8:46 AM
Hi Rakesh,
I think, instead if using read statement again and again, use 'LOOP AT LIT_XKOMV.
A Sample Code is written below, if it could help you out.
<CODE>
DATA: ZKOMV LIKE XKOMV OCCURS 0 WITH HEADER LINE,
KBETRT LIKE XKOMV-KBETR,
KWERTT LIKE XKOMV-KWERT,
CURRENTLINE LIKE SY-TABIX.
LOOP AT XKOMV .
MOVE-CORRESPONDING XKOMV TO ZKOMV.
APPEND ZKOMV. CLEAR ZKOMV.
IF XKOMV-KSCHL = 'ZFBP'.
CURRENTLINE = SY-TABIX .
ENDIF.
ENDLOOP.
READ TABLE XKOMV INDEX CURRENTLINE.
LOOP AT ZKOMV.
IF ZKOMV-KSCHL EQ 'ZCIF' .
KBETRT = KBETRT + ZKOMV-KBETR .
KWERTT = KWERTT + ZKOMV-KWERT .
ELSEIF ZKOMV-KSCHL EQ 'ZFRE' .
KBETRT = KBETRT - ZKOMV-KBETR .
KWERTT = KWERTT - ZKOMV-KWERT .
ENDIF.
ENDLOOP.
XKOMV-KWERT = KWERTT.
XKOMV-KBETRT = KBETRT.
XWERT = KWERTT.
<END OF CODE>
May be bit useful for you. Just Try.
Regds,
Anil.
‎2010 Dec 06 2:09 PM
‎2010 Dec 06 4:16 PM
None of those posted solutions are any good - put your requirement/issue into a new post and you might get a better answer.