IN and DF API Change (V9.0)

IN: Input and DF: Display Field 


Quantity, Price and Cost Support


The IN and DF API calls have been enhanced to allow the programmer to specify input as a quantity, price or cost field.

Screen Parameters: IN,rr,cc,ww,tp,af


ww = the maximum width of the field. The number of decimals will be determined by the type. The number of digits to the left of the decimal will be calculated as:

type T – maximum width minus the value in Company-No-of-Decimals

type M – maximum width minus the value in Company-No-of-Decimals-Accum

type C – maximum width minus the value in Company-No-of-Decimals-Cost

type $ - maximum width minus the value in Company-No-of-Decimals-Price

t = T indicates this input field is a quantity field. The number of decimal places is for the entry is determined based on the COMPANY-NO-OF-DECIMALS in the Company file. When t = T, p can have the following value:

p = “-“ means the field supports the entry of a negative quantity with no echo

p = “=“ means the field supports the entry of a negative quantity with echo

p = “E“ means the field does not support the entry of a negative quantity but it does support echo

t = M indicates this input field is an accumulator field. The number of decimal places is for the entry is determined based on the COMPANY-NO-OF-DECIMALS-ACCUM in the Company file. When t = M, p can have the following value:

p = “-“ means the field supports the entry of a negative quantity with no echo

p = “=“ means the field supports the entry of a negative quantity with echo

p = “E“ means the field does not support the entry of a negative quantity but it does support echo

t = C indicates this input field is a cost field. The number of decimal places is determined based on the COMPANY-NO-OF-DECIMALS-COST in the Company file. When t = C, p can have the following value:

p = “-“ means the field supports the entry of a negative cost with no echo

p = “=“ means the field supports the entry of a negative cost with echo

p = “E“ means the field does not support the entry of a negative cost but it does support echo

t = $ indicates this input field is a price field. The number of decimal places is determined based on the COMPANY-NO-OF-DECIMALS-PRICE in the Company file. When t = $, p can have the following value:

p = “-“ means the field supports the entry of a negative price with no echo

p = “=“ means the field supports the entry of a negative price with echo

p = “E“ means the field does not support the entry of a negative price but it does support echo


Examples:

IN,04,04,13,C-,A1 will allow the user to enter a cost field with no echo of the value in SCREEN-NUMERIC-FIELD. If COMPANY-NO-OF-DECIMALS-COST is set to 4 (default), user will be able to enter a field containing 9,999,999.9999- (S9(7)V9(4)).

Document Number Support

This change supports a new field type “O” for document numbers. It supports moving automatic F1 = Next Document Number logic to the system layer versus in the application code. It also supports selectively allowing alphanumeric document numbers in the future.

Screen Parameters: IN,03,20,09,O ,E78

A new field type “O” is supported for document number fields.  Code “O” in place of “*”.

Document numbers should be moved to and from SCREEN-ALPHA-FIELD instead of SCREEN-NUMERIC-FIELD.  Note: A numeric-only document number that evaluates to Zero will be returned as SPACES (instead of “000000000”) in SCREEN-ALPHA-FIELD.  That way, one only has to check for SPACES in SCREEN-ALPHA-FIELD to see if nothing was entered, whether or not the document number can contain alphanumeric characters.

Two new fields are now used in conjunction with the Screen-Parameters:

a.      SCREEN-FIELD-DOMAIN will identify the kind of document number being entered.  When we begin to selectively support alphanumeric document numbers, it would be used by the system layer to look up the editing rules for that kind of document number.  When blank, only numeric digits are allowed.  When non-blank, the system would look in a hard-coded table to see if alphanumeric input is allowed.  We would need to publish a master list of these domain names.  Examples might include:

                                                              i.      COP-CTL-START-ORDER-NO (for sales orders)

                                                            ii.      BM-CTL-NEXT-ORDER-NO (for legacy work orders)

                                                          iii.      BM-CTL-NEXT-MATER-ORDER-NO (for material work orders)

                                                          iv.      BM-CTL-NEXT-PLUS-ORDER-NO (for plus work orders)

                                                            v.       AP-CTL-LAST-VOUCHER-NO (for vouchers)

                                                          vi.      AR-CTL-START-INVOICE-NO (for invoice numbers)

b.      SCREEN-F1-NEXT-DOC-NO, when set to “Y” on an IN call with F1 enabled, will handle the user pressing F1.  The next document number will be retrieved and returned in SCREEN-ALPHA-FIELD with F1-KEY-PRESSED set to TRUE.

After an IN call, the resulting document number will be right-justified and zero-filled on the screen – no need for a follow-up DF call.

SCREEN-FIELD-DOMAIN and SCREEN-F1-NEXT-DOC-NO will be blanked out after the IN and DF calls.

Example 1:  Enter order number without F1 and alphanumeric support:

Current code:   

MOVE “IN,03,20,06,* ,E78” TO SCREEN-PARAMETERS

MOVE ZEROES TO SCREEN-NUMERIC-FIELD

PERFORM SCREEN-ROUTINE

MOVE SCREEN-NUMERIC-FIELD TO ORDER-NO

New code:

MOVE “IN,03,20,09,O ,E78” TO SCREEN-PARAMETERS

MOVE SPACES TO SCREEN-ALPHA-FIELD

PERFORM SCREEN-ROUTINE

MOVE SCREEN-ALPHA-FIELD TO ORDER-NO

In the above example, SCREEN-FIELD-DOMAIN is not required, because we do not need it for F1 support, nor for alphanumeric support.

 

Example 2: Enter order number with F1 support and (future) alphanumeric support:

Current code:   

MOVE “IN,03,20,06,* ,E178” TO SCREEN-PARAMETERS

MOVE ZEROES TO SCREEN-NUMERIC-FIELD

PERFORM SCREEN-ROUTINE

IF F1-KEY-PRESSED

  …

MOVE SCREEN-NUMERIC-FIELD TO ORDER-NO

New code:

MOVE “IN,03,20,09,O ,E178” TO SCREEN-PARAMETERS

MOVE SPACES TO SCREEN-ALPHA-FIELD

MOVE “COP-CTL-START-ORDER-NO” TO SCREEN-FIELD-DOMAIN

MOVE “Y” TO SCREEN-F1-NEXT-DOC-NO

PERFORM SCREEN-ROUTINE

MOVE SCREEN-ALPHA-FIELD TO ORDER-NO

In the above example, SCREEN-FIELD-DOMAIN and SCREEN-F1-NEXT-DOC-NO would be used for F1 support and SCREEN-FIELD-DOMAIN would also be used to look up whether alpha characters are allowed during entry. 

CLS

Feedback and Knowledge Base