Stock movements, the Data Models and the STOTRACE parameter

3 minute read time.

Have you ever wondered what tables and/or fields are populated by a stock movement? Do you need this information to create a query or a report? Are the auditors asking? Where can you get this data? We'll take a  look at the Online help Center’s Data models and the STOTRACE User parameter and see what data each option provides.

 

One area to check out is for data flow information is the Data models section in the Online help center. This is found under the Technical help tab. Once in the Data Models, select Stock. (You’ll notice that there are more options than just Stock available.)

The diagram shows the relationship between the stock tables. You can also click on the table name, and it will bring you to the Table dictionary.

I’ll click on STOTRK to reveal details for the table such as field data type, field length and keys for the table.

To review what tables and fields a specific transaction has populated, let’s look at the STOTRACE (Stock update trace) parameter. The STOTRACE parameter is set at the user level under Setup, Users, Users (GESAUS). It is found in the STO Chapter, Group MIS.

What exactly does this parameter do? It allows for the generation of a log file following the creation of stock movements that can reveal the tables and/or fields that have been updated.

Note that the default value is “No trace.”  There are 3 other values, and we will review all the options.

  • No trace = no logs are created. Settings other than “No trace” will add overhead to your system. This means it will negatively impact performance.
  • Standard trace (messages) = The log mentions the document number created.
  • Detailed trace (table updates) = The log mentions the tables that have been updated.
  • Detailed trace (field updates) = The log mentions the field that have been updated.

We will check out what happens when the STOTRACE parameter value is set to Detailed trace (table updates) or to Detailed trace (field updates).

First, we will change the STOTRACE value to Detailed trace (table updates) and create a Miscellaneous receipt under Stock, Receipt / issue transactions (GESSMR). We will receive 100 units of BMS001.

After we hit the Create icon and go through the label print screen options, the Log appears. The Log shows 11 results which represent new entries created in the tables or previous tables values that have been modified for receipt MRCNA0120016.

Next, we will change the STOTRACE value to Detailed trace (field updates) and create a Miscellaneous receipt under Stock, Receipt / issue transactions (GESSMR). We will receive 200 units of BMS002.

This time, we have 403 results as it displays both the tables and the individual fields. That is quite a lot of activity for one little transaction! (Soap box comment: In addition to just filling in numbers, the program is calculating values, accumulating statistics; and validating data against the business rules. These are excellent reasons not to do updates in the backend.)

Should you close the log before you are finished or want to review it later, go to Reports, Reports, Log reading (LECTRACE) to retrieve it.  Enter the log number or drill down to find it.

 

When you are finished with the tracing, be sure to go back and reset the STOTRACE user parameter to “No trace” so that you don’t continue to negatively impact performance.  

Note: the STOTRACE only applies to stock movements. For example, it can be used with stock issues or purchase receipts. It won’t create a log for a purchase order because no stock is moved when it is created.

I hope you find this a useful addition to your analysis tools.

Take care my X3 friends. Stay safe!