vofm get price t-code me22n validation of price condition
VOFM Routine is very important with
help of you can create your condition
exit NAME: LV69AF40 Put this code
for getting data
Business requirments getting price condition in me22n and help the me22n you can get the price condition for you can feth the data two table ekko and konv table
and select the three field ebeln and knumb and pass knub to knov table and feth the field for knov table knumv and kschl and kawrt and get all field and do caluation as per the caluation you get your result
Business requirments getting price condition in me22n and help the me22n you can get the price condition for you can feth the data two table ekko and konv table
and select the three field ebeln and knumb and pass knub to knov table and feth the field for knov table knumv and kschl and kawrt and get all field and do caluation as per the caluation you get your result
break rohinik.
data : lv_value1 LIKE xkomv-kwert.
import lv_value1 from MEMORY id 'ZKWERT'.
LOOP AT XKOMV WHERE kschl = 'BASB'.
IF SY-subrc = 0.
Xkomv-kwert = lv_value1.
MODIFY XKOMV TRANSPORTING kwert WHERE kschl = 'BASB'.
ENDIF.
ENDLOOP.
data : lv_value1 LIKE xkomv-kwert.
import lv_value1 from MEMORY id 'ZKWERT'.
LOOP AT XKOMV WHERE kschl = 'BASB'.
IF SY-subrc = 0.
Xkomv-kwert = lv_value1.
MODIFY XKOMV TRANSPORTING kwert WHERE kschl = 'BASB'.
ENDIF.
ENDLOOP.
and exit name for seeting the code
exit NAME: LV69AF41 Put this code
for getting data
break rohinik.
DATA : lv_value1 LIKE xkomv-kwert.
IMPORT lv_value1 FROM MEMORY ID 'ZKWERT'.
LOOP AT XKOMV WHERE kschl = 'BASB'.
IF SY-subrc = 0.
Xkomv-kwert = lv_value1.
MODIFY XKOMV TRANSPORTING kwert WHERE kschl = 'BASB'.
ENDIF.
ENDLOOP.
DATA : lv_value1 LIKE xkomv-kwert.
IMPORT lv_value1 FROM MEMORY ID 'ZKWERT'.
LOOP AT XKOMV WHERE kschl = 'BASB'.
IF SY-subrc = 0.
Xkomv-kwert = lv_value1.
MODIFY XKOMV TRANSPORTING kwert WHERE kschl = 'BASB'.
ENDIF.
ENDLOOP.
BREAK ROHINIK.
DATA: lv_kwert LIKE komv-kwert,
lv_value LIKE xkomv-kwert,
lv_value1 LIKE xkomv-kwert.
CLEAR: lv_value, lv_value1.
IF KOMV-kschl = 'PB00'.
IF SY-subrc = 0.
lv_value = komv-KAWRT.
ENDIF.
ENDIF.
IF KOMV-kschl = 'FRA1'.
IF SY-subrc = 0.
lv_value = komv-kwert.
ENDIF.
ENDIF.
LOOP AT XKOMV WHERE kschl = 'BASB'.
IF SY-subrc = 0.
lv_VALUE1 = lv_value + komv-KAWRT.
IF lv_value1 is INITIAL.
* lv_value1 = 50400000.
TYPES: BEGIN OF ty_ekko,
ebeln TYPE ebeln,
knumv TYPE knumv,
END OF ty_ekko.
TYPES: BEGIN OF ty_konv,
knumv TYPE knumv,
KSCHL TYPE kschl,
KAWRT TYPE kawrt,
END OF ty_konv.
DATA : LV_EKKO TYPE TY_EKKO,
LV_KONV TYPE TY_KONV.
SELECT SINGLE ebeln knumv FROM ekko into lv_ekko WHERE ebeln = '4500018438'. "lv_ekko-ebeln.
SELECT SINGLE knumv kschl kawrt FROM konv INTO lv_konv WHERE knumv = lv_ekko-knumv
AND kschl = 'FRA1'.
lv_value1 = ( lv_konv-kawrt * 5 ) / 100 + lv_konv-kawrt.
endif.
Xkomv-kwert = lv_value1.
MODIFY XKOMV TRANSPORTING kwert WHERE kschl = 'BASB'.
export lv_value1 to MEMORY id 'ZKWERT'.
ENDIF.
ENDLOOP.
DATA: lv_kwert LIKE komv-kwert,
lv_value LIKE xkomv-kwert,
lv_value1 LIKE xkomv-kwert.
CLEAR: lv_value, lv_value1.
IF KOMV-kschl = 'PB00'.
IF SY-subrc = 0.
lv_value = komv-KAWRT.
ENDIF.
ENDIF.
IF KOMV-kschl = 'FRA1'.
IF SY-subrc = 0.
lv_value = komv-kwert.
ENDIF.
ENDIF.
LOOP AT XKOMV WHERE kschl = 'BASB'.
IF SY-subrc = 0.
lv_VALUE1 = lv_value + komv-KAWRT.
IF lv_value1 is INITIAL.
* lv_value1 = 50400000.
TYPES: BEGIN OF ty_ekko,
ebeln TYPE ebeln,
knumv TYPE knumv,
END OF ty_ekko.
TYPES: BEGIN OF ty_konv,
knumv TYPE knumv,
KSCHL TYPE kschl,
KAWRT TYPE kawrt,
END OF ty_konv.
DATA : LV_EKKO TYPE TY_EKKO,
LV_KONV TYPE TY_KONV.
SELECT SINGLE ebeln knumv FROM ekko into lv_ekko WHERE ebeln = '4500018438'. "lv_ekko-ebeln.
SELECT SINGLE knumv kschl kawrt FROM konv INTO lv_konv WHERE knumv = lv_ekko-knumv
AND kschl = 'FRA1'.
lv_value1 = ( lv_konv-kawrt * 5 ) / 100 + lv_konv-kawrt.
endif.
Xkomv-kwert = lv_value1.
MODIFY XKOMV TRANSPORTING kwert WHERE kschl = 'BASB'.
export lv_value1 to MEMORY id 'ZKWERT'.
ENDIF.
ENDLOOP.
Comments
Post a Comment