Document Number Support (V9.0)

A new field type, “O” for document numbers is available in V9.0. 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.

IN Input API: 


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.

DN API: Document Number Increase or Rollback

A new API is available in V9.0 to increment the document fields by 1 and to also check if we can roll back (reverse) the increment if no other user has incremented the number. This type of code would be used when there is no user interface and the document numbers are incremented programatically.

Reverse Document Number

Move “DN,-” To Screen-Parameters

Move “AP-CTL-LAST-VOUCHER-NO” To Screen-Field-Domain

Move Last-Voucher-No to Screen-Alpha-Field

Perform Screen-Routine

Increase Document Number

Move “DN,+” To Screen-Parameters

Move “AP-CTL-LAST-VOUCHER-NO” To Screen-Field-Domain

Move Spaces to Screen-Alpha-Field

Perform Screen-Routine

Move Screen-Alpha-Field to New-AP-Voucher-No

CLS

Feedback and Knowledge Base