Skip to main content
Skip table of contents

Customizing Examples for Interfaces

Customize an Individual System Check Class (from DB 39.5.7)

Error rendering macro 'fontawesome-macro' : Page loading failed
Task

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

Error rendering macro 'fontawesome-macro' : Page loading failed
Procedure

  • Create a new check.py file at py/customer/ppms/interface/parameter/conditional
  • The following code is inserted in the file:
PY
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!'
  • Restart the PLANTA service.
  • The class can now be used.
Error rendering macro 'fontawesome-macro' : Page loading failed
See also: Systems in PLANTA link

Stamping During Export Procedure

Error rendering macro 'fontawesome-macro' : Page loading failed
Task

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

Error rendering macro 'fontawesome-macro' : Page loading failed
Procedure

  • Create individual data items in DT472 Load.
  • Create a new module subclass and store it in the customer Python directory.
  • Create a new interface configuration.
  • To be observed for the source module:
    • Assign a new module subclass.
    • Data areas must not be set to Never show (DI001587).

Error rendering macro 'fontawesome-macro' : Page loading failed
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.

Error rendering macro 'fontawesome-macro' : Page loading failed
Notes

  • When using the Load export interface, the following data fields from DT472 Load are stamped by default: SAP Status (DI060750), Exported on (DI003399), Exported by (DI003402).
  • 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)

Error rendering macro 'fontawesome-macro' : Page loading failed
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.

Error rendering macro 'fontawesome-macro' : Page loading failed
Procedure

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

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

config = StaticConfig('config-uuid')
# copy/execute the interface ...
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.