cancel
Showing results for 
Search instead for 
Did you mean: 

Purpose of FORM KOBED & FORM KOBEV

Former Member
0 Kudos

When I created a routine in VOFM->Requirements->Pricing with routine No. 901... A new include got generated with 2 Forms in it... FORM KOBED & FORM KOBEV..

Could anybody tell me what is the purpose of these 2 forms and which one will get triggered first?

Thanks in Advance

Accepted Solutions (1)

Accepted Solutions (1)

Rauno
Participant
0 Kudos

Hello

form Kobed is called on item level based on information of header and item

form Kobev is called on header level based on information of the header

SAP is doing price determination in several steps. in an early step form KOBEV is called. during this time of execution only header fields are available. If this information is sufficent to exclude the condition from pricing, you can save performance later on.

If KOBEV was succsessful (Sy-subrc = 0) SAP checks later on the form routine KOBED with header and item information. Only if Kobed is successful (sy-subrc = 0) pricing will be executed for this condition type. If there is no requirement entered for a condition type in pricing procedure, SAP will always try to determine a value for this condition type.

In the above mentioned Example of req. 2, Kobev is always successful and a detailed check happens only in KOBED.

Hope this help to understand the concept.

Regards

Rauno

Answers (2)

Answers (2)

Former Member
0 Kudos

I found a nice explanation in the other forum. Please check the link:

http://sapdude-sapsd.blogspot.com/2007/09/meaning-of-form-kobed002-and-form.html

Former Member
0 Kudos

Thanks for your response.

But my question is why always 2 forms get called? KOBED & KOBEV. In which form should I write what code?

What if I have requirement to check whether an entry exists in a table or not. In which form KOBED/KOBEV should I write the code and why?

Former Member
0 Kudos

FORM KOBED_002.

SY-SUBRC = 4.

IF KOMP-KPOSN NE 0 (KOMP- Pricing Communication Item KPOSN -Condition item no. in SO)

CHECK: KOMP-PRSFD CA 'BX'. (PRSFD - PRSFD Carry out pricing)

CHECK: KOMP-KZNEP = SPACE. (KZNEP -Condition exclusion indicator)

ENDIF

SY-SUBRC = 0.

ENDFORM.

  • Prestep

FORM KOBEV_002.

SY-SUBRC = 0.

ENDFORM.

For techiu2019s above program is self explanatory

Explanation:

The above routine u201C2u201D is included under Req column in Pricing Procedure. It means that system would first check whether the item category attached for an item in that condition item number in SO is relevant for pricing or not.

If the Item category is pricing relevant only then system will go to VK11 and fetch the price. On the contrary if req. column does not contain 2 as routine against a condition type system will not consider this parameter and would directly jump to VK11.

This routine improves system performance

Note: If an item category marked as NOT relevant for pricing system will not fetch price in the Sales order even if the condition records for the condition types are maintained.