When does this problem occur
As part of the preference processing in the SD document (order, billing
document), the preference indicator (VBAP-PREFE, VBRP-PREFE) is set in
the preference determination.
This takes place within pricing in the above SD documents by comparing
the ex works price (VBAP-NETWR, WBRP-NETWR) with the preference
threshold price, which is set in the condition type PREF as part of
preference determination.
So that the preference indicator is set, the ex works price must be
higher than or equal to the preference threshold price.
For certain business transactions (for free-of-charge deliveries, for
example), the ex works price may not be filled, or this condition may
not be not fulfilled or may have to be replaced by other conditions or
logic.
After you implement this note, you can also fill the preference
indicator (VBAP-PREFE, VBRP-PREFE) in the SD document by means of a user
exit or, as of Basis Release 7.0, by means of a BAdI, in which you can
then implement your own conditions.
For this, all of the information from the communication work areas of
pricing is available to you:
KOMK - Pricing Communication Header
KOMP - Pricing Communication Item
In addition, the information from the billing item VBRP is available to
you in the billing document.
Description of problem
Preference processing
Customs tariff preferences
Comparison: Ex works price <(><<)>> preference threshold price
(preference price)
Preference determination in the SD document
VA01, VA02
VF01, VF02
VBAP-PREFE, VBRP-PREFE
SAPLPREF
Function module PREFERENCE_DETERMINE_SD
Cause of the problem and Pre-requisites
This is an advance function. The function was previously not provided.
Solution instructions
Implement the source code corrections as described in the correction
instructions. Save your changes and regenerate the programs SAPFV45P,
SAPMV45A, SAPLV60A und SAPLPREF (transaction SE38).
Before this>,
you must carry out the following steps. Make sure that you choose the
correct Basis Release.
All releases
You must add four import parameters to the interface of the function
module PREFERENCE_DETERMINE_SD.
Transaction: SE37
Function module: PREFERENCE_DETERMINE_SD
Choose "Change" and go to the IMPORT parameters:
Situation BEFORE the change:
Parameter name Type spec Assoc Type Default Value Opt Value
----------------------------------------------------------------------
I_DEPARTURE_COUNTRY LIKE KOMK-ALAND ' ' x x
... ... ... ... ... ...
I_NET_VALUE LIKE KOMP-NETWR '0.00' x x
Situation AFTER the change:
Parameter name Type spec Assoc Type Default Value Opt Value
----------------------------------------------------------------------
I_DEPARTURE_COUNTRY LIKE KOMK-ALAND ' ' x x
... ... ... ... ... ...
I_NET_VALUE LIKE KOMP-NETWR '0.00' x x I_S
_XVBRP LIKE VBRPVB x x I_S_VBRP
LIKE VBRP x x I_S_KOMK
LIKE KOMK x x I_S_KOMP
LIKE KOMP x x
Save
your changes and generate the function group SAPLPREF (transaction
SE38).
Make sure that the source code is adjusted accordingly for all
callpoints of the function module PREFERENCE_DETERMINE_SD and that the
new parameters mentioned above are provided with data in the context.
The callpoints are traceable via the where-used list.
Basis Release earlier than 620
You must include the new function module exit EXIT_SAPLPREF_003 in the
SAP enhancement project MVEIPREF.
Call transaction SMOD and enter MVEIPREF as the enhancement.
Select "Components" and choose "Change".
On the next screen, enter the function module EXIT_SAPLPREF_003 under
"Function module exits". Position the cursor on the entry EXIT
_SAPLPREF_003 and choose "Edit --> Choose".
In the following dialog box, enter the following: Function module:
EXIT_SAPLPREF_003
Function group: XMF1
Short text: Customer enhancement: Set preference indicator in
SD document
Confirm and save your entries.
Call transaction SE37 and add three IMPORT parameters and one CHANGING
parameter to the new function module EXIT_SAPLPREF_003.
Choose "Change" and go to the
IMPORT parameters:
Situation
after the change: ============================
Parameter name Type spec Assoc Type
Default Value Opt
---------------------------------------------------------- I_S_VBRP
LIKE VBRP SPACE x I_S_KOMK
LIKE KOMK ' ' I_S_KOMP
LIKE KOMP ' '
Caut
ion:
The "Associated Type" column in Releases 4.0 and 4.5 is the same as
"Reference field/structure".
Go to the
CHANGING parameters:
Situation
after the change: ============================
Parameter name Type spec Assoc Type
Default Value Opt --------------------
----------------------------------------- C_PREFERENCE_INDICATOR LIKE
VBAP-PREFE ' '
Ca
ution:
The "Associated Type" column in Releases 4.0 and 4.5 is the same as
"Reference field/structure".
Save your changes and generate the function group SAPLXMF1 (transaction
SE38).
Basis Release 6.20 or 6.40
For
this, you must implement a BAdI instead of a user exit.
Call transaction SE18 to start the "BAdI Builder: Initial Screen for
Definitions".
Enter PREFERENCE as the BadI description and choose "Create".
Enter "Preference" as the short text for the definition. Transfer and
save your entry. Assign the object to the package VEI.
Switch to the "Interface" tab page and double-click the interface name
IF_EX_PREFERENCE.
You should now be in the function "Class Builder: Change Interface" on
the "Methods" tab page.
Enter the new method PREFERENCE_DETERMINE with the description
"Determine preference indicator". Select the new entry. Choose
"Parameters"' to switch to parameter maintenance for the method.
Maintain the following parameters for the method PREFERENCE_DETERMINE:
Parameter,,,,,,,,Type,,,,,,P.,,Op. Typ. ,,Ass. Type
----------------------------------------------------------------
I_S_VBRP,,,,,,,,,,Importing,,' ' 'X',,Type,,,,VBRP,,,,
I_S_KOMK,,,,,,,,,,Importing,,' ' ' ' Type,,,,KOMK
I_S_KOMP,,,,,,,,,,Importing,,' ' ' ' Type,,,,KOMP
C_PREFERENCE_INDICATOR,,Changing ,,' ' ' ' Type VBAP-PREFE,, ,,
Save your entries and activate the objects.
Refer to the documentation for further information about creating,
editing, and deleting enhancement implementations.
Basis Release higher than 640 or Release 7.0 of the SAP NetWeaver
Application Server ABAP (SAP NetWeaver 2004s). For this, you must
implement a BAdI using an enhancement spot. To do this, proceed as
follows:
Call transaction SE18 to start the "BAdI Builder: Initial Screen for
Definitions".
Select "Enhancement Spot", enter ES_PREFERENCE as the description, and
choose "Create".
As the short text, maintain "Enhancement Spot: Preference". The field
"Composite Enhancement Spot" remains empty. Transfer the entry and
assign the object to the package VEI. Save your entries.
You should now be in the function "Change Enhancement Spot".
On the "Enhancement Spot Element Definitions" tab page, choose "Create
BAdI". Enter PREFERENCE_DETERMINE_SD as the name and enter "Determine
preference indicator" as the short text. Transfer your entries.
In the BAdI definition on the left, expand the tree and call the data
view for the interface.
Maintain the value IF_PREFERENCE_DETERMINE_SD for the interface.
Transfer the entry and assign the object to the package VEI.
You should now be in the function "Class Builder: Change Interface" on
the "Methods" tab page.
Enter the new method PREFERENCE_DETERMINE with the description
"Determine preference indicator".
Select the new entry. Choose "Parameters"' to switch to parameter
maintenance for the method.
Maintain the following parameters for the method METHODE_1:
Parameter,,,,,,,,Type,,,,,,P.,,Op. Typ. ,,Ass. Type
----------------------------------------------------------------
I_S_VBRP,,,,,,,,,,Importing,,' ' 'X',,Type,,VBRP,,
I_S_KOMK,,,,,,,,,,Importing,,' ' ' ' Type,,KOMK
I_S_KOMP,,,,,,,,,,Importing,,' ' ' ' Type,,KOMP
C_PREFERENCE_INDICATOR,,Changing,,' ' ' ' Type,,VBAP-PREFE
Save your entries and activate the objects.
Refer to the documentation for further information about creating,
editing, and deleting enhancement implementations.