cancel
Showing results for 
Search instead for 
Did you mean: 

Discount on Total Order Value

Former Member
0 Kudos

Hi everybody ,

We need the Discount to be calculated automatically on the Total Order Value.

Its a promotion.

Useful suggestions will be rewarded.

Thanks

Kartik

Accepted Solutions (1)

Accepted Solutions (1)

former_member183879
Active Contributor
0 Kudos

Hi Karthik,

If there are multiple items in ur order, then i think you want to give a discount on the document value as a whole(not for individual items). In order to achieve this, do the following.

1.Create a condition type, which is a discount

2. Write an alternate condition base value routine in VOFM and enabling your logic in that routine passing the total order value as condition base value

3. In the meantime, maintain the %of discount for that condition type in condition records.

4. Now when you create the order, you can see this condition type having the value as per your requirement.

Pls assign reward point if this helps

Answers (4)

Answers (4)

Former Member
0 Kudos

hey i think NRAB procedure wud help

check it out but i will get back to u in a day

NRAB is in NVA001 pricing procedure.

r k006 any ways i will get back to u

regards

vijay

Former Member
0 Kudos

Hi ,

Thanks for the response. Do you have any standard routine to use in the pricing procedure ?

Otherwise do u have a document on how to write a routine ?

Would appreciate a response asap.

Thanks

Cheers

Kartik

Former Member
0 Kudos

Hi pls follow the procedure below, Hope it will help u out

VOFM: ON PRICING

This note is an explanation of function "Maintain: Requirements and Formulas", which is also known as "VOFM".

By using descriptions and examples, this note explains how the VOFM function works in the R/3 Standard System, which objects are related to it and which restrictions exist.

Chapter 2.7 explains possible causes of errors and solutions for problems with the VOFM function.

To provide a good overview, this note is subdivided into the following sub areas:

1. General information

1.1 Definition of terms

1.2 Application areas

1.3 A frank word on the "source code responsibility"

2. Technology

2.1 Introduction

2.2 Namespaces

2.2.1 SSCR object registration

2.3 Structure of a VOFM object

2.3.1 Include file with ABAP form routine

2.3.2 Table entries in TFRM and TFRMT

2.4 Calling VOFM objects

2.4.1 VOFM object carrier

2.5 Activation, generation and RV80HGEN

2.6 Transport

2.7 FAQs: Possible causes of errors and problems

Technical field names are displayed in angle brackets [].

Note that this note only explains the mode of operation of the VOFM in an R/3 Standard Core System.

For R/3 industry solutions or Add-Ons the VOFM function displays a different behavior in subareas, however, this is not dealt with in this note.

Additional key words

VOFM, SAPMV80H, TFRM, TFRMT, RV80HGEN, XPRA, formulas, requirements, data transport routine, copy routine, data transfer.

Cause and prerequisites

1. General information

1.1 Definition of terms

Depending on the business processes used it may be necessary to influence the standard behavior of R/3 applications. For that purpose the VOFM function provides a corresponding environment in order to be able to develop and manage customer-specific logic simply.

The system stores the objects generated via the VOFM in the Customizing of the respective application area

(Pricing, message determination and so on) and its programs call the objects correspondingly.

Also SAP delivers certain functions in the form of VOFM objects.

Consequently, the VOFM is an exit technology as explained in more detail in Note 381348.

1.2 Application areas

Typical VOFM objects are requirements, formulas and data transfer routines.

These are used in processes of the purchase order, the delivery, billing, price determination, material determination, message determination, the free goods, the pricing and of others.

In the entries of the R/3 core menu of Transaction VOFM you can find a precise overview of the supported application areas.

1.3 A frank word on the "source code responsibility"

As in user exits, in VOFM objects are many fields and tables available. Thus, the use of VOFM objects is very versatile and consequently also very critical under certain circumstances. For the use of "customer-specific" VOFM objects the statements in Note 381348 regarding the responsibility for customer enhancements (Maintenance responsibility, problems during the upgrade and so on) apply. Read this note carefully before you decide on the use of customer-specific VOFM objects.

Errors and data inconsistencies that are caused by improper application or implementation of VOFM objects are not processed by the SAP Support but exclusively within the framework of the Consulting that has to be purchased separately.

2. Technology

2.1 Introduction

A VOFM object is uniquely defined via characteristics "group indicator" [GRPZE] and "group number" [GRPNO].

Here the group indicator, technically represented by a character field of length 4, is the logical connection to the calling environment.

Examples:

ABED copying requirement in the order

ADAT data transfer in the order

PBED requirements pricing

CASC Data transfer for sales activities

PBEK requirements account determination

CHRG requirements batches

REAK archiving for orders

VFCL Multi-dimensional scales

...

You can find all defined group indicators in the allowed values of the "GRPZE" domain in the ABAP Dictionary (Transaction SE11).

The group number can have a value from 1 to 999.

Exceptions are group indicators "PSTK" (= group key routine pricing) and "TDAT" (= data transfer for texts). For these the system can only assign group numbers from 1 to 99.

2.2 Namespaces

The VOFM has separate number ranges in order to distinguish VOFM objects delivered by SAP from customer-specific VOFM objects. These number ranges are often also called "VOFM namespaces".

However, note that this is not a "real namespace" that is protected by corresponding entries in system table "TRESC" (= reserved names for Customizing tables and Customizing objects).

Instead, only the VOFM logic itself does the definition and check of the number ranges.

The following list displays the customer number ranges sorted according to group indicators:

Indicator Name Number range customer

FOFU Subsequent functions 900 - 999

PSTK Group key routines 50 - 99

TDAT Data transfer routines f. texts 50 - 99

all other group indicators 600 - 999

In Note 356737 you can find more information on the available VOFM number ranges.

2.2.1 SSCR object registration

VOFM objects are subject to SSCR registration (= SAP Software Change Registration).

The reason for that is the necessity that every VOFM object is physically assigned to that SAP development class, from whose programs a corresponding jump into the VOFM object later occurs.

If you use the VOFM interface the system makes the assignment automatically. An assignment of customer-specific development classes is not possible.

2.3 Structure of a VOFM object

A VOFM object consists of the following parts:

Include file with ABAP form routine

TFRM table entry

TFRMT table entry

2.3.1 Include file with ABAP form routine

In the ABAP form routine the desired function is programmed.

Example pricing value formula number 001:

Include name : FV64A001

Form routine : FRM_KONDI_WERT_001

Implementation: * * Profit margin considering rebate agreements

form frm_kondi_wert_001.

xkwert = komp-kzwi3 - komp-wavwr.

endform.

Dependending on the selected group indicator, the group number and the system type (SAP or customer system), the system assigns and generates the include name and form routine name automatically.

For this reason, standard routines delivered by SAP generally have a different structure of the include name than customer-specific routines.

Example:

SAP standard value formula for the pricing

=> prefix FV64A + object number with 3 places from 'SAP namespace'

=> for example FV64A001

Customer-specific value formula for the pricing

=> prefix RV64A + object number with 3 places from 'customer namespace'

=> for example RV64A905

2.3.2 Table entries in TFRM and TFRMT

The entries in tables TFRM and TFRMT belonging to a VOFM object are used for the status management and assignment. The system always analyzes them if the user calls Transaction VOFM or if a generation operation occurs (for details refer to section 2.5).

The system generates exactly one TFRM table entry per VOFM OBjekt. In this TFRM entry the following information is stored:

Group indicator GRPZE

Group number GRPNO

Routine 'active' indicator AKTIV_TFRM

Application KAPPL

Date of the last generation GNDAT

Time of the last generation GNZEI

Examples:

GRPZE GRPNE AKTIV_TFRM KAPPL GNDAT GNZEI

PBED 001 X V 06 13 2001 09 06 39

TDAT 001 X 06 13 2001 09 06 39

CHRG 003 X 06 13 2001 09 06 39

... ... ... ... ... ...

The meaning of group indicators and group numbers has already been dealt with.

The 'active indicator' controls whether a VOFM object is 'active' or 'inactive'. Active VOFM objects have characteristic value AKTIV_TFRM = 'X', inactive objects have characteristic value AKTIV_TFRM = initial.

VOFM objects flagged as 'active' are 'known' to the calling program logic, that means they were included in the main program of the 'calling program' and can thus be addressed and

processed during the runtime.

You cannot delete VOFM objects that are still 'active'. In this case you have to reset the active indicator manually before.

The content of the 'Application' field serves to filter the relevant VOFM objects in various display functions and Customizing functions.

Example: Condition value formula 010 'Relevant Price'. This formula has characteristic value 'MS' for the 'Application' field (= External Services Management purchasing). Therefore the object is not open for selection in the input help during the maintenance of pricing procedure SD (Transaction V/08), because this is a Customizing transaction assigned to application 'V' (= Sales and Distribution).

Storing an application key is optional.

The generation date and the generation time record the time of the last registration of the VOFM object (the object carrier, refer to section 2.4.1).

In addition to the respective TFRM entry a VOFM object can have 'n' entries in table TFRMT. The entries are used for the storage of language-dependent object descriptions, which are structured as follows:

- Language key [SPRAS]

- Group indicator [GRPZE]

- Group number [GRPNO]

- Description [BEZEI]

Examples:

SPRAS GRPZE GRPNO BEZEI

D PBED 001 Regulierer abweich

E PBED 001 Different payer

... ... ... ...

The system supplies the language key automatically with the logon language of the user during the creation of a new VOFM object.

The length of the object description is limited to 20 characters.

Important! A VOFM object is only consistent if both the Include file with ABAP form routine and a corresponding TFRM table entry exist. Entries in table TFRMT are optional.

2.4 Calling VOFM objects

As mentioned above, VOFM objects are called directly by the application logic of R/3 standard programs. Technically this is implemented by ABAP statement 'PERFORM ... IN PROGRAM'. With the aid of this statement you can specify both the name of the subroutine and the main program dynamically (during the runtime).

Example: Call of a condition value formula from the pricing

...

if xkomv-kofrm ne 0. <<< formula reference existing?

xkwert = xkomv-kwert. <<< act. value in work variable

frm_kondi_wert-nr = xkomv-kofrm. <<< set up object names

perform (frm_kondi_wert) in program saplv61a if found. <<<CALL

xkomv-kwert = xkwert. <<

endif.

...

In the example above the subroutine is determined by the contents of variable 'FRM_KONDI_WERT'; the main program, which is to be searched for the form routine, is SAPLV61A.

If the called routine is not known in the main program, a program termination with the title 'PERFORM_NOT_FOUND' occurs.

Therefore some users of the VOFM technology call ABAP statement 'PERFORM ... IN PROGRAM' together with the addition 'IF FOUND', which has the effect that a jump into the form routine is only executed if this in fact exists in the main program. This does indeed prevent a program termination, however, the result of the overall process may deviate from the

result expected by the user, because in this case the system does not execute the source code implemented in the VOFM object.

2.4.1 VOFM 'object carrier'

Object carriers are required to make a VOFM object 'known' in the main program of the calling program (refer to section 2.4). The object carrier is integrated in the main program of the calling program as an independent include (for example SAPLV61A, SAPMV45A and so on).

Example: Inclusion of object carriers for word processing in SD

documents; Program 'SAPLV45T'

...

*******************************************************************

  • System-defined Include-files. *

*******************************************************************

INCLUDE LV45TTOP. "Global Data

INCLUDE LV45TDEF.

INCLUDE LV45TUXX. "Function Modules

INCLUDE LV45TNNN. <<< 'carrier' copy requirements for texts

INCLUDE LV45TENN. <<< 'carrier' copy routines for texts

...

Every active VOFM object (for an explanation on the active indicator refer to section 2.3.2) must be registered in the 'carrier'.

The system writes standard VOFM objects delivered by SAP directly into the 'carrier', VOFM objects from the number range reserved for customers (refer to section 2.2 'Namespaces') are sorted into a 'sub-include' included in the carrier.

Exactly one carrier exists per group indicator. The names of all defined object carriers are hard-coded in program MV80HF0A, form routine 'AKTIVIEREN_TRAEGER_SETZEN'.

Here the names of the sub-include for customer-specific VOFM objects belonging to the main carrier are also defined.

Example: Carrier object 'FV63ANNN' for the registration of condition basis formulas in the pricing (Program SAPLV61A)

FV63ANNN

<<< main

carrier-include

|-INCLUDE RV63ANNN. "User-Routinen <<< sub-include customer objects

| |- INCLUDE RV63A910. "Customer specific

| |- INCLUDE RV63A911. "Customer specific

| |- INCLUDE RV63A912. "Customer specific

| |- ...

|- INCLUDE FV63A001. "Volume

|- INCLUDE FV63A002. "Net value

|- INCLUDE FV63A003. "Net Price

|- INCLUDE FV63A004. "Net Value Plus Tax

|- INCLUDE FV63A005. "KZWI1

|- ...

Because the content of the VOFM object carriers is automatically created source code, you should avoid manual changes to them.

SAP notes, which suggest manual changes to the object carriers, are therefore also incorrect. However, if you nevertheless receive such a note to solve a problem, contact the SAP

Support with a reference to this note.

2.5 Activation, generation and RV80HGEN

The 'activation' is the inclusion of an VOFM object in an object carrier. A 'deactivation' results in the removal of the VOFM object from the object carrier.

The overall process for the creation of a current object carrier is often called 'generation'.

Generally the activation or generation fall into three types.

- Individual activation

- Collective activation

- Generation of object carriers via report RV80HGEN

The 'individual activation' causes the registration of an individual VOFM object in the corresponding object carrier. Which object carrier is relevant is determined with the aid of the group indicator and the group number. In addition to the entry of the VOFM object in the object carrier the system writes the date and time of the generation into table TFRM (refer also to section 2.3.2).

You can start the individual activation only manually. It is always always executed when a user selects a line within the VOFM editing interfaces and afterwards selects activity

'Activate' from the 'Edit' menu.

The 'collective activation' causes the registration of all VOFM objects that belong to a certain group indicator. Analog to the individual activation the system determines the relevant object carrier automatically and writes date and time into table TFRM. The 'collective activation' is a process which you can start also only manually. For this purpose, choose activity

'Activate all' from the 'Edit' menu.

During the generation via report RV80HGEN the system sets up the object carriers of all defined group indicators again. However, the system includes only those VOFM objects that have set the 'active' indicator in the corresponding TFRM table entry. Nonactive VOFM objects are not included in object carriers during the generation via report RV80HGEN.

Due to the quantity of the data to be processed,

the generation via RV80HGEN can take between 0,5 and >5 minutes (depending on the system and the constellation).

Because the RV80HGEN is defined as 'XPRA', it is executed automatically during a system upgrade.

You can also use this XPRA feature for the transport of VOFM objects in order to implement an automatic update of the object carriers after the import of VOFM objects into the target system (section 2.6 provides more details on the transport).

Both the collective activation and the activation via report RV80HGEN technically revert to the program components of the individual activation. For the separate control of the individual activation types form routine AKTIVIEREN_EINZELN (Include MV80HF0A) has a 'USING' parameter, which can have the following characteristic values:

'E' Activate individually

'A' Activate all (= collective activation)

' ' Deactivate individually

During the generation via RV80HGEN the system executes a collective activation for every group indicator sequentially, that means a call of form routine

AKTIVIEREN_EINZELN with characteristic value 'A'.

2.6 Transport

If you want to transfer VOFM objects from one system (= source) into another system (= target), this is generally made with an object transport.

As of Release 4.0, the VOFM function has a connection to the SAP 'Change and Transport System' (CTS) in order to simplify the transfer process for the user.

By the transport connection the system automatically adds newly created or changed VOFM objects to the object list of a transport request which was selected by the user before.

All steps necessary for the execution of a VOFM transport are described in detail in Note 22808 'Transferring formulas'. Note that steps 1-4 are only needed

if the VOFM maintenance environment providesno automatic connection to the transport system or if you want to combine a transport request manually. In any case you must execute step 5, regardless of how the transport request was created.

In addition to Note 22808, Note 385067 contains an overview for releases >= 4.6C regarding which sorts of tasks and object entries are required in a

transport request (depending on the activity carried out (create/change/activate/deactivate/delete)) in order to transport a VOFM object successfully.

Former Member
0 Kudos

Dear Kartik,

http://help.sap.com/saphelp_crm30/helpdata/en/b8/9c7d3935563957e10000000a11402f/content.htm

Also, check OSS note 89406.

Hope this will help.

Regards,

Naveen.

Former Member
0 Kudos

hi,

you can use Percent discount - HA00. Its a header condition. depending on the order value you can give the discount. Also check for HM00- order value.

hope it helps

Sadhu Kishore

Former Member
0 Kudos

Hi ,

The Condition you are referring to is manual , but I want the system to automatically determine.

Please have a look.

Thanks

Cheers