Skip to Content
0
Apr 23, 2014 at 07:15 AM

Pricing routine

74 Views


Hi,

I am working on pricing routine RV61A902, where I want to pick up the excise duty already paid for the chassis. I have written code as below :-

But the problem is I am not getting KSCHL 'ZCEP' when i debug this code. I want to execute below code only form ZCEP. Is there any other way to do this ?

Or do I need to find out any other routine where I can code this?

Regards,

ABAP CODE :-

FIELD-SYMBOLS : <fs_sernr> type any,
<fs_ripw0> type any.

data : lv_obknr type OBJKNR,
lv_LIEF_NR type VBELN_VL,
lv_vbeln type VBELN_NACH,
lv_curry type gjahr,
lv_belnr type belnr_d,
lv_dmbtr type DMBTR.

if xkomv-kschl = 'ZCEP' and komk-bukrs = '0100'.
assign ('(SAPLIPW1)RIPW0') to <fs_ripw0>.
IF <fs_ripw0> IS ASSIGNED.
assign component 'SERNR' of structure <fs_ripw0> to <fs_sernr>.
clear lv_obknr.
select single OBKNR
into lv_obknr
from OBJK
where EQUNR = <fs_sernr>
and TASER = 'SER01'.

if lv_obknr is not INITIAL.
clear lv_LIEF_NR.
select single LIEF_NR
into lv_LIEF_NR
from SER01
where OBKNR = lv_obknr.

if lv_LIEF_NR is not INITIAL.
select single vbeln
into lv_vbeln
from vbfa
where VBELV = lv_LIEF_NR
and POSNV = '000010'
and VBTYP_N = 'U'.

if lv_vbeln is not INITIAL.
clear lv_curry.
CALL FUNCTION 'GET_CURRENT_YEAR'
EXPORTING
BUKRS = '0100'
DATE = SY-DATUM
IMPORTING
CURRY = lv_curry.

clear lv_belnr.
select single belnr
into lv_belnr
from BKPF
where BUKRS = '0100'
and GJAHR = lv_curry
and BLART = 'RX'
and XBLNR = lv_vbeln.

if lv_belnr is not INITIAL.
select single dmbtr
into lv_dmbtr
from BSEG
where BUKRS = '0100'
and BELNR = lv_belnr
and GJAHR = lv_curry.

xkomv-kbetr = xkwert = lv_dmbtr.

endif.
endif.
endif.
endif.
ENDIF.
endif.