Cargar Texto estándar y mostrar en un POPUP

DATA: t_lines TYPE STANDARD TABLE OF tline WITH HEADER LINE.
DATABEGIN OF itab OCCURS 0,
                linea 
TYPE char70,
            
END OF itab.
      CALL FUNCTION 'READ_TEXT'      EXPORTING
        id                        = 'F01'
          language             sy-langu
          name            
name
          object          
'EKKO'
        
TABLES
          
lines                    t_lines
       
EXCEPTIONS
         
id                         1
         
language               2
         name                          
3
         not_found                     
4
         object                        
5
         reference_check               
6
         wrong_access_to_archive       
7
         
OTHERS                        8
                
.
      
IF sy-subrc <> 0.
*       MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

      
ELSE.
        itab
-linea 'Aviso Importante' .
        
APPEND itab.
*       Agregamos cada línea conseguida en el texto a la tabla que mostraremos
*      En el popup.
*      Hacemos las conversiones entre las lineas, recuerda revisar los tipos de datos.
*      y la longitud de las lineas para no perder datos.

        
LOOP AT t_lines.
          
IF STRLENt_lines-tdline 70 .
            itab
-linea t_lines-tdline(70).
              
APPEND itab.
            itab
-linea t_lines-tdline+70(62).
              
APPEND itab.
          
ELSE.
            itab
-linea t_lines-tdline.
              
APPEND itab.
          
ENDIF.
        
ENDLOOP.
*       ahora mostramos el POPUP con la tabla ya completa.
  CALL FUNCTION 'POPUP_WITH_TABLE_DISPLAY_OK'
          
EXPORTING
            endpos_col   
80 "definimos ancho, cantidad de col            endpos_row   25 "definimos alto, cantidad de líneas
            startpos_col 
"posición X en pantalla
            startpos_row 
"posición Y,(X,Y) esquina superior Izquierda
            titletext    
'Mensaje' "titulo de la ventana, ojo: no funciona bien
          
TABLES
            valuetab     
itab "tabla con las lineas del texto estándar u otro.
          
EXCEPTIONS
            break_off    
1
            
OTHERS       2.
     ENDIF.

Atte.Edwar Soto.

Comentarios

Entradas populares de este blog

Crear un campo de entrada, parametro, como un listbox en abap.

Leer Parametros de Dynpro.