cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Unable to fetch KBETR field in price condition using formula routine

Bhosale29
Discoverer
0 Likes
615

We have (zppt price per )tonne which is header condition type also we have ZB00 is base price item condition, we will enter manually zppt price at header and we have to calculate base price condition amount in KBETR ,we have created 918 condition value formula routine , we unable fetch zb00 condition rate in KBETR field, we are getting calculated XKWERT field i.e condition value, unable fetch KBETR, please suggest solution.

data : lt_pack TYPE TABLE OF zpack, wa_pack TYPE zpack.

data : lt_marm TYPE STANDARD TABLE OF marm, wa_marm type marm.

data : lt_marm1 TYPE STANDARD TABLE OF marm, wa_marm1 type marm.

data : lt_prcd TYPE STANDARD TABLE OF prcd_elements, wa_prcd type prcd_elements.

*DATA : ZB001 TYPE p DECIMALS 3.

DATA : ZB001 TYPE decfloat34.

DATA : ZB002 TYPE KWERT.

DATA : ZB003 TYPE KWERT.

data : lv_conversion TYPE f.

SELECT * FROM zpack INTO TABLE lt_pack WHERE matnr = komp-matnr and WERKS = komp-werks and meins = komp-meins.

SORT lt_pack DESCENDING by edate. SELECT * FROM marm INTO TABLE lt_marm where matnr = komp-matnr and meinh = 'TO'.

SELECT * from prcd_elements into table lt_prcd where knumv = komk-knumv and kschl = 'ZPPT'.

READ TABLE lt_marm into wa_marm INDEX 1. READ TABLE lt_pack into wa_pack INDEX 1. READ TABLE lt_prcd into wa_prcd with key kschl = 'ZPPT' kposn = komp-kposn.

ZB001 = ( wa_marm-umren / wa_marm-umrez ) .

IF KOMV-KSCHL = 'ZPPT'.

ZB002 = ZB001 * KOMV-KBETR .

ZB003 = ZB002 + wa_pack-rate.

xkwert = ZB003 * KOMP-MGAME / 1000 . ELSEIF

KOMV-KSCHL = 'ZB00'.

ZB002 = KOMV-kbetr.

xkwert = ZB002 * KOMP-MGAME / 1000 . ENDIF.

*ZB003 = ZB002 + wa_pack-rate.

xkwert = ZB003 KOMP-MGAME / 1000     above code is written in condition value formula routine 

Accepted Solutions (0)

Answers (0)