7.7 Even More Complex Prompt Key Processing

Since the LANSA pop up window facility supports input capable windows, it is possible to create prompt key processing programs that do file maintenance via windows.

Consider the following prompt program for department number. Note that it allows the user to select a department, change an existing department, delete an existing department or even create a new department:


  INVOICE01              Invoice Inquiry                         
                                                                   
  Company number  . . .  ____      ..............................  
  Dept number . . . . .  ____      : DEP01    Departments       :  
  Invoice number  . . .  ______    :                            :  
                                   : 1=Select 2=Change 3=Delete :  
                                   :                            :  
                                   :     Dept  Department       :  
                                   : Sel Numb  Description      :  
                                   : ___  001  ADMINISTRATION   :  
                                   : ___  002  FINANCE          :  
                                   : ___  004  SALES & MARKET   :  
                                   : ___  006  PLANT MAINT      :  
                                   : ___  007  VEHICLE MAINT    :  
                                   :                            :  
                                   : F6=Create F12=Cancel       :  
                                   :                            :  
  F4=Prompt                        :............................:  

 

 

If the user elected to create, change or delete a department, then another pop up window might be used.

The following example might reflect what the screen looks like after using F6 and keying in the new department details:


INVOICE01              Invoice Inquiry                             
                                                                   
 Company number  . . . ____        ............................    
 Dept number . . . . . ____       : DEP01    Departments       :   
 Invoice number  . . . ______     :                            :   
                                  : 1=Select 2=Change 3=Delete :   
                                  :                            :   
        ........................................artment        :   
        DEP02     Maintain Departments       :cription       :   
        :                                      :INISTRATION    :   
        : Dept number . . . . 008              :ANCE           :   
        : Description . . . . ACCOUNTING       :ES & MARKET    :   
        : Phone number  . . . 415-2737         :NT MAINT       :   
        :                                      :ICLE MAINT     :   
        : F12=Cancel                           :               :   
        :......................................:=Cancel        :   
                                   :                           :   
 F4=Prompt                         :...........................:   

 

 

 

The processing required to do this in the prompting program is all fairly standard. However, once this program is in place, a user can  select from or maintain the departments file from any screen panel that has the field department number on it.

By using the CHECK_AUTHORITY built in function, and a little bit more RDML code, the maintenance capability can be excluded from users who are not authorized to use it.