Support for importing from M3 by source

In SCV, source is a logical definition to represent a subset of data. In most cases, source value is used to split the data by location, for example, by M3 facility or M3 warehouse group.

Most SCV programs already supported processing of planning data by source. The M3_EXECUTE_IMPORT SCV program and the SCV BOIs are now extended to support importing from M3 by source.

The M3_EXECUTE_IMPORT program now accepts "-SOURCE" as optional input parameter like other SCV programs.

When source value is passed as input parameter to the M3 import program:

  • #SOURCE# keywords in the BOI are replaced by the parameter value.
  • If <REF_TABLE> tag is used in the BOI, a WHERE condition on the source column is appended at run time: WHERE source = '#SOURCE#'.
  • If <REF_QUERY> tag is used in the BOI, a WHERE condition on the source column is added to the query at run time, if it does not already exist: SELECT * FROM <REF_QUERY> WHERE source = '#SOURCE#’.
  • Existing data in the destination staging table is deleted by source, that is WHERE source = source parameter value.
    Note: The existing data for previous global imports where source = "M3:<M3 company>" is deleted from the destination staging table.
  • The source columns of the imported records is populated using the same parameter value.

When source value is not passed or when empty value is passed as input parameter to the M3 import program:

  • #SOURCE# keywords in the BOI are replaced by the default value, that is "M3:<M3 company>".
  • All existing data in the destination staging table is deleted.
  • The source columns of the imported records is populated using the same default value "M3:<M3 company>".

Currently, no BOIs are delivered as part of the SCP standard content that use import by source.

For importing all data, the parameter value must not be specified. If the parameter value is set, the data is imported from M3 for the specified source value.

Note: The import behavior is based on the BOI definition, using the #SOURCE# keyword. If the #SOURCE# keyword is not used in the BOI, the M3 import program cannot import only a subset of the planning data.

Most M3 APIs accept location as input parameter, such as facility, warehouse or warehouse group. This makes M3 warehouse groups a good candidate for source.

Note: By default this feature is enabled. A new role or privilege is not required to access this feature.