- January 20, 2026
- Kishore Thutaram
-
- 0
Fulfill the condition record in Sales pricing based on a rule maintained in custom table by using pricing routine
This QuickFix explains how to control Sales Order confirmation output in SAP using an Output Control routine.
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: TYPE vbrp.
lv_subrc = 0.
ASSIGN ('(SAPLV60A)VBRP') TO .
IF ( sy-subrc = 0 ) AND ( 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 = -zz1_brand_bdi
product_type = -zz1_prodtype_bdi
product_group = -zz1_prodgrp_bdi ] ).
*--*Fulfil the condition type maintained for the Departure and destination countries in custom table
DATA(ls_kschl) = lt_kschl[ brand = -zz1brand_bdi
product_type = -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.





















