7 80 3 REQUEST Examples

LANSA Technical

7.80.3 REQUEST Examples

Example 1: Input fields #ORDNUM, #CUSTNUM and #DATEDUE from the workstation:

REQUEST    FIELDS(#ORDNUM #CUSTNUM #DATEDUE)

or, identically:

GROUP_BY   NAME(#ORDERHEAD) FIELDS(#ORDNUM #CUSTNUM #DATEDUE)
REQUEST    FIELDS(#ORDERHEAD)
 

both use default values for all parameters and field attributes and thus would cause a screen something like this to be designed automatically:

 

 

   Order number : __________

   Customer no  : _________

   Date due     : ___________

 

 

Example 2: Modify the previous example to design the screen across ways and use column headings to identify the fields:

GROUP_BY   NAME(#ORDERHEAD) FIELDS(#ORDNUM #CUSTNUM #DATEDUE)
REQUEST    FIELDS(#ORDERHEAD) DESIGN(*ACROSS) IDENTIFY(*COLHDG)
 

which would cause a screen something like this to be designed automatically:

 

 

   Company     Order       Date

   Order       Customer    Order

   Number      Number      Due

   ______      ______      ________ 

 

 

Example 3: Request #ORDNUM #CUSTNUM and #DATEDUE and also specify specific positions and identification methods as field attributes.

For details of field attributes, refer to Field Attributes and their Use.

When specific positions for a field are nominated the automatic design facility is effectively "disabled".

GROUP_BY  NAME(#ORDERHEAD) FIELDS((#ORDNUM  *COLHDG *L3 *P3 ) (#CUSTNUM *LABEL  *L3 *P14) (#DATEDUE *NOID   *L7 *P37))
 
REQUEST   FIELDS(#ORDERHEAD) TEXT(('--DATE--' 6 37))
 

which would cause a screen something like this to be designed:

 

 

 Company    Customer no : _______

 Order

 Number

 ______                                         --DATE--

                                               __________

 

 

Note that the manual specification of row and column numbers and "text" is not required. The screen design facility can be used to modify an "automatic" design much more quickly and easily. Refer to the LANSA for i User Guide for details of how to use the screen design facility.

After the screen design facility has been used on a REQUEST command the associated FIELDS parameter (in the REQUEST or GROUP_BY command) will be automatically re-written with the required row, column and method of identification attributes.

In addition the TEXT parameter of the REQUEST command will also be automatically re-written.

 

Example 4: Use an Expandable Group expression and redesign the layout using the screen design facility:

GROUP_BY   NAME(#XG_ORDHDG) FIELDS(#ORDNUM #CUSTNUM #DATEDUE)
REQUEST    FIELDS(#XG_ORDHDG) DESIGN(*ACROSS) IDENTIFY(*COLHDG)
 

The screen designed automatically would look like:

 

                                                                    

       Company   Order     Date                                     

       Order     Customer  Order                                    

       Number    Number    Due                                      

       ________  ______    ______                                   

                                                                    

                

 

If the layout is changed using the screen design facility to look like this:

 

                                                                

      Company   Order                                           

      Order     Customer                                        

      Number    Number                                          

      ________  ______       Date Order Due   ______            

                                                                

            

 

The REQUEST command FIELDS parameter will be expanded as follows:

REQUEST    FIELDS((#ORDNUM *L2 *P3) (#CUSTNUM *L2 *P13) (#DATEDUE *L5 *P26 *LAB)) DESIGN(*ACROSS)IDENTIFY(*COLHDG)