Plex 2E

Expand all | Collapse all

CA 2E cursor positioning in an EDTFIL

  • 1.  CA 2E cursor positioning in an EDTFIL

    Posted Sep 09, 2015 10:38 AM

    I have an EDTFIL screen where a user will scan a bar code with CHECK(ER) causing the bar code to be validated and additional information about that bar code to appear on the screen but afterwards the cursor just positions back on the bar code field of the record that was just processed.  I've tried using SFLCSRPRG but it doesn't work.  How do I get the cursor to move down to the next record?



  • 2.  Re: CA 2E cursor positioning in an EDTFIL
    Best Answer

    Posted Sep 10, 2015 10:26 AM

    Perhaps SFLCSRPRG did not work for you because your...work station is not attached to a controller that supports an enhanced data stream.

    If you can set a field to indicate "Record processed" then you could use F18 conditioning on the fields in your record to be Output if Record processed is Yes.

    The cursor will then be positioned on the next input capable field.



  • 3.  Re: CA 2E cursor positioning in an EDTFIL

    Posted Sep 10, 2015 04:32 PM

    Thanks for the suggestion on changing the field to output so the cursor will go to the next/first input field.  I changed the screen to do this and it works perfectly but have to run it by our users to make sure there isn't a reason they would need the field to remain input capable.  Thanks.



  • 4.  Re: CA 2E cursor positioning in an EDTFIL

    Posted Sep 10, 2015 10:30 AM

    This isn't an area I'm familiar with, but it sounds like a record by record activity, so wouldn't it be a better fit if the user selected the record (and the system moved to an edtrcd maybe,) then did the scan, and the function closes for the next?

     

    or

    in 2e terms  a master excfun runs a rtvrcd or somesuch which iteratively puts out a pmtrcd for each record in the set for the scan, user presses enter, (validate) and the controller pumps out the next one ?

     

    but, as I say, I have no direct experience here.. Others may have better ideas.

     

    R



  • 5.  Re: CA 2E cursor positioning in an EDTFIL

    Posted Oct 06, 2015 02:21 AM

    Hi We do this in our system all the time mostly in on Hand held computers but also on full screen with attached scanners, you just need to write the code that processes after the barcode is scanned (I would do the validation) and if successful use *SET CURSOR to the next Input field on the Screen, Normally, I add code to see if value has changed (To stop it being run all the time), and then exit further validation (*Defer Confirm)

     

    Nick R



  • 6.  Re: CA 2E cursor positioning in an EDTFIL

    Posted Oct 06, 2015 10:53 AM

    *SET CURSOR doesn't work for me because I'm going to the same input field.  I need it to advance to the next record after the additional info displays.  Here's a screen shot of the screen I'm working with.  I took Steve's suggestion and set the field to output after validation and the additional info displays but then needed to add a function key to allow the user to delete/change the barcode if they need to.  If there's a way to keep it as an input field that would be great.  I really appreciate any help I can get.

    Reprint Barcode screen.jpg



  • 7.  Re: CA 2E cursor positioning in an EDTFIL

    Posted Oct 06, 2015 08:24 PM

    Hi have you tried getting the current cursor row (*PGM *Cursor row) and then using set cursor row incremented by 1 and Set Column to 2, I have built an app to test this works fine, you will need to do a *SET Cursor to program somewhere and you will need to do user source. This is our cobol source for Set Row/Column, if you are not sure I could probably do same for RPG or LE

     

    ......-A+++B++++++++++++++++++++++++++++++++++

    *************** Beginning of data ************

           PROCEDURE DIVISION.                   

          *** Set POSITION CURSOR INDICATOR **   

               MOVE USR-PARM-I-CSRW TO W0ROW0    

               MOVE USR-PARM-I-CSCL TO W0COL0    

               MOVE '0' TO W0OVR0                

    ****************** End of data ***************

     

    Change to use *SET CURSOR somewhere in program.

    > USER: Initialize subfile record (new record)             

    .--                                                        

    . .-CASE                                                   

    . ¦-RCD.ean 13 Bacode test is Entered                      

    . ¦ *Set Cursor: RCD.ean 13 Bacode test  (*Override=*YES)  

    . '-ENDCASE                                                

    '--                                                        

     

     

    Code to move cursor down 1 row.


    > USER: Validate subfile record fields                     

    .--                                                        

    . .-CASE                                                   

    . ¦-RCD.ean 13 Bacode test is Entered                      

    . ¦ RCD.Text (15 chars) = CND.Processed                    

    . ¦ LCL.*Cursor row = PGM.*Cursor row + CON.1              

    . ¦ Set Cursor row /Column - Utilities Display  * Column 2 

    . ¦ PGM.*Defer confirm = CND.Defer confirm                 

    . '-ENDCASE                                                

    '--                                                        



  • 8.  Re: CA 2E cursor positioning in an EDTFIL

    Posted Oct 07, 2015 11:02 AM

    That would be great if we were using version 8.7 but we are still on 8.5 so *Set Cursor is not a built in function for CA 2E yet.



  • 9.  Re: CA 2E cursor positioning in an EDTFIL

    Posted Oct 07, 2015 11:10 AM

    Hello Barbara,

    Certainly *SET CURSOR is a standard built-in function that you have in 2E 8.5; I've worked with 2E for too long to remember when we introduced it!

    Steve



  • 10.  Re: CA 2E cursor positioning in an EDTFIL

    Posted Oct 07, 2015 12:08 PM

    You're right.  I was trying to get a reply in before a meeting and mistyped.  I meant 8.5 doesn't have the *Cursor Row context.



  • 11.  Re: CA 2E cursor positioning in an EDTFIL

    Posted Oct 07, 2015 02:30 PM

    I see PGM.*Cursor Row in my 8.5 Model, and I have code going back 12 years that references it...



  • 12.  Re: CA 2E cursor positioning in an EDTFIL

    Posted Oct 07, 2015 02:35 PM

    I promise you it wasn't there before but I see it now.    It's been a long month.  Thank you everyone for your patience with me.



  • 13.  Re: CA 2E cursor positioning in an EDTFIL

    Posted Oct 07, 2015 03:08 PM

    I'm a little confused by the Set line of code in the Validate subfile record fields section.

         Set Cursor row /Column - Utilities Display  * Column 2 .

     

    Is that supposed to be the user source I'll need to add?



  • 14.  Re: CA 2E cursor positioning in an EDTFIL

    Posted Oct 07, 2015 03:23 PM

    Yes, that line of code is a function call to an EXCUSRSRC...



  • 15.  Re: CA 2E cursor positioning in an EDTFIL

    Posted Oct 07, 2015 05:01 PM

    I'm trying this on a different screen with just one barcode field with multiple input records on the screen.

    This is not working for me.  What am I doing wrong?

     

    > USER: Initialize subfile record (new record)    

    .--                                               

    . ¦ *Set Cursor: RCD.U.Garment ID  (*Override=*YES)

    '--                                              

     

    > USER: Validate subfile record fields                      

    .-CASE                                           

    ¦-RCD.U.Garment ID is Not equal to blank         

    ¦ WRK.*Cursor row = PGM.*Cursor row + CON.1      

    ¦ $$:USR Set Cursor Row - $common functions  *

         *************** Beginning of data ***************

              C                     Z-ADDWUCRW     W0ROW0 - the programs work field

              C                     Z-ADDWUCRW     ZZCSRW  - used by the record format

         ****************** End of data ******************



  • 16.  Re: CA 2E cursor positioning in an EDTFIL

    Posted Oct 07, 2015 09:15 PM

    Hi strausb

     

    I am in Australia so only get this over night.

     

    Change this to only do if RCD.U.Garment ID is entered. (otherwise it will do for every line and position on last line on screen) i.e. This never happens but causes the cursor code to be added to Source.

    > USER: Initialize subfile record (new record)

    .--                                           

    . ¦ *Set Cursor: RCD.U.Garment ID  (*Override=*YES)

    '--

     

    The usersource should have 2 Paramaters

    EDIT ACTION - FUNCTION DETAILS            ALL PARAMETERS                                                                             

    Function file : Utilities Display        Column 2                   

    Function. . . : Set Cursor row /Column                               

                                                                           

                                    Obj                                 

    IOB Parameter                Use Typ  Ctx Object Name               

      I  Cursor Row                  FLD  LCL Cursor Row               

      I  Cursor Column              FLD  CON 2        ** This sets the Column to 2 where it probably needs to be


    Definition of two fields.            

                                                               

    EDIT FIELD DETAILS                    Australian Wool Handlers               

    Field name . . . . : Cursor Column            Document'n seq. . :           

    Type . . . . . . . : REF Ref: NBR *Cursor column            Field usage: USR 

    Internal length. . :  5    Data type : P                GEN name: CSCL <---(This is important)   

                              K'bd shift:                                       

    Headings. . . . . . :-                              Old DDS name:           

      Text . . . . . . . . : Cursor Column                                       

      Left hand side text. : Cursor Column                                       

      Right hand side text :                                                     

      Column headings. . . : Cursor                                               

                            Column                                               

                                                                                 

    Control . . . . . . :-                                                       

      Default condition :    *NONE                                               

                                                                                 

                              *NONE                                               

      Modulus 10/11. . . . :                                                     

    Edit codes. . . . . :-    Mask input edit code (Y,' ')                       

      Screen input . . . . : 4 '    '                                           

      Screen output. . . . : 3 '    0'                                           

      Report . . . . . . . : 3 '    0'                           

     

    and

     

    EDIT FIELD DETAILS                    Australian Wool Handlers               

    ield name . . . . : Cursor Row                Document'n seq. . :           

    ype . . . . . . . : REF Ref: NBR *Cursor row                Field usage: USR 

    nternal length. . :  5    Data type : P                GEN name: CSRW  (<-- This is important)   

                              K'bd shift:                                       

    eadings. . . . . . :-                              Old DDS name:           

    Text . . . . . . . . : Cursor Row                                           

    Left hand side text. : Cursor Row                                           

    Right hand side text :                                                     

    Column headings. . . : Cursor                                               

                            Row                                                 

                                                                                 

    ontrol . . . . . . :-                                                       

    Default condition :    *NONE                                               

                                                                                 

                            *NONE                                               

    Modulus 10/11. . . . :                                                     

    dit codes. . . . . :-    Mask input edit code (Y,' ')                       

    Screen input . . . . : 4 '    '                                           

    Screen output. . . . : 3 '    0'                                           

    Report . . . . . . . : 3 '    0'               


    The Rpg User Source


        C                    Z-ADD#ICSRW    W0ROW0          * Sets Row to input P

        C                    Z-ADD#ICSCL    W0COL0          * Sels Col to Input P

        C                    MOVE '0'      W0OVR0          * Allow override  

     

    The #I means use the value of input parameter worth reading manual on this   


    My code.


    .-CASE                                                         

    ¦-RCD.EAN 13 Barcode test is Entered                           

    ¦ RCD.Text (15 chars) = CND.Processed                         

    ¦ LCL.Cursor Row = PGM.*Cursor row + CON.1                     

    ¦ Set Cursor Row/Column RPG - Utilities Display  * Column 2   

    ¦ PGM.*Defer confirm = CND.Defer confirm                       

    '-ENDCASE                                                   

     

    Note Cursor row not *Cursor Row and look at parameters of Set Cursor Row above.

     

    This works a treat.



  • 17.  Re: CA 2E cursor positioning in an EDTFIL

    Posted Oct 07, 2015 10:50 PM

    Thank you!!!!!!


    As you may have guessed, I did it.  My biggest problem was knowing which variable to put the incremented value in and I didn't think I needed to set the column since it wasn't changing.  Once I put in the set colun and changed my user source to set the right variable, it all came together like magic. 

    I even went a step further and get the column value in the initialize subfile record (new record) so I could use this in all the other screens I need to put this in without having to figure out what the column number.  I created user source that gets both for future use but only actually get the column number here.

    > USER: Initialize subfile record (new record) 

    .--                                             

    . .-CASE                                       

    . ¦-RCD.U.Garment ID is Not equal to blank     

    . ¦ *Set Cursor: RCD.U.Garment ID  (*Override=*YES)

    . '-ENDCASE                                     

    . $$:USR Get Csr Column/Row - $common functions  *

     

    Now I have another problem....

    Every time I hit enter it goes to the next line whether or not there's a value in it.  I have code to validate if something was entered and to send an error message if nothing was entered but it's not doing this validation.  This screen has to work for both scanning and manually entering the barcodes.

     

    Also, do I have to add a function key to get the screen to process what's been entered or is there a way to proceed to confirm?

    Thank you so much for your help!!!



  • 18.  Re: CA 2E cursor positioning in an EDTFIL

    Posted Oct 07, 2015 11:06 PM

    Not sure I understand this bit
    $$:USR Get Csr Column/Row - $common functions  *


    Anyway you should only be re-positioning the cursor if code is entered (See This bit), scanning or manually entering should not make any difference (Although some scanner's can be set to automatically sent Enter after a scan.)


    CASE                                                       

    ¦-RCD.EAN 13 Barcode test is Entered  <<< This bit                       

    ¦ RCD.Text (15 chars) = CND.Processed                       

    ¦ LCL.Cursor Row = PGM.*Cursor row + CON.1                   

    ¦ Set Cursor Row/Column RPG - Utilities Display  * Column 2 

    ¦ PGM.*Defer confirm = CND.Defer confirm                     

    '-ENDCASE                               



  • 19.  Re: CA 2E cursor positioning in an EDTFIL

    Posted Oct 07, 2015 11:21 PM

    This is where the problem all started.  I have to add check(er) to all our screens that can use a scanner to scan in the barcode.

     

    So here's what I have for my user validation.  My otherwise statement isn't happening.  I put it in debug and noticed that the program doesn't set rcd.u.garment id to blank when it goes to the next record before anything is entered so if something is entered then rcd.u.garment id changes otherwise it remains at the last value of the last record.  I hope this makes sense.

     

    > Garment ID Validation                           

    .-CASE                                            

    ¦-RCD.U.Garment ID is Not equal to blank          

    ¦ Garment ID Validation *** - $common functions  *

    ¦ LCL.u.cursor row = PGM.*Cursor row + CON.1      

    ¦ $$:USR Set Csr Row/Column - $common functions  *

         *************** Beginning of data ***************

              C                     Z-ADD#IUCSR    W0ROW0

              C                     Z-ADD#IUCSC    W0COL0

              C                     MOVE '0'       W0OVR0

         ****************** End of data ******************

    ¦ PGM.*Defer confirm = CND.Defer confirm          

    ¦-*OTHERWISE                                      

    ¦ Send error message indicating Garment ID is blank

    ¦ Send error message - 'Garment ID required.'     

    ¦ <-- *QUIT                                       

    '-ENDCASE                                        



  • 20.  Re: CA 2E cursor positioning in an EDTFIL

    Posted Oct 07, 2015 11:30 PM

    Hi Strausb maye you would like to call (Home office or mobile)

     

    Nick Runnalls AWH Pty

    +61 403 200 640

    +61 3 9551 8091 Home Office

    +61 3 5272 9270 AWH Office

     

     

     

     

     

    Regards

     

    Nick Runnalls

    Senior Programmer

     

    AWH Pty Ltd

    Wool  /  Cotton  /  Property  /  Logistics  /  Dry Bulk

     

     

     

    Email: nickrunnalls@awh.com.au 

    Web: http://www.awh.com.au 

    Phone: 03 9551 8091 

    Fax: 03 5274 2084 

    Mobile: 0403 200 640 

    Address: 250 Forest Rd * Lara, VIC, 3212 

    Postal: PO Box 283 * Lara, VIC, 3212

     

     

     

    This e-mail and any attachments may be confidential or legally privileged and

    is intended only for the exclusive and confidential use of the addressee(s). If

    you are not the intended recipient, any use, interference with, disclosure or

    copying of this material is unauthorised and prohibited. If you have received

    this message in error, please notify the sender by return e-mail immediately

    and delete the message and any attachments from your computer without making

    any copies.



  • 21.  Re: CA 2E cursor positioning in an EDTFIL

    Posted Oct 07, 2015 11:38 PM

    I'd love to when I'm back at work where it wouldn't cost me anything and not at home where it would cost me to call you.    Unfortunately, with the time difference and my deadline is tomorrow, I'm going to have to figure this out tonight somehow.  Thanks again for all your help!



  • 22.  Re: CA 2E cursor positioning in an EDTFIL

    Posted Oct 08, 2015 05:04 AM

    I hate to be banging on again on a theme I raised earlier, but having a place to download a model which contained these typer opf fragments would be a (relatively) simple, cheap way to provide a great level of support from CA, and help to bind the apparently ever dwindling community of 2e developers together.

     

    If Barbara was able to stumble over all the components of user source, with an example, of managing cursor position, I'm sure she'd have been further, faster than has been the case.

     

    We'd all - CA and the developer community, benefit from there being a place with examples and tools to study. learn from, and be more productive with.

     

    R