×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Question with coding of GUI Script for MSM20DB

Question with coding of GUI Script for MSM20DB

Question with coding of GUI Script for MSM20DB

(OP)
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.

RE: Question with coding of GUI Script for MSM20DB

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

RE: Question with coding of GUI Script for MSM20DB

(OP)
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

RE: Question with coding of GUI Script for MSM20DB

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

RE: Question with coding of GUI Script for MSM20DB

(OP)
Thanks OB1.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close