Skip to Content

User Exit for sales order processing (Pricing) TKOMP

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 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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Oct 22, 2006 at 05:57 PM

    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.


    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member


      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' )



Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.