SAP ABAP IMG Activity W_PRICAT_IN_BADI_009 (BAdI: Add Sort Rules)
Hierarchy
EA-RETAIL (Software Component) SAP Enterprise Extension Retail
   SD-EDI (Application Component) Electronic Data Interchange
     WRF_VPRI_IN (Package) Price Catalog Inbound 2004
IMG Activity
ID W_PRICAT_IN_BADI_009 BAdI: Add Sort Rules  
Transaction Code S_PEN_05000109   (empty) 
Created on 20050509    
Customizing Attributes W_PRICAT_IN_BADI   BAdIs Price Catalog Inbound 
Customizing Activity W_PRICAT_IN_BADI_009   BAdI: Add Sort Rules 
Document
Document Class SIMG   Hypertext: Object Class - Class to which a document belongs.
Document Name WRF_PRICAT_SORT    

Use

Implement this BAdI if you require additional sort criteria alongside the standard sorting method at item level. When you have implemented this BAdI, the "Sort" pushbutton appears in online processing automatically. You can use this pushbutton to select different sort rules in online processing. You must define your own sort rules. In your BAdI implementation, you can select one of these sort rules as your default rule. The system chooses this sorting method automatically when you enter the PRICAT online transaction.

Requirements

The fields by which you want to sort must be located in the PRICAT items in the relevant working records.

Standard settings

The system sorts the PRICAT item table in accordance with the following fields and in the following sequence:

  • "GROUP" in ascending order
    Generic material, single material, or display block.
  • "SEQUENCE" in descending order
    '0','1' or '2': Generic material headers ('2') and master variant copy rows ('1') at the start of a block.
  • "GROUP4" in ascending order
    This field has to be filled in the BAdI method "GET_SORTFIELD" to affect the sorting method in a block.
  • "REFNR" in ascending order
    Takes account of EAN and date.
  • "LINETYP" in ascending order
    '13' for master data rows, '20' for original records and '30' for working rows so that this sequence will be followed when several rows are displayed.

In the standard system, the BAdI is not implemented and the online pushbutton "Sort" does not appear. The sort field GROUP4 is filled with the initial value. Bear in mind that you CANNOTchange the sort sequence specified here. By making the required entry in field GROUP4 for the various items, you can determine the sort result within the specified parameters.

Activities

Implement the BAdI methods GET_SORTRULES and GET_SORTFIELD.

In the method GET_SORTRULES, you name each of your sort rules and specify a rule as the "default" rule (see example implementation). For each sort rule, you must enter the required content of the field GROUP4 for the particular items in the BAdI method GET_SORTFIELD to attain the required sorting method in the groups. Bear in mind that the content of the field is always relevant for a block of identical EANs. In other words, a master data record, its original record, and the relevant working record are always assigned the same field content for the field GROUP4, so that they cannot affect this detailed structure.

Example

Copy the example implementation if you want to sort by color, size, or secondary size.

Business Attributes
ASAP Roadmap ID 257   Create User Exits 
Mandatory / Optional 2   Optional activity 
Critical / Non-Critical 2   Non-critical 
Country-Dependency A   Valid for all countries 
Maintenance Objects
Maintenance object type E   Business Add-In - Definition 
History
Last changed by/on SAP  20050509 
SAP Release Created in