ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Subfile positioning

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Subfile positioning

    Load all subfile. Page down to page 2 or greater. Press enter and the subfile positions to page one. What am I missing to get it to stay on the current page. Thanks!

  • #2
    Re: Subfile positioning

    SFLRCDNBR set the page position. change the variable for SFLRCDNBR = to a record on the page you want to display. for example say your subfile page size is 12 and the subfile contains 2 or more pages. setting the variable used for SFLRCDNBR to 13 will display the second page.
    I'm not anti-social, I just don't like people -Tommy Holden

    Comment


    • #3
      Re: Subfile positioning

      Thanks Tom. Why is it jumping back to page one? Is it because the SFLRCDNBR is always one right now? I don't see the keyword being used on the DDS.

      Comment


      • #4
        Re: Subfile positioning

        i do this .. It works

        dds
        PHP Code:
        A          R SUB01CTL                  SFLCTL(SUB01)             
        A*%%TS  SD  20091029  170317  FLANARY     REL-V5R4M0  5722-WDS   
        ------- 19 data records excluded --------------------------------
        A                                      RTNCSRLOC(&#REC &#FLD)    
        A                                      BLINK                     
        A                                      OVERLAY                   
        A                                      SFLCSRRRN
        (&WHERE)         
        A  31                                  SFLDSP                    
        A  32                                  SFLDSPCTL                 
        A  30                                  SFLCLR                    
        A  33                                  SFLEND
        (*MORE)             
        A                                      SFLSIZ(0016)              
        A                                      SFLPAG(0010)              
        A            SCRRN          4S 0H      SFLRCDNBR                 
        A            
        #REC          10A  H                                
        A            #FLD          10A  H                                
        A            WHERE          5S 0H 
        RPG
        PHP Code:
        fARC16AD   cf   e             WORKSTN INFDS(INFDS)        
        f                                     SFILE(SUB01:RRN1)   
        d Infds           ds                                           
        d Choice                369    369                             
        d Currec                378    379I 0            

        d RRN1            s                   like
        (SCRRN)                  


         
        //---------------------------------------------
         // $loadsfl- load up the entire subfile        
         //---------------------------------------------
              
        begsr $loadsfl;                           
                                                        
               if  
        SavRrn  > *zeros;                    
                
        RRN1  =  SavRrn;                        
                
        SCRRN =  SavRrn;                        
               endif;                                   
        ---------- 
        36 data records excluded ------------
               
        openList();                              
               
        dow fetchNext2();                        
                                                        
        ----------- 
        1 data records excluded ------------
                
        s1cname S2NAME;                       
        ---------- 
        53 data records excluded ------------
                                                        
                
        RRN1 += 1;                              
                
        SCRRN RRN1;                           
                
        write SUB01;                            
                  *
        in70 = *off;                                               
                 
        enddo;                                                       
                 
        closeList();                                                 
                                                                              
                 *
        in33 = *on;                                                 
                 
        savrrn SCRRN;                                              
                                                                              
              
        //                                                              
              //  If no records in subfile then do not disply the subfile.    
              //                                                              
                 
        if SavRrn  = *zeros;                                         
                  *
        in31 = *off;                                               
                 else;                                                        
                  
        RRN1  1;                                                  
                  
        SCRRN  1;                                                 
                 endif;                                                       
                                                                              
                
        endsr;                                                        
                                                                              

          
        //--------------------------------------------------------    
          // $Screen1 - parameter screen                                
          //--------------------------------------------------------    
               
        begsr $Screen1;                                          
                                                                        
               
        reset  EndScreen1;                                       
                
        dow  EndScreen1 'N';                                  
                                                                        
                 if 
        ScreenError 'N';                                  
                  
        $clearmsg('*' : *zero : *Blanks '*ALL' APIError); 
                 endif;                                                 
                                                                        
                 *
        in73 = *off;                                          
                 if 
        ssearch <> *blanks;                                 
                  *
        in73 = *on;                                          
                 endif;                                                 
                 
        write FKEY01;                                          
                 
        write MSGCTL;                                          
                 
        exfmt SUB01CTL;                                        
                 
        $clearmsg('*' : *zero : *Blanks '*ALL' APIError);  
                                                              
                
        reset ScreenError;                            
                if 
        Currec <> *Zeros;                          
                 
        RRN1  =  Currec;                             
                 
        SCRRN =  Currec;                             
                endif;                                        
                                                              
                
        select;                                       
             
        //                                               
             // F3 pressed end the program F3 = LeaveProgram  
             //                                               
                 
        when  Choice LeaveProgram;                 
                  
        EndScreen1 'Y';                           
             
        //                                               
             // F4 pressed customer search                    
             //                                               
                 
        when  Choice customersearch;               
                  
        $custsearch(); 
        All my answers were extracted from the "Big Dummy's Guide to the As400"
        and I take no responsibility for any of them.

        www.code400.com

        Comment


        • #5
          Re: Subfile positioning

          Originally posted by ljv_as400 View Post
          Thanks Tom. Why is it jumping back to page one? Is it because the SFLRCDNBR is always one right now? I don't see the keyword being used on the DDS.
          if SFLRCNDNBR is not defined in the DDS it always defaults to the first page...
          I'm not anti-social, I just don't like people -Tommy Holden

          Comment


          • #6
            Re: Subfile positioning

            J, I appreciate your help. This worked perfectly. Thanks!

            Comment

            Working...
            X