Skip to Content
0
Jan 27, 2011 at 06:39 PM

KOBED_ Issue

77 Views

Hi, I have a Requirement

implemented in the Pricing Procedures.

This Requirement determines whether the condition is valid or not.

The problem is: when i make the sales order the condition is working properly but then modify something in the sales order, the condition is not updated.

For example:

When creating the sales order triggers a condition through the Requirement, then change the amount of a position of sales order and according to the ABAP CODE inactivate this condition but that should not happen.

This position works if we enter the sales order and then to the Conditions tab and then click the button "Update" option "G - Copy pricing elements and redetermination taxes Unchanged"

I attached the ABAP Code:

IF komk-trtyp <> 'A' AND komk-vbtyp CA 'KH' AND

incl_konditionen = 'Y'.

SELECT SINGLE netwr knumv

FROM vbrk

INTO (lv_netwr, lv_knumv)

WHERE vbeln = komp-vgbel.

IF sy-subrc EQ 0.

SELECT SINGLE kposn

FROM konv

INTO lv_kposn

WHERE knumv EQ lv_knumv AND

kposn EQ komp-vgpos AND

kschl EQ 'J1A2' AND

kwert GT 0.

IF sy-subrc EQ 0.

lv_campo = '(SAPMV45A)TKOMP[]'.

ASSIGN (lv_campo) TO <fs_tkomp>.

IF <fs_tkomp> IS ASSIGNED.

REFRESH lt_tkomp.

lt_tkomp[] = <fs_tkomp>.

CLEAR lv_netwr_aux.

LOOP AT lt_tkomp INTO ls_tkomp.

lv_netwr_aux = lv_netwr_aux + ls_tkomp-NETWR.

ENDLOOP.

IF lv_netwr <> lv_netwr_aux.

lv_subrc = 4.

ELSE.

lv_subrc = 0.

ENDIF.

ELSE.

lv_subrc = 4.

ENDIF.

ELSE.

lv_subrc = 4.

ENDIF.

ENDIF.

ENDIF.

Thanks!