Support for importing from M3 by source
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.
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.