Page 1 of 1

How to read muiltple selected records in scroll able panel

PostPosted: Sun Mar 20, 2016 8:05 pm
by zingysayal1985
Hi All,
Please find my requirment below.

1.Displays rows in the ISPF panel from the table using TBDISPL command.
2.Allows user to select any number of rows displayed in the panel. When the user presses 'enter' key, the selected rows should be copied in an ARRAY.
3.Allows user to scroll up/down to select rows in the next pages.

Problem statement :
I am able to select rows from the ISPF table displayed in the panel but when i am trying to read the selected rows ; it is able to ready only the first record and next other
records are not getting read in the Rexx program.

Re: How to read muiltple selected records in scroll able pan

PostPosted: Sun Mar 20, 2016 8:55 pm
by zingysayal1985
Code details :
! TYPE(INPUT) INTENS(HIGH) CAPS(ON ) JUST(LEFT ) PAD('_')    
# TYPE (NT)                                                  
% TYPE (TEXT)                                                
_ TYPE (OUTPUT) COLOR(BLUE)                                  
$ TYPE (NEF)                                                  
)BODY CMD(PCMD)                                              
%COMMAND===> $PCMD                                            
#SE        DETAILS             #                              
#------------------------------#                              
)MODEL                                                        
!Z _PDATA                   #                                
)INIT                                                        
 .ZVARS = 'SE'                                                
 .CURSOR= SE                                                  
)REINIT                                                      
  REFRESH(*)                                                  
 .CURSOR=&CURS                                                
)PROC                                                        
  &ROW = .CSRROW                                              
 IF (&ZTDSELS ¬=0000)                                        
 VER (&SE,LIST,S,B,M,R,V)                                    
  &ROW = .CSRROW                                              
  IF (&ROW NE 0)                                              
  IF (&SE = &Z)                                              
      &SE = S                                                
 

Rexx code:

DO WHILE ZTDSELS > 0                        
 SAY ZTDSELS                                
SE = STRIP(SE)                              
UPPER SE                                    
UPPER CNF                                    
SAY CNF                                      
 "CONTROL DISPLAY SAVE"                      
 IF SE ='S' THEN                            
 DO                                          
 SAY PDATA                                  
/*"TBSKIP" PDATA    "ROW("ZTDSELS")" */      
 END                                        
 "ISPEXEC TBDISPL"PDATA                      
 ZTDSELS = ZTDSELS - 1                      
 IF ZTDSELS = 1 THEN ZTDSELS = 0            
 IF RC = 8 THEN LEAVE                        
 "CONTROL DISPLAY RESTORE"                  
END


CODE' d

Re: How to read muiltple selected records in scroll able pan

PostPosted: Mon Mar 21, 2016 9:45 pm
by Pedro
There are no comments in the code!

The key thing is that you have to issue TBDISPL service without specifying the panel name. It will retrieve the next row selected.

Re: How to read muiltple selected records in scroll able pan

PostPosted: Tue Mar 22, 2016 4:23 am
by zingysayal1985
Many Thanks Pedro. Its working fine now.