Setting Up Diverters

Setting Up a Diverter

1) Pick your diverter day

Diverter orders will only be generated one day a week. Choose the day you’d like to approve the diverter orders. Picking the diverter day determines the deadline for the diverter to send us their weekly file. As an example, you may pick Tuesday as your diverter day. This means we would expect you to approve your diverter orders on Tuesday a majority of the time. Yes you could approve on another day, but the diverter is less likely to have all of the products available the longer you wait to order.

2) Decide which diverters you want to set up

We have contacts at diverter sites we have worked with at other K3S customer sites if you need info (Quality King, Victory, Supreme, Purity). If you want to use a diverter we have not worked with before, just a heads up it will take a little longer to iron out file formatting, etc.

3) Set up the supplier ID in your ERP

Let us know the supplier ID you setup for the diverters.
SPECIAL NOTE: Do not assign any products under the diverter in your ERP. K3S will not bring the products in under a diverter. Products must live under a ‘regular’ supplier.

4) Decide how to set up the weekly file

There are lots of possibilities on this. Ideally the diverter sends the file directly to a folder on your server or to an FTP site if you all already have one that you use. Another possibility is someone could be trained to take an email attachment and load on to your server, but I would not recommend this as a long term solution.

Technical Notes

First, you will need to set up the diverter in Supplier Settings. When adding a new supplier, you will need to enter the Supplier ID into the Supplier field, the name of the diverter into the Name field, and also select in the drop down that it is an alternative source.

Next, you will haver to determine the physical file that will hold the weekly offerings.

There are 15 files available to use from file name K_ALTSRC01 through K_ALTSRC15. More files can be established if you will be buying from more than 15 sources. These files are located in library K3S_5DTA and are flat files with 80 bytes records. If this is the first alternate source supplier you are setting up, then use the first file called K_ALTSRC01.

Most alternate source suppliers send the offerings via email attachment or by using FTP to a site you designate. You will need to receive their offerings and then populate the appropriate K3S offering’s K_ALTSRCxx file.

The weekly alternate source process will use their offerings that make the cut off time, and then automatically clear the files for the next week’s process.

Then you will need to setup the ASE (Alternate Source Entries) table code record to match the physical file.

Make adjustments to the RPGLE Program K3S_9100. The purpose of program K3S_9100 is to map the weekly offerings sent by the alternate source suppliers to field positions that are understood by this program.

For each alternate source supplier added you will change the Input specifications for the proper ‘from’ and ‘to’ positions, and then down in the Calculation statements you will change the supplier ID to match the appropriate value for this new alternate source.

If your alternate sources send you costs in different increments, and you want them represented in your cost per divisor, this section of calculations provides the means to make that happen.

Then, you will need to set the processing schedule to know which day of the week to build orders for alternate source suppliers. To do this, you will need to edit the Processing Schedule.

Exclude updating product information for alternate source suppliers. RPGLE program K3S_9000 builds the K3S interface file for products (K_INTPROD). However, since Alternate Source suppliers will have zero active products in the K3S system, we must add a statement in K3S_9000 to exclude building interface records for this type of supplier.

Using CL program K3S_GETALT to populate K3S files with weekly offerings. One method of getting the weekly offerings loaded into the appropriate K_ALTSRC* files is by setting up CL program K3S_GETALT in library K3S_5MOD.

Using this method requires the weekly offerings to be FTP’d to the IFS. Then program K3S_GETALT imports the data into a file and does a copy file to get the data into the appropriate K_ALTSRC* file. Depending upon how the data looks that the diverter sends, you will either copy the data in the stream file to a physical file with defined fields or a flat 120 byte file.

Using CL program K3S_GETALT to populate K3S files with weekly offerings. One method of getting the weekly offerings loaded into the appropriate K_ALTSRC* files is by setting up CL program K3S_GETALT in library K3S_5MOD. Using this method requires the weekly offerings to be FTP’d to the IFS. Then program K3S_GETALT imports the data into a file and does a copy file to get the data into the appropriate K_ALTSRC* file.

Depending upon how the data looks that the diverter sends, you will either copy the data in the stream file to a physical file with defined fields or a flat 120 byte file.

Hosted customers will need to edit K3S_1091CL in the 5MOD library to contain the 3 letter environment COMPCOD and compile. Ensure the object for K3S_1091SB also exists in the 5MOD library.

Once you have completed the setup steps for your alternate source suppliers, you are able to run a test on your alternate source supplier data.

To do so, you will first have to make a backup of each K_ALTSRCxx file. You will want to use the copy file (CPYF) function to copy your diverter data to backup files. You want to copy from your K_ALTSRCxx file in K3S_5DTA to your backup file in K3S_5MOD.

Second, you will need to remove any alternate source supplier data from three K3S files.

You will run the following SQL commands:

  • delete from k3s_5dta/k_suplsoq where so_altsrce = 1
  • delete from k3s_5dta/k_prodsoq where pq_altsrce = 1
  • delete from k3s_5dta/k_product where pr_altsrce = 1

Third, you will call RPGLE program K3S_9110CL to process your alternate source supplier information. You will need to call K3S_9110CL from a command line and pass it your one-letter company code as a parameter. EX. - CALL PGM(K3S_9110CL) PARM(‘C’)

Fourth, you will need to copy your backup information to their original K_ALTSRCxx file. You will need to perform the copy file (CPYF) function again, but this time in reverse of how you were copying before in step 1 above. You want to copy from your backup file in K3S_5MOD to your K_ALTSRCxx file in K3S_5DTA. Check to make sure your diverter information looks correct.

Finally, set up the ALT_SYSTEM Table Code record. The last step in setting up Alternate Source Suppliers is to set the ALT_SYSTEM table code record to 1=Yes. To do so, you will need to edit table code record NJP (Night Job Parameters).

Change Flag 1 to option 1=Yes to signify that ‘Yes’ an alternate source system has been installed.