Customize an Individual System Check Class (from DB 39.5.7)

Task

  • Customize an individual check class
    • The class is supposed to check whether there is a file under the path stored in Parameter.

Procedure

  • Create a new check.py file at py/customer/ppms/interface/parameter/conditional
  • The following code is inserted in the file:
import os

from ppms.interface import BaseConditional


class FileExistsConditional(BaseConditional):
    """Check if the file configured in the parameter exists"""
    
    @property
    def is_satisfied(self):
        return os.path.isfile(self.parameter)
    
    @property
    def value(self):
        if self.is_satisfied:
            return 'File exists!'
        
        return 'File does not exist!'
PY
  • Restart the PLANTA service.
  • The class can now be used.

Stamping During Export Procedure

Task

  • Actual hours are to be exported summarized to a file (without pool). The source record is to be stamped in DT427.

Procedure

Example

  • Create new DIs in DT472: Create L100_exported_on and L100_exported_by.
  • Create the following source module.
    • DT463 Task grouped
      • DT463 Task (summarized) with DA Python ID: task_source_records
        • DT466 Resource assignment (summarized) with DA Python ID: res_source_records
          • DT472 Load with DA Python ID: load_act_source_records
  • Enter the corresponding stamp_mts.py module subclass.

Notes

  • When using the Load export interface, the following data fields from DT472 Load are stamped by default: SAP Status, Exported on, Exported by.
  • The above mentioned customizing example shows how arbitrary data fields can be stamped. This is necessary, e.g., if the actual data must be exported multiple times (to different targets).

Optimize Performance of Interface Calls (From DB 39.5.8)

Task

  • The performance of the PLANTA link has been improved in DB 39.5.8 by drastically lowering the number of required database access.
  • Individual code which calls interfaces can also be optimized.

Procedure

  • Make the following changes:
  • Previous code:
from ppms.interface import Config

config = Config('config-uuid')
# copy/execute the interface ...
PY
  • New code:
from ppms.interface import StaticConfig

config = StaticConfig('config-uuid')
# copy/execute the interface ...
PY