- January 8, 2026
- Admin
- 0
Steps :
Go To transaction VOFM
Select Requirements->Pricing
Create a new requirement routine by selecting new entries in change mode.
Ex: 901 – Recommended the routine number starts with 9
Assign the newly created routine in pricing procedure against the condition type-requirement column.
Logic inside the routine
DATA: lv_subrc TYPE sy-subrc,
lt_kschl TYPE TABLE OF ztable.
FIELD-SYMBOLS: <lfs_vbrp> TYPE vbrp.
lv_subrc = 0.
ASSIGN ('(SAPLV60A)VBRP') TO <lfs_vbrp>.
IF ( sy-subrc = 0 ) AND ( <lfs_vbrp> IS ASSIGNED ).
*--*Check the Departure and Destination Country
IF komk-aland IS NOT INITIAL AND komk-land1 IS NOT INITIAL.
*--* Fecth and cross check Departure and destination countries
SELECT * FROM ztable
INTO TABLE lt_kschl
WHERE dept_country = komk-aland AND dest_country = komk-land1. "lv_dest_cntry..
IF lt_kschl IS NOT INITIAL.
IF line_exists( lt_kschl[ brand = <lfs_vbrp>-zz1_brand_bdi
product_type = <lfs_vbrp>-zz1_prodtype_bdi
product_group = <lfs_vbrp>-zz1_prodgrp_bdi ] ).
*--*Fulfil the condition type maintained for the Departure and destination countries in custom table
DATA(ls_kschl) = lt_kschl[ brand = <lfs_vbrp>-zz1brand_bdi
product_type = <lfs_vbrp>-zz1_prodtype_bdi
].
IF ls_kschl-kschl EQ komt1-kschl."Current condition type
lv_subrc = 0.
ELSE.
lv_subrc = 4.
ENDIF.
ENDIF.
ENDIF.
sy-subrc = lv_subrc.






