Previous Topic: Completing the Department ApplicationNext Topic: Step 1:  Define Process Module XXXDUPD-PREMAP


Defining Process Modules Using IDD

According to your application definition, dialog XXXDUPD is executed by functions MODDEP and DELDEP:

Process modules that you write must be able to handle both modification and deletion operations. To accomplish this, you will include commands that:

  1. Test which function (MODDEP or DELDEP) is currently in use
  2. Invoke subroutines appropriate to the current function

You test which function is currently in use by querying AGR-CURRENT-FUNCTION, which is an element in the system-supplied ADSO-APPLICATION-GLOBAL-RECORD. At run time, AGR-CURRENT-FUNCTION stores the name of the current function. Your process module can access AGR-CURRENT-FUNCTION because ADSO-APPLICATION-GLOBAL-RECORD belongs to the dialog's map (and thus to the dialog).

For example, the following conditional command tests the value in AGR-CURRENT-FUNCTION:

IF AGR-CURRENT-FUNCTION EQ 'MODDEP'    ◄-- If function MODDEP is executing
THEN                                      the dialog,

    CALL MODRTN.                       ◄-- call subroutine MODRTN to
                                          modify the department record.

In this chapter, you will define process modules for dialog XXXDUPD. You will:

  1. Define process module XXXDUPD-PREMAP.
  2. Define process module XXXDUPD-ENTER.
  3. Define process module XXXDUPD-PA2.