Application Development and Automation 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: 
Read only

SD: Pricing Routine/Condition value

Former Member
0 Likes
1,746

<<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

5 REPLIES 5
Read only

Former Member
0 Likes
1,095

Hi Rakesh,

You need to check your config. part like copy control etc.

I dont think it has to do anything with code.

-Maharshi

Read only

vivekchokshi
Explorer
0 Likes
1,095

Hi Rakesh

I think you should check the user exit in sd billing along with the pricing type in SD.

Read only

Former Member
0 Likes
1,095

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.

Read only

Former Member
0 Likes
1,095

Hi, can you tell me how can you solved it?

Greetings,

Read only

0 Likes
1,095

None of those posted solutions are any good - put your requirement/issue into a new post and you might get a better answer.