0% found this document useful (0 votes)
274 views3 pages

General Overview of Function Module Pricing - Complete - ERP SD - SCN Wiki

General Overview of Function Module Pricing

Uploaded by

wiwins
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
274 views3 pages

General Overview of Function Module Pricing - Complete - ERP SD - SCN Wiki

General Overview of Function Module Pricing

Uploaded by

wiwins
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

General overview of function module pricing_complete - ERP SD - S... http://wiki.scn.sap.com/wiki/display/SD/General+overview+of+functi...

Getting Started Newsletters Store

Welcome, Guest Login Register Search the Community

Products Services & Support About SCN Downloads

Industries Training & Education Partnership Developer Center

Lines of Business University Alliances Events & Webinars Innovation

ERP SD / / SD Pricing Troubleshooting

General overview of function module pricing_complete


Created by Alex Zheng, last modified on Jul 07, 2015

Purpose
In order to make deeper analysis, it's necessary to get some basic technical info regarding header condition and group condition functionality in SD pricing. Provide some overview info about the main
program related to this functionality.

Overview
General introduction
Important internal tables of function module pricing_complete
How does pricing_complete work in general?

General introduction about pricing_complete


Includes all logic needed to handle group condition/header condition functionality.
Build up groups
Cumulation of scale base for group conditions
Duplication of header conditions
Distribution of group conditions of calculation type B Fixed amount
Rounding difference comparison
Handling of structure conditions
Fixation of header conditions during partial billing
Performance critical function, therefore only called if really needed (save document, jump into header condition screen, determine scale base for group conditions)

Important internal tables of pricing_complete


TKOMK: header information

TKOMP: all document items

TKOMV: complete pricing result (all items, all condition lines)

GKOMV: group table

Has a large key (e.g. KSCHL, KNUMH, KOPOS, KRECH, KNTYP, KHERK, KSTEU, MESK1)
Key contains also a variable key (VAKEY), which can be affected by group key routines
All TKOMV entries with identical key are in the same group
One GKOMV entry for each group
Contains fields for cumulation (e.g. KAWRT, SUMPS, KWERT, KWERT_K)

GKOMZ: index table

Important for control of the group processing


Contains only STUNR, IX_GKOMV, IX_KOMV, ZAEHK, IX_KOMP and KRECH
Connects GKOMV, TKOMV and TKOMP via table index number (pointers)
Allows to calculate group wise (sorted by IX_GKOMV) and to distribute the group conditions to the items

Used pricing types:

A if you go to header condition screen. Process rounding difference comparison and group conditions.

E if you leave the header condition screen or if the Activate button is pressed. Used to distribute conditions entered on header level into items. Also includes the functionality of A.

How does pricing_complete work in general?


Function module pricing_complete mainly consists of 4 parts.

Part 1: pricing for all items:

*---------------------------------------------------------------------*

* fix header conditions after invoicing *

* KOMP-KAEND_TYP = '*' *

*---------------------------------------------------------------------*

PERFORM fixieren_kopfkond_kopf.

1 of 3 21/01/2016 23:17
General overview of function module pricing_complete - ERP SD - S... http://wiki.scn.sap.com/wiki/display/SD/General+overview+of+functi...

LOOP AT tkomp.

(item pricing)

ENDLOOP.

*---------------------------------------------------------------------*

* condition exclusion B: exclude condition, if they do not occur *

* on all items of an item group (komp-bergl and komp-vhart) *

*---------------------------------------------------------------------*

PERFORM tkomv_exklude_k.

Part 2: Build up groups

*---------------------------------------------------------------------*

* build GKOMV per item *

*---------------------------------------------------------------------*

LOOP AT tkomp INTO komp.

READ TABLE tkomv WITH KEY knumv = komk-knumv

kposn = komp-kposn

BINARY SEARCH TRANSPORTING NO FIELDS.

IF sy-subrc EQ 0 AND komp-kowrr EQ space.

tabix = sy-tabix.

LOOP AT tkomv FROM tabix.

LOOP AT gkomv.

MODIFY gkomv.

APPEND gkomv.

ENDLOOP.

Part 3: Calculation on header level based on groups

*---------------------------------------------------------------------*

* calculate group conditions *

*---------------------------------------------------------------------*

CLEAR xkomv.

CLEAR komk.

CLEAR komp.

LOOP AT gkomv.

PERFORM gkomv_bewerten.

ENDLOOP.

*---------------------------------------------------------------------*

* header exclusion of type A *

*---------------------------------------------------------------------*

PERFORM tkomv_exklude_l CHANGING recalculate.

2 of 3 21/01/2016 23:17
General overview of function module pricing_complete - ERP SD - S... http://wiki.scn.sap.com/wiki/display/SD/General+overview+of+functi...

Part 4: Distribute to the items

LOOP AT gkomz.

(item pricing with type F)

ENDLOOP.

In case that you want to have some more detailed information regarding how to do the technical analysis for an issue in header condition/group condition functionality, you may refer to the WIKI page: How
to perform technical analysis for group condition and header condition issue

Related Content
Related Documents
How to perform technical analysis for group condition and header condition issue

Related SAP Notes/KBAs


No labels

Contact Us SAP Help Portal


Follow SCN
Privacy Terms of Use Legal Disclosure Copyright

3 of 3 21/01/2016 23:17

You might also like