Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question with coding of GUI Script for MSM20DB

Status
Not open for further replies.

Calator

Programmer
Feb 12, 2001
262
AU
I am writing a script to upload supplier business information via MSM20DA and MSM20DB.

On MSM20DB the value displayed by the function keys literal at the bottom of the screen is 'XMIT-Update' both before the data entry and after, when usually 'XMIT-Confirm' would be displayed.

How would you code the 2 different situations in the DYNAMIC MSM20DB procedure, given that the function key literal does not change?

We usually would have smthg like:

TRIGGER @ERRMESS1I
. VALUE ' '
. TRIGGER @FKEYS1I
. . VALUE 'XMIT-Update' /* Ready for data entry
. . PERFORM MSM20DA_KEY_DATA
. . VALUE 'XMIT-Confirm' /* Data entered and all is ok: save and move to next screen
. . KEY !SEND
. . VALUE '' /* Error has occured - F3 back to MSM200A
. . SET 'STATUS=' 'ERROR'
. . SET 'ERROR=' @ERRMESS1I
. . PERFORM WRITE_ERROR_FILE
. . KEY !F3
. VALUE '' /* Error has occured - F3 back to MSM200A
. SET 'STATUS=' 'ERROR'
. SET 'ERROR=' @ERRMESS1I
. PERFORM WRITE_ERROR_FILE
. KEY !F3

but above does not work in this case as XMIT-Confirm does not apply.
 
You could do this in two ways:
1) Set a variable (say CFT) to true the first time in and insert a subroutine which contains an abort if true + key send
ie.

SUBROUTINE CHECK_FIRST_TIME
ABORT IF NOT CFT
KEY !SEND
RETURN

after the insert subroutine set the variable to false. Next time in it will just automatically key send rather than perform the remainder of the dynamic section.

2) Trigger of a field that you always populate the first time in.

Hope this helps :)
MF
 
Markfr,
Thanks for the excellent idea. I coded around those lines, however my script still enters an infinite loop and I cannot see what's wrong. Could you pls check if you see a problem? Note the problem occurs first on MSM20DA as it has the same issue with screen re-entry as MSM20DB. Therefore the code below refers to MSM20DA:

SUBROUTINE MSM200A_KEY_DATA MSM200A
/* Initialise flag to be checked if it is 1st time in, or a redisplay
SET 'VIRGIN20DA=' 'TRUE'
KEY
. !CLEAR
. !ENTER OPTION !TO @OPTION1I
. !ENTER DISTRICT !TO @DSTRCT_CODE1I
. !ENTER SUPPLIER !TO @SUPPLIER_NO1I
. !SEND

RETURN

SUBROUTINE MSM20DA_KEY_DATA MSM20DA
/* Set flag to indicate screen no longer virgin
/* as data entry is about to occur
SET 'VIRGIN20DA=' 'FALSE'
KEY
. !ENTER ABN !TO @TAX_REG_NO1I
. !ENTER ORD_ALLOW !TO @ORDS_ALLOWED1I

... etc: data entry , all fields
. !SEND
RETURN

... etc: other routines in the script

DYNAMIC MSM20DA
/*note the sequence of the redisplay of MSM20DA is:
/*Validate-Confirm-Validate
/*and as you press <enter> after the 2nd Validate it should take you to next screen MSM20DB
/*The idea of the code below is that the !SEND after the
/*test on the Virgin flag will take control to MSM20DB
/*and thus the next Perform is no longer executed
/*But in fact we have an infinite loop where it keeps on
/*alternating between Validate and Confirm on the same record
TRIGGER @ERRMESS1I
. VALUE ' '
. TRIGGER @FKEYS1I
. . VALUE 'XMIT-Validate, F9-Commentary'
. . KEY !IF (VIRGIN20DA = 'FALSE') !SEND
. . PERFORM MSM20DA_KEY_DATA /* only execute if virgin screen: perform data entry

. . VALUE 'XMIT-Confirm, F9-Commentary' /* Data entered and all is ok: save
. . KEY !SEND

. . VALUE '' /* Error has occured - F3 back to MSM200A
. . SET 'STATUS=' 'ERROR'
. . SET 'ERROR=' @ERRMESS1I
. . PERFORM WRITE_ERROR_FILE
. . KEY !F3

. VALUE '' /* Error has occured - F3 back to MSM200A
. SET 'STATUS=' 'ERROR'
. SET 'ERROR=' @ERRMESS1I
. PERFORM WRITE_ERROR_FILE
. KEY !F3

 
You've most probably solved this one long ago..however


In addition to your other subroutines

SUBROUTINE KEY_SEND MSM20DA
ABORT IF (VIRGIN20DA = 'TRUE')
KEY !SEND
RETURN


DYNAMIC MSM20DA
/*note the sequence of the redisplay of MSM20DA is:
/*Validate-Confirm-Validate
/*and as you press <enter> after the 2nd Validate it should take you to next screen MSM20DB
/*The idea of the code below is that the !SEND after the
/*test on the Virgin flag will take control to MSM20DB
/*and thus the next Perform is no longer executed
/*But in fact we have an infinite loop where it keeps on
/*alternating between Validate and Confirm on the same record
TRIGGER @ERRMESS1I
. VALUE ' '
. TRIGGER @FKEYS1I
. . VALUE 'XMIT-Validate, F9-Commentary'
. . PERFORM KEY_SEND
. . ABORT IF (VIRGIN20DA = 'FALSE')
. . PERFORM MSM20DA_KEY_DATA /* only execute if virgin screen: perform data entry

. . VALUE 'XMIT-Confirm, F9-Commentary' /* Data entered and all is ok: save
. . KEY !SEND

. . VALUE '' /* Error has occured - F3 back to MSM200A
. . SET 'STATUS=' 'ERROR'
. . SET 'ERROR=' @ERRMESS1I
. . PERFORM WRITE_ERROR_FILE
. . KEY !F3


C4N [morning]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top