SAP OSS Notes

379269 SAP OSS Note - Preference in SD doc: User exit: Set pref. indicator PREFE








SAP OSS Note 379269 version 0025 contains details of a know issue related to Preference in SD doc: User exit: Set pref. indicator PREFE. This includes any associated symptoms and instructions on how to fix it, see below for full details. Also check out the comments section to view/add related contributions, questions or screen shots, based on real life experience of this oss note and problem.

...For more information about the SAP support system known as OSS please check out the SAP OSS NOTES SECTION, whih includes how to download & implement them onto your SAP system using transaction code SNOTE.

Note 379269 Details:






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.



    Note 379269 Correction instructions:



    NOTE: Only source text changes are displayed here

    *$*$----------------------------------------------------------------$*$*
    *$ CORRECTION INSTRUCTIONS 0120061532 0000247512 $*
    *$--------------------------------------------------------------------$*
    *$ VALID FOR : $*
    *$ Software Component SAP_APPL SAP Application $*
    *$ Release 46A To SAPKH46A34 $*
    *$ Release 46B To SAPKH46B26 $*
    *$ Release 46C All Support Package Levels $*
    *$*$----------------------------------------------------------------$*$*
    *&---------------------------------------------------------------------*
    *& Object FUNC PREFERENCE_DETERMINE_SD
    *& Object header FUGR PREF
    *&---------------------------------------------------------------------*
    *& FUNCTION PREFERENCE_DETERMINE_SD
    *&---------------------------------------------------------------------*
    ...
    FUNCTION PREFERENCE_DETERMINE_SD.
    ...
    * PERFORMANCE
    * Praeferenz nur moeglich, wenn Abgangsland <> Bestimmungsland
    IF I_DEPARTURE_COUNTRY NE I_DESTINATION_COUNTRY.
    ...
    ENDIF.

    *>>>> START OF INSERTION <<<<
    * Versorgen bestimmter Felder
    if ( I_S_VBRP-VBELN is initial ) .
    I_S_VBRP = I_S_XVBRP.
    endif.
    if ( I_S_KOMK-gzolx is initial ).
    I_S_KOMK-gzolx = I_PREFERENCE_ZONE.
    endif.

    CALL CUSTOMER-FUNCTION '003'
    EXPORTING
    I_S_VBRP = I_S_VBRP
    I_S_KOMK = I_S_KOMK
    I_S_KOMP = I_S_KOMP
    CHANGING
    C_PREFERENCE_INDICATOR = C_PREFERENCE_INDICATOR
    EXCEPTIONS
    OTHERS = 2.

    *>>>> END OF INSERTION <<<<<<
    ...

    ENDFUNCTION.

    ...
    *&---------------------------------------------------------------------*

    Effected Objects:


    (FUNC) - PREFERENCE_DETERMINE_SD

    (FUNC) - PREFERENCE_DETERMINE_SD

    (FUNC) - RV_INVOICE_PRICE
    (FUNC) - RV_INVOICE_PRICE_PAI
    (REPS) - FV45PF0P_PREISFINDUNG
    (REPS) - LV60AA59
    (REPS) - LV60AA60
    (REPS) - MV45AF0P_PREISFINDUNG_GESAMT

    (FUNC) - PREFERENCE_DETERMINE_SD

    Solution instructions


    Please import the corrections attached to this OSS note into your SAP system using SNOTE.

    You can also view the full details of this OSS note and download it to your SAP system ready for implementation using transaction code SNOTE. Once it has been downloaded you can read the full details, check out any installation instructions including manual changes and see if there are any pre-requisites.

    You can also check if a new version of note 379269 has been released as well as see if the note is valid for your current SAP system landscape.

    Check if SAP OSS note 379269 has already been downloaded and is valid


    To check if this note has already been download, what status it has and if it is valid for your system first execute t-code SNOTE and click on the SAP Note Browser icon
    Icon used to execute SAP Note Browser report within SNOTE

    From here you can just enter the note number 379269 and press execute. If the note already exists it's details will be displayed. See here for full step by step instructions on how to check if an SAP note has been downloaded and is valid for your system.



    If note 379269 does not exist on your system you will receive the message "Unable to find SAP Note that meets specified criteria"
    Icon used to execute SAP Note Browser report within SNOTE

    If this is the case you will need to download the note to you SAP system also using transaction SNOTE. For further details see Download note using SNOTE. Even if it does exist you may still want to check if you have downloaded the latest version of the note.

    Alternatively you can find full details of this note on the SAP service market place(SNumber / Service market place login will be required)