cancel
Showing results for 
Search instead for 
Did you mean: 

User Exit for sales order processing (Pricing) TKOMP

satishgunda
Product and Topic Expert
Product and Topic Expert
0 Kudos

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.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

in the USEREXIT_PRICING_PREPARE_TKOMP you have access to xvbap.

1. you can create your own Table

ixvbap[] = xvbap[].

and you can calculate your numbers of rows in a loop.

other possibility : the group-conditions ( Gruppenkonditionen ) on your pricing-group. There is a Structure for the group-prices avalible in the userexit - but i don't know the name at home by heart.

Hans

Former Member
0 Kudos

Hi,

Do you also actually want to calculate pricing based on that Z field ? ( because you only speak about 'before save' you want the fields to be filled ) IF not you should use other exit : USEREXIT_SAVE_DOCUMENT_PREPARE )

If yes, be aware that if you enter 5 items and thne press enter, you will go through this exit multiple times and xvbap will be gradually filled ( put break-point in function module 'PRICING' )

regards

Dirk