User exit is sales order processing where all the line item data in accessible before saving the sales order, before USEREXIT_PRICING_PREPARE_TKOMP..
Objective is to fill the Z field in the TKOMP structure(in the line item level) with a value which can be determined from seeing all the line items.ie.. All the line item data should be visible in processing a single line item.
for example , if i have 5 materials with
material Pricing Group Zcount
M1 PG1 3
M2 PG2 2
M3 PG1 3
M4 PG1 3
M5 PG2 2
in the above example , i've five line items (materials ) where M1,M3,M4 belong to one pricing group PG1 and M2 and M5 belong to another pricing group. Now As 3 materials belong to one PG1 , the respecive line items should be filled the count value 3 (3 materials belogn to PG1 ) .
and based on the TKOMP values (material,sales org,zcount) , my pricing conditions are maintained.
here , when i've entered 5 line items and press "enter", i want to populate the M1 line item with 3 in the form USEREXIT_PRICING_PREPARE_TKOMP, i could not able to caliculate the zcount as 3 as i'm able to access only one line item in TKOMP and one line item in XVBAP. so i cannot get the visibility of all the line items.
so we need the right exit for this requirement before
USEREXIT_PRICING_PREPARE_TKOMP where all the line item visibility is there.