Sapass

 Simplify SAP R/3 development with Excel VBA/VB RFC  
Home> Bapi>SiteLayoutModule



Index

SiteLayoutModule

SiteLayoutModule


The object Layout module is a grouping together of materials that are to be placed together in layouts.



Structure
The layout module items each contain a material and, if required, the
unit of measurement in which it occurs.
The items can be sorted according to the sequence in which they are placed.


11-Dec-2005


Methods

Available Methods


  • Change : Change items of a layout module [ BAPI_SITELAYMOD_CHANGE ]
  • GetItem : Material data for a layout module [ BAPI_SITELAYMOD_GETITEMS ] (Obsolete in 46A)
  • GetItems : Material data for a layout module [ BAPI_SITELAYMOD_GETITEMS2 ]
  • SaveReplica : Save copy (distribution via ALE) [ BAPI_LAYMOD_SAVEREPLICA ]

11-Dec-2005


Change

Change


This method is used to update the material master data and movement data optimized in the space management program in SAP Retail.

The following data can be transferred to SAP Retail:

  • Master data:
    Material number, unit of measure, EAN/UPC, material dimensions, sort
    sequence in shelf, shelf section, horizontal facing, vertical facing,layout module variant and exclusion indicator. Exclusion means that thematerial is not included in the layout module variant, that is to say, not placed on the shelf.
  • Movement data:
    Maximum shelf quantity, optimum shelf quantity, presentation quantity.

  • Import parameters

  • Layout module parameter SiteLayoutModule and
  • Structu Controls, which contains the following fields:
  • A plant for which any listing conditions are to be created

  • The path for the planogram file assigned to the layout module
  • A plant, if required
  • The requirement group
  • An indicator showing whether a listing check is to be run

  • An indicator showing whether dimensions are to be updated
  • An indicator showing whether the placement data is to be updated
  • The validity dates for listing materials assigned to the layout module.
    This date is used as the validity date for the layout module version. If the field is empty, the system date is used instead.
  • An indicator showing whether update is to be started from this BAPI
  • An indicator showing whether a check against layout module and layout and plant is to be run

  • A mapping variant. Different mapping variants are defined in thecustomer exit. They can be accessed for every call. For example, onemapping variant can map the movement data and another can cumulate it.
  • An indicator showing whether the materials concerned are to be listed

  • An indicator showing whether the layout module version is to be released immediately
  • A layout module variant to which certain materials are to be assigned
  • A layout module version. If no version is entered, the 'Valid-from'
    date can be used instead to determine the version.
  • An indicator showing whether 'Valid-from' date is to be used to determine the version.
  • Import and consistency check

    The Items table is imported for the optimized material data.


    First, additional header data is read for the selection data and checked for consistency. The imported material numbers are thencompared with the material numbers in SAP Retail. If a material number in the Items table does not exist in SAP Retail, an additional check is run to find any materials with the same EAN/UPC. If no such
    material is found, the the system deletes the material in question fromthe table. In this case, the system also records the material in anerror log to inform the calling program which material postings led to errors.

    In the error log, the system also records cases where a plant in the
    plant import table did not assign the relevant layout module for theassignment of layout module variants, or where the plant does not exist.

    Finally, the system checks whether the materials are in the validlisting period or sales period. The start date of listing for the layout module in structure Controls
    is used as the check date. If materials of the import table are not listed or on sale on the datein question, an entry is made in the error log for the method.

    Updating optimized data

    The following data is updated after the checks:


  • Date on which the relevant layout module was optimized last
  • Update of material dimensions
  • Update of layout module version
  • Update and assignment of layout module variant
  • Update of material placement in the layout module

  • Values <> 0 are also updated, as materials that did not have a placeassigned in the planogram can be assigned to the layout module althoughthey are to be kept in the layout module. Material dimensions withvalue '0' are not updated. To update the optimized stock data, the
    customer exit for the method must be used as of Release 4.5A. As ofRelease 4.5B, this stock data can be updated directly without using the customer exit.

    Planogram file

    A new document contained the imported planogram file is created and
    assigned to the relevant layout module, if the planogram file path hasbeen changed. Changing the path also means changing the file name. Therefore, a new file is created.

    Notes

    If the update indicator is not set in this method, a Commit Work is not triggered. As a result, a general BAPI
    BAPI_TRANSACTION_COMMIT
    is called after the method is called. The BAPI triggers the update.

    As stated above, consistency checks and dependency checks are run. Thevalidity of customer, layout, and layout module entries is checked andan error message is sent if necessary. Then the customer-layout and layout-layout module dependencies are also checked.


    Messages are returned in the parameter return. The parameterdocumentation shows the return codes and their meanings.

    In the listing check, the system checks whether each material is listedand/or can be sold. The check period for the listing check corresponds
    to the listing period and the sales period. However, a listing check isonly possible if a plant is entered in the control parameter.

    Materials are only assigned to a shelf assortment module if theindicator for carrying out listing is selected. Listing conditions are
    created for materials with a horizontal facing > 0 and the shelfassortment modules are assigned to the relevant assortments, if thelayout module on which the version is based has already been assigned to one or more plants.
    Before listing can be run, the layout module versions must be released.
    The can be done in version maintenance in SAP Retail or by using theindicator for immediately releasing versions. If a plant is entered inthe control data, listing conditions are only created for this plant.In other cases, listing conditions are created for all plants to which the layout module is assigned.


    Directly after data is imported and before the data is updated in SAPRetail, the method has a customer exit which can be used for processing imported data or for imorting and updating additional data.

    The length of the document path should not exceed 140 characters.


    The layout check verifies if the layout module is assigned to the the plant(s).

    The control parameter Plant is used for the space management profileassigned to the plant. If no plant is transferred when data is imported, the reference plant for the layout module is used.


    The control parameter Requirement groups is not used in the functionsof the standard system. It is merely an additional option for controlling the updates for imported space management data.

    In addition, the plants to which the selected layout module variant is assigned can be included in table STORES.

    Further Information

    For more information, see the documentation for space management in the SAP Library.


    11-Dec-2005


    GetItem

    GetItem


    This method selects in SAP Retail all the data suitable for theexternal space management program. The necessary import parameters are Customersite, and SiteLayoutModule. A key date for price determination or listing check Pricedate (optional) can also be
    entered, and an indicator for whether a listing check List_Check is required can also be selected.

    First, the additional header data is read for the selection data, suchas the path for the planogram file belonging to the layout module. All
    header data is checked for consistency, and the space management profile for the selected customer is read.

    The materials assigned to the layout module are then selected. Thesystem also checks whether the materials are valid for the listingperiod or sales period. Master data, prices, and movement data are then
    read for the individual materials. The master data and movement data are written to table Items, while the header data is stored in structure Head_Data. The following data can be transferred tothe space management program:


  • Master data:
  • Material number, material short text, unit of measure, EAN/UPC,material category, material group, material dimensions, sort sequencein shelf, shelf section, facing, vendor, manufacturer, generic material, purchase price, sales price and various supplementary data.
  • Movement data:
  • Stock, sales figures, business volume figures
  • Header data:
  • Customer, site, space management profile, purchasing organization,sales organization, distribution channel, layout, layout module, layout
    area, document number of the assigned document, path for the layoutdocument, period for selection of movement data, key date for pricedetermination or listing check, reference customer, date of last space management run.
  • In addition, all materials placed in shelves more than once are
    flagged, i.e. materials assigned to several layout modules within a layout. The number of placings is also defined.

    Notes

    As mentioned above, the system checks for consistency and dependencybetween the two mandatory parameters. The validity of the entries
    Reference customer and Layout module are checked, and error messagesare issued where appropriate. In addition, dependencies between reference customer and layout, and layout module and layout arechecked.

    Messages are returned in the parameter return. The parameter
    documentation shows the return codes and their meanings.

    In Customizing for the space management profile, you define the selection periods for the movement data, theinfo structures used (together with the relevant fields for stock,sales and business volume), the selection variable (month/day) for the
    info structures and the function module relevant to data exports. Toprevent data being read unnecessarily, and to improve performance, youcan set whether prices, quantities, and sales/business volumes are read, and therefore exported. You use Transaction MCHD
    to create and maintain selection variants, or call the transaction from Customizing under Maintain selection variants. In addition you can use Transaction Check space management profile to checkthe consistency and completeness of the space management profile.


    If materials are placed in shelves more than once, note that the movement data is always valid for the whole plant, and not forindividual layout modules.

    During the listing check, the system checks whether the material islisted and/or can be sold. The check period for the listing check therefore covers the listing period and the sales period.


    After the data has been selected, the method has a customer exit whichcan be used to prepare the selected data prior to the transport, and to select additional data.

    The article length in SAP Retail corresponds to the article depth in the SMP.


    The length of the document path is not to exceed 140 characters.

    Further Information

    For more information, see the documentation under space management in the SAP Library.


    11-Dec-2005


    GetItems

    GetItems


    This method selects all the data that can be used by external space management programs (SMP) in SAP Retail.

    The following data can be transferred to the space management program:

  • Master data:
    Material number, material short text, unit of measure, EAN/UPC,
    material category, material group, material dimensions, shelf sequence,shelf section, horizontal facing, vertical facing (= front), vendor,manufacturer, generic material, purchase price, sales price with various additional data.
  • Movement data:
    Stock, business volume, sales, optimum and maximum shelf quantity, presentation quantity.

  • Header data:
    Customer, plant, space management profile, purchasing organization,sales organization, distribution channel, layout, layout module, layoutarea, layout module version with additional data, layout modulevariant, document number for the assigned document, path for the layout
    document, time period for selecting movement data, key date for pricedetermination or listing checks, reference customer, date of the last space management run.
  • The required import parameters are the layout module SiteLayoutModule, date for price determination, determination of movement date, listing check or determination of valid version for layout module
    Pricedate and a layout module version.

    Using the Stores and Storegroups tables, you can definefor which plants or plant groupings movement data or prices are to be chosen.
    In the Controls
    import structure, you can define control data for data selection. The following control data is available:

  • An indicator for whether a listing check is to be executed
  • An indicator for whether a check of layout module to layout and plant is to be executed

  • An indicator for whether material movement data is to be read from allplants to which the chosen layout module has been assigned
  • An indicator for whether a plant has been chosen
  • The space management profile for controlling the export of data for the individual plants

  • A mapping variant. The mapping variants are defined in the customerexit for this method. You can therefore access different mappingvariants for each call. For example, one mapping variant can determinethe average value of the movement data and another mapping variant can cumulate this.

  • A layout module variant
  • A layout module version
  • An indicator for whether the version is to be determined using the selection date
  • The method first defines additional header data for the selection data,for example, the path for the planogram file that belongs to the layout
    module version in question. Various checks are executed which areseparate from the control data settings. You use the control data todefine which materials are to be assigned to the layout module. Material master data, prices, and movement data for the individual
    materials are read from the master data tables. The master data and movement data is written into the Items table while the header data is prepared for export in the Head_Data structure.

    Furthermore, all materials which have multiple placements are flagged accordingly.


    Multiple placement means that a material is assigned to more than onelayout module for a particular customer. The total number of placements is also stated.

    Notes

    Consistency checks are always carries out for layout modules, and forthe space management profile (if applicable), and additional checks dependent on the control parameters may also be carried out.


    Messages are returned in the parameter return. The parameterdocumentation shows the return codes and their meanings.

    To avoid unnecessary reading of data and improve performance, you candefine whether prices, quantities and sales/business volumes are read and therefore exported.


    Customizing settings for the space management profile:

  • Selection period for the movement data, the info structures that wereused including the relevant fields for stock, business volume, determination of the function module relevant for data export and
    (optional) the function module to be used for data transfer to SAP Retail Store.
  • For creating and maintaining selection variants, you use transaction MCHD or call the Customizing transaction Create/maintain selection variants.
  • In addition, you can check the space management profiles for consistency and completeness using Transaction
    Check space management profiles
    .
  • For materials with multiple placement, please note that the movementdata is always valid for the whole plant and not for the individuallayout module. If selection is executed for more than one plant, thesefields are not filled because the total number of placements for an material can differ from plant to plant.


    The listing check ascertains whether a material is listed and/or can besold. The time period for the listing check therefore covers the listing period and the sales period.

    If no space management profile has been defined in the control data,the reference plant profile is automatically used for the layout module.


    The layout check ascertains whether the layout module you entered isassigned to the plant(s), and whether the plants are even assigned a layout.

    If the indicator has been flagged so that no plant is to be selected,only the material master data and not the movement data is read.


    If both plants and plant groupings are found when you call the method,and the indicator for reading all the plants has been flagged, theindicator takes priority; this means that the material movement dataare read for all plants to which the selected layout module has been assigned.


    If one or more plant groupings are chosen, the plants in this grouping are prepared for export in the Stores table.

    An error message is generated if no valid entries are found when you select plants from plant groupings.

    An average price is found when you choose prices and movement data from
    various plants in the standard system while the stocks, businessvolume, and sales data is cumulated. The header data is related to the reference plant for the layout module in this case.

    After data is selected, you can use the customer exit to prepare data and select any additional data before you export the data.

    Material length in SAP Retail corresponds to material depth in SMP.

    The length of the document path must not exceed 140 characters.

    Further Information

    For more information, see the section Logistics -> SAP Retail in the SAP Library.


    11-Dec-2005


    SaveReplica

    SaveReplica


    You use this method to create new layout modules (shelves) and changeor delete and post layout module master data. The data relating tomaster data table MALG (assignment of materials to layout module) is mapped using this method.

    In addition to the layout module, the following data can be transferred to the BAPI:


  • Master data:
    Material number, unit of measure, sort sequence in shelf, shelfsection, facing, layout module version, layout module variant,exclusion indicator. Exclusion means the material is not contained inthe layout module version, that is to say, is not placed on the shelf.

  • Movement data:
    Maximum shelf quantity, optimum shelf quantity, presentation quantity.
  • The data of the following structures can be created, changed, deleted and updated:

  • DESCRIPTION
  • VERSION
  • VARIANT
  • MATERIAL

  • You can use this method to map variants of layout modules to defineslight differences to the layout module that only apply to a limited number of stores.

    If the structure (e.g. DESCRIPTION or MATERIAL) contains a field forthe language key or unit of measure, it always also contains a field of
    the same name with the suffix _ISO. This allows you to enter eitherthe internal SAP code or the standardized ISO code for the value. Forfurther processing, the system converts ISO codes to SAP codes. The ISOcode is only used if the SAP code is not transferred. If you use ISO


    codes, an ISO code must be uniquely assigned to the SAP codes in Customizing for the units of measure and language key.

    Transferred data is posted synchronously, that is to say, an updatetask is not used. This is necessary because this method is also used in ALE distribution and ALE inbound
    processing cannot support asynchronous updating, because it does not allow the processing status of the assigned IDocs tobe set reliably.

    So that it is possible to identify whether a data record is to beprocessed, the field FUNCTION must contain the following values in the relevant structure:


  • 003 Delete: Message contains objects that are to be deleted
  • 004 Change: Message contains changes
  • 005 Replace: This message replaces previous messages
  • 009 Original: First message relating to the operation

  • 023 Wait/compare: Data should not be imported
  • 018 Resend
  • If a serious database error occurs during synchronous updating of theapplication data, a rollback is triggered in the method for alldatabase changes made up to then. If the method is called together with
    other methods in a commit unit, the database changes for all previousmethod calls are also rolled back if these were not committed. Therollback is necessary to ensure that database data is consistent, because some application data was updated correctly and some was not.


    Notes

    If this method is not used for the ALE distribution of layout modules,the field CHANGE must contain the following values in the relevant structure:

  • 0 Delete a data record
  • 1 Create a data record

  • 2 Change a data record
  • If field CHANGE does not contain any data, the same material is createdas a new data record with a different logical key (e.g. differentplacement in shelf). A logical, sequence number is assigned to each newmaterial. If the same material is created with the same logical key,
    the material record is modified if attributes such as facing or fronthave changed. If a material is to be deleted, it is removed from the layout module and, if applicable, from the variant.

    Before a new layout module variant is created, the relevant material
    record must exist with this variant. If a version of a layout module isdeleted, all variants of this version, and all material records for this version (dependent on the variant) are also deleted.

    Versions of a layout module are always created with an infinite validity period, and are thus valid for all stores. As soon as a
    version with a new 'Valid-from' date is posted, the 'Valid-to' date of the earlier version is adjusted accordingly.

    If a material is to be removed from an existing layout module (shelf),the field EXCLUSION must be selected in structure MATERIAL. It is only
    possible to exclude a material if the material exists in the shelf,that is to say, a material record exists with the relevant version.

    Every time the method is called, all buffers are deleted.

    You can use the TestRun parameter to activate/deactivate updating of data.


    The test run parameter can contain the following values

  • ' ' (no value)
    This means that data is updated. This is the standard setting, and iswhat would normally be expected if the method is called.
  • 'X'
    This value means that this BAPI is only called in simulation mode and that no data is updated.


  • 11-Dec-2005